[systemd-devel] [patch] Add -lresolv to libsystemd_intenal_la_LIBADD to prevent underlinking issues
Samuli Suominen
ssuominen at gentoo.org
Sun Mar 16 01:10:15 PDT 2014
Since -Wl,-fuse-ld=gold addition, this happens on IA64 arch where binutils's ld gold doesn't support --gc-sections yet:
libtool: link: ia64-unknown-linux-gnu-gcc -shared -fPIC -DPIC src/libudev/.libs/libudev_la-libudev.o src/libudev/.libs/libudev_la-libudev-list.o src/libudev/.libs/libudev_la-libu
dev-util.o src/libudev/.libs/libudev_la-libudev-device.o src/libudev/.libs/libudev_la-libudev-enumerate.o src/libudev/.libs/libudev_la-libudev-monitor.o src/libudev/.libs/libudev_l
a-libudev-queue.o src/libudev/.libs/libudev_la-libudev-hwdb.o -Wl,--whole-archive ./.libs/libsystemd-internal.a ./.libs/libsystemd-shared.a -Wl,--no-whole-archive -Wl,--as-needed
-lrt -ldl -O2 -Wl,--no-undefined -Wl,--gc-sections -Wl,-z -Wl,relro -Wl,-z -Wl,now -Wl,-fuse-ld=gold -Wl,--version-script=/tmp/systemd-211/src/libudev/libudev.sym -Wl,-O1
-pthread -Wl,-soname -Wl,libudev.so.1 -o .libs/libudev.so.1.4.0
cc1: warning: ./src/core: No such file or directory [enabled by default]
/usr/lib/gcc/ia64-unknown-linux-gnu/4.7.3/../../../../ia64-unknown-linux-gnu/bin/ld: Warning: gc-sections option ignored
./.libs/libsystemd-internal.a(libsystemd_internal_la-sd-resolve.o): In function `handle_request':
/tmp/systemd-211/src/libsystemd/sd-resolve/sd-resolve.c:432: undefined reference to `__res_search'
/tmp/systemd-211/src/libsystemd/sd-resolve/sd-resolve.c:430: undefined reference to `__res_query'
collect2: error: ld returned 1 exit status
make: *** [libudev.la] Error 1
Patch adds -lresolv to libsystemd_internal_la_LIBADD = accordingly, so building works with or without --gc-sections working properly.
See also, http://bugs.gentoo.org/show_bug.cgi?id=504700
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Link-against-lresolv-for-linker-errors-like-tmp-syst.patch
Type: text/x-patch
Size: 1156 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20140316/cdbf02af/attachment.bin>
More information about the systemd-devel
mailing list