Bugzilla – Bug 559
GIT HEAD fails to build under --as-needed because of xtables dynamic link split
Last modified: 2009-03-30 01:25:23
You need to log in before you can comment on or make changes to this bug.
(Seen with ecae0c3efc6851d767c759b77d897d113af821a0.) The split of xtables into its own library means that iptables itself no longer uses libdl: only xtables does; yet -ldl precedes xtables in the link line, and xtables itself is not dependent upon libdl. So if -Wl,--as-needed is on, this happens: libtool: link: gcc -D_LARGEFILE_SOURCE=1 -D_LARGE_FILES -D_FILE_OFFSET_BITS=64 -D_REENTRANT -Wall -Waggregate-return -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wshadow -Wstrict-prototypes -Winline -pipe -DXTABLES_LIBDIR=\"/usr/libexec/xtables\" -DXTABLES_INTERNAL -I./include -I./include -Wstrict-overflow=1 -g -fasynchronous-unwind-tables -fomit-frame-pointer -pipe -march=native -D__NO_STRING_INLINES -D__NO_MATH_INLINES -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -ffast-math -O2 -rdynamic -Wl,--enable-new-dtags -Wl,--hash-style=gnu -Wl,-O1 -Wl,-z -Wl,relro -pipe -o .libs/iptables iptables-standalone.o iptables.o -ldl -lm libiptc/libiptc.a extensions/libext4.a ./.libs/libxtables.so ./.libs/libxtables.so: undefined reference to `dlerror' ./.libs/libxtables.so: undefined reference to `dlopen' collect2: ld returned 1 exit status make[2]: *** [iptables] Error 1 make[2]: Leaving directory `/usr/packages/iptables/i686-loki' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/usr/packages/iptables/i686-loki' make: *** [all] Error 2
Created an attachment (id=292) [details] Fix, granting xtables the appropriate dependencies directly
that patch is incomplete ... the -lm needs to be after the .a archives this one (by Arfrever Frehtes Taifersar Arahesis) is better i think: http://bugs.gentoo.org/attachment.cgi?id=169948
Oops. Yes, agreed, I missed that. (I suppose it works because pretty much *everything* pulls in -lm anyway...)
Fixed as of commit v1.4.3-rc1-107-g1288bf7.