Skip to contentSkip to conversation

build: a couple of `-lnfnetlink` fixes.

PATCH Applied Jeremy Sowden 2 participants 4 messages Nov 30, 2020 netfilter

lore
Share & tools
lore
#0 lore raw

cover build: a couple of `-lnfnetlink` fixes.

Building libnetfilter_log.so passes -lnfnetlink to the linker twice and building libnetfilter_log_libipulog.so doesn't pass it at all.

Jeremy Sowden (2):
build: remove duplicate -lnfnetlink from LDFLAGS.
build: link libnetfilter_log_libipulog.so explicitly to
libnfnetlink.so.

 src/Makefile.am | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
2.29.2
#1 lore raw

PATCH 1/2 build: remove duplicate `-lnfnetlink` from LDFLAGS.

$(libnetfilter_log_la_LIBADD) includes $(LIBNFNETLINK_LIBS), so there's no need to include -lnfnetlink in $(libnetfilter_log_la_LDFLAGS).

---
 src/Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/Makefile.am +1 -1
index aa561525585c..33be04828223 100644
@@ -24,7 +24,7 @@ include ${top_srcdir}/Make_global.am
 
 lib_LTLIBRARIES = libnetfilter_log.la
 
-libnetfilter_log_la_LDFLAGS = -Wc,-nostartfiles -lnfnetlink	\
+libnetfilter_log_la_LDFLAGS = -Wc,-nostartfiles	\
 			      -version-info $(LIBVERSION)
 libnetfilter_log_la_SOURCES = libnetfilter_log.c nlmsg.c
 libnetfilter_log_la_LIBADD  = ${LIBNFNETLINK_LIBS} ${LIBMNL_LIBS}
Signature · 1 line
2.29.2
#2 lore raw

PATCH 2/2 build: link libnetfilter_log_libipulog.so explicitly to libnfnetlink.so.

In reply to Jeremy Sowden

It uses symbols from libnfnetlink.so, but doesn't link to it, relying on an implicit transitive linkage through libnetfilter_log.so. Add $(LIBNFNETLINK_LIBS) to $(libnetfilter_log_libipulog_la_LIBADD).

---
 src/Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/Makefile.am +1 -1
index 33be04828223..335c393f760a 100644
@@ -34,6 +34,6 @@ lib_LTLIBRARIES += libnetfilter_log_libipulog.la
 
 libnetfilter_log_libipulog_la_LDFLAGS = -Wc,-nostartfiles	\
 					-version-info 1:0:0
-libnetfilter_log_libipulog_la_LIBADD = libnetfilter_log.la
+libnetfilter_log_libipulog_la_LIBADD = libnetfilter_log.la ${LIBNFNETLINK_LIBS}
 libnetfilter_log_libipulog_la_SOURCES = libipulog_compat.c
 endif
Signature · 1 line
2.29.2
maintainer Applied
#3 lore raw
In reply to Jeremy Sowden
Quoted 7 lines · Jeremy Sowden

Building libnetfilter_log.so passes -lnfnetlink to the linker twice and building libnetfilter_log_libipulog.so doesn't pass it at all.

Jeremy Sowden (2):
build: remove duplicate -lnfnetlink from LDFLAGS.
build: link libnetfilter_log_libipulog.so explicitly to
libnfnetlink.so.

Applied, thanks.