ebtables: fix the 'static' build target
PATCH 1/1 ebtables: fix the 'static' build target
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 <[email protected]>
--- Makefile.am | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
Makefile.am +1 -2
@@ -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
Signature · 1 line
2.35.1.894.gb6a874cedc-goog