From: Robert Kolchmeyer <rkolchmeyer@google.com>
To: netfilter-devel@vger.kernel.org
Cc: Robert Kolchmeyer <rkolchmeyer@google.com>
Subject: [PATCH] ebtables: fix the 'static' build target
Date: Fri, 18 Mar 2022 15:58:54 -0700 [thread overview]
Message-ID: <20220318225854.619325-1-rkolchmeyer@google.com> (raw)
Currently, `make static` results in the following error:
undefined reference to `main'
I took a guess at what 'static' is supposed to produce, and thought it
would make sense to use the main definition from ebtables-standalone.c.
Also, producing 'static' by linking against a libebtc.a results in a
non-functional program (immediate segmentation fault). This is because
the initialization functions defined in libebtc.a aren't linked into
the result program. I ran into issues trying to use the --whole-archive
linker option with libtool, so I figured linking in the libebtc object
files directly was the simplest approach.
Signed-off-by: Robert Kolchmeyer <rkolchmeyer@google.com>
---
Makefile.am | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 6181003..b246064 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -50,9 +50,8 @@ ebtables_legacy_LDADD = libebtc.la
ebtablesd_LDADD = libebtc.la
ebtables_legacy_restore_SOURCES = ebtables-restore.c
ebtables_legacy_restore_LDADD = libebtc.la
-static_SOURCES = ebtables.c
+static_SOURCES = ebtables-standalone.c $(libebtc_la_SOURCES)
static_LDFLAGS = -static
-static_LDADD = libebtc.la
examples_ulog_test_ulog_SOURCES = examples/ulog/test_ulog.c getethertype.c
daemon: ebtablesd ebtablesu
--
2.35.1.894.gb6a874cedc-goog
reply other threads:[~2022-03-18 22:59 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20220318225854.619325-1-rkolchmeyer@google.com \
--to=rkolchmeyer@google.com \
--cc=netfilter-devel@vger.kernel.org \
/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).