netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Justin Swartz <justin.swartz@risingedge.co.za>
To: netfilter-devel@vger.kernel.org
Cc: Robert Kolchmeyer <rkolchmeyer@google.com>,
	Justin Swartz <justin.swartz@risingedge.co.za>
Subject: [PATCH] ebtables: extend the 'static' build target fix.
Date: Sat, 25 Jun 2022 10:14:41 +0200	[thread overview]
Message-ID: <20220625081441.13323-1-justin.swartz@risingedge.co.za> (raw)

Assign "-all-static" (instead of "-static") to "static_LDFLAGS" in
Makefile.am, as libtool will only produce a static binary if it is
explicitly told that all of the linked libraries should be static.

BEFORE

$ file static
static: ELF 32-bit LSB pie executable, Intel 80386, version 1 (SYSV),
        dynamically linked, interpreter /lib/ld-musl-i386.so.1,
        not stripped

AFTER

$ file static
static: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),
        statically linked, not stripped

REFERENCE

"Another common situation where static linking is desirable is in
 creating a standalone binary. Use libtool to do the linking and
 add the -all-static flag."  --  Libtool Manual, Section 3.7

Signed-off-by: Justin Swartz <justin.swartz@risingedge.co.za>
---
 Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index b246064..d011919 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -51,7 +51,7 @@ ebtablesd_LDADD = libebtc.la
 ebtables_legacy_restore_SOURCES = ebtables-restore.c
 ebtables_legacy_restore_LDADD = libebtc.la
 static_SOURCES = ebtables-standalone.c $(libebtc_la_SOURCES)
-static_LDFLAGS = -static
+static_LDFLAGS = -all-static
 examples_ulog_test_ulog_SOURCES = examples/ulog/test_ulog.c getethertype.c
 
 daemon: ebtablesd ebtablesu
-- 


             reply	other threads:[~2022-06-25  8:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-25  8:14 Justin Swartz [this message]
2022-07-03  9:52 ` [PATCH resend] ebtables: extend the 'static' build target fix Justin Swartz
2022-07-28  8:13   ` Florian Westphal
2022-07-28  8:56     ` Justin Swartz
2022-07-28 10:37       ` Florian Westphal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220625081441.13323-1-justin.swartz@risingedge.co.za \
    --to=justin.swartz@risingedge.co.za \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=rkolchmeyer@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).