net-misc/ntp-4.2.4_p7 fails in the linking stage with "undefined reference to `in6addr_any'", even though I emerge it with USE=-ipv6 This only happens when building it against uclibc, building it against glibc works fine. Reproducible: Always Steps to Reproduce: 1. build a system using the profile uclibc/x86 2. emerge =net-misc/ntp-4.2.4_p7 Actual Results: i586-gentoo-linux-uclibc-gcc -O2 -march=pentium-mmx -fomit-frame-pointer -pipe -Wall -Wcast-qual -Wmissing-prototypes -Wpointer-arith -Wshadow -Wno-strict-prototypes -Winit-self -Wl,-O1 -o ntpd cmd_args.o ntp_config.o ntp_io.o ntpd.o ntpd-opts.o version.o -L/usr/lib libntpd.a -lm -lcrypto ../libopts/.libs/libopts.a ../libntp/libntp.a ntp_io.o: In function `init_io': ntp_io.c:(.text+0x2f80): undefined reference to `in6addr_any' ntp_io.c:(.text+0x2f88): undefined reference to `in6addr_any' ntp_io.c:(.text+0x2f90): undefined reference to `in6addr_any' ntp_io.c:(.text+0x2f98): undefined reference to `in6addr_any' libntpd.a(ntp_intres.o): In function `ntp_intres': ntp_intres.c:(.text+0xc5f): undefined reference to `in6addr_any' libntpd.a(ntp_intres.o):ntp_intres.c:(.text+0xc76): more undefined references to `in6addr_any' follow collect2: ld returned 1 exit status make[3]: *** [ntpd] Error 1 Expected Results: net-misc/ntp-4.2.4_p7 should build normally against uclibc just like net-misc/ntp-4.2.4_p6 does Portage 2.1.6.13 (uclibc/x86, gcc-4.1.2, uclibc-0.9.28.3-r3, 2.6.29-gentoo-r5 i686) ================================================================= System uname: Linux-2.6.29-gentoo-r5-i686-Intel-R-_Core-TM-2_CPU_6600_@_2.40GHz-with-libc0 Timestamp of tree: Sun, 07 Jun 2009 00:20:01 +0000 app-shells/bash: 3.2_p39 dev-lang/python: 2.5.4-r2 sys-apps/baselayout: 1.12.11.1 sys-apps/sandbox: 1.6-r2 sys-devel/autoconf: 2.63 sys-devel/automake: 1.10.2 sys-devel/binutils: 2.18-r3 sys-devel/gcc-config: 1.4.1 sys-devel/libtool: 1.5.26 virtual/os-headers: 2.6.27-r2 ACCEPT_KEYWORDS="x86" CBUILD="i586-gentoo-linux-uclibc" CFLAGS="-O2 -march=pentium-mmx -fomit-frame-pointer -pipe" CHOST="i586-gentoo-linux-uclibc" CONFIG_PROTECT="/etc" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d" CXXFLAGS="-O2 -march=pentium-mmx -fomit-frame-pointer -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig distlocks fixpackages nodoc noinfo noman parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch userpriv" GENTOO_MIRRORS="http://ftp.snt.utwente.nl/pub/linux/gentoo http://distfiles.gentoo.org" LDFLAGS="-Wl,-O1" LINGUAS="en_US" MAKEOPTS="-j3" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" SYNC="rsync://rsync.pearlgates.net/gentoo-portage" USE="cli cracklib crypt dri midi mmx mudflap ncurses openmp pcre perl python readline reflection session spl ssl tcpd uclibc x86 xorg zlib" ALSA_CARDS="none" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="uclibc" INPUT_DEVICES="none" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_US" USERLAND="GNU" VIDEO_CARDS="none" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
net-misc/ntp mishandles ipv6. Clearly it should be patched with some #ifdef __IPV6__ kind of functionality around the offending code. Most likely this should be handled upstream. Or if we are lucky a patch can be pulled from buildroot or some other uclibc aware distro. Also note that the user can USE=ipv6 when building uclibc to prevent this problem from happening.
I found a similar bug report on support.ntp.org, here: https://support.ntp.org/bugs/show_bug.cgi?id=436 Comment #8 by Alain Guibert is interesting. Especially this: "When checking for IPv6 structures, NTP 4.2.4 ./configure just looks after struct sockaddr_in6. If it's there, ./configure assumes most basic IPv6 things do exist. And as they don't exist, compilation will fail. Even --disable-ipv6 doesn't help." Perhaps this is similar to what we're seeing here?
uClibc should not export in6addr_any in its headers when IPv6 is disabled
(In reply to SpanKY from comment #3) > uClibc should not export in6addr_any in its headers when IPv6 is disabled
sys-libs/uclibc has been removed from the tree, replaced by sys-libs/uclibc-ng