bootstrap-prefix.sh failed because build of dev-libs/libxml2-2.9.1-r2 fails during linking with bunch of these: libtool: link: i386-pc-solaris2.11-gcc -D_REENTRANT -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls -Wno-long-long -o .libs/xmllint xmllint.o -L/rpool/gentoo/usr/lib -L/rpool/gentoo/lib -L/rpool/gentoo/tmp/usr/lib ./.libs/libxml2.so -lpthread -lz /rpool/gentoo/usr/lib/libiconv.so -lm -Wl,-rpath -Wl,/rpool/gentoo/usr/lib -Wl,-rpath -Wl,/rpool/gentoo/lib -Wl,-rpath -Wl,/rpool/gentoo/tmp/usr/lib ./.libs/libxml2.so: undefined reference to `bind' ./.libs/libxml2.so: undefined reference to `gethostbyname' ./.libs/libxml2.so: undefined reference to `__res_state' ./.libs/libxml2.so: undefined reference to `connect' ./.libs/libxml2.so: undefined reference to `send' ./.libs/libxml2.so: undefined reference to `getsockname' ./.libs/libxml2.so: undefined reference to `freeaddrinfo' ./.libs/libxml2.so: undefined reference to `recv' ./.libs/libxml2.so: undefined reference to `getsockopt' ./.libs/libxml2.so: undefined reference to `socket' ./.libs/libxml2.so: undefined reference to `listen' ./.libs/libxml2.so: undefined reference to `res_init' ./.libs/libxml2.so: undefined reference to `inet_ntop' ./.libs/libxml2.so: undefined reference to `getaddrinfo' collect2: ld returned 1 exit status # ldd -r /rpool/gentoo/var/tmp/portage/dev-libs/libxml2-2.9.1-r2/work/libxml2-2.9.1-default/.libs/libxml2.so libpthread.so.1 => /lib/libpthread.so.1 libz.so.1 => /rpool/gentoo/usr/lib/libz.so.1 libiconv.so.2 => /rpool/gentoo/usr/lib/libiconv.so.2 libm.so.2 => /lib/libm.so.2 libc.so.1 => /lib/libc.so.1 libgcc_s.so.1 => /rpool/gentoo/usr/i386-pc-solaris2.11/lib/gcc/libgcc_s.so.1 symbol not found: freeaddrinfo (/rpool/gentoo/var/tmp/portage/dev-libs/libxml2-2.9.1-r2/work/libxml2-2.9.1-default/.libs/libxml2.so) symbol not found: __res_state (/rpool/gentoo/var/tmp/portage/dev-libs/libxml2-2.9.1-r2/work/libxml2-2.9.1-default/.libs/libxml2.so) symbol not found: getsockname (/rpool/gentoo/var/tmp/portage/dev-libs/libxml2-2.9.1-r2/work/libxml2-2.9.1-default/.libs/libxml2.so) symbol not found: recv (/rpool/gentoo/var/tmp/portage/dev-libs/libxml2-2.9.1-r2/work/libxml2-2.9.1-default/.libs/libxml2.so) symbol not found: listen (/rpool/gentoo/var/tmp/portage/dev-libs/libxml2-2.9.1-r2/work/libxml2-2.9.1-default/.libs/libxml2.so) symbol not found: res_init (/rpool/gentoo/var/tmp/portage/dev-libs/libxml2-2.9.1-r2/work/libxml2-2.9.1-default/.libs/libxml2.so) symbol not found: gethostbyname (/rpool/gentoo/var/tmp/portage/dev-libs/libxml2-2.9.1-r2/work/libxml2-2.9.1-default/.libs/libxml2.so) symbol not found: socket (/rpool/gentoo/var/tmp/portage/dev-libs/libxml2-2.9.1-r2/work/libxml2-2.9.1-default/.libs/libxml2.so) symbol not found: inet_ntop (/rpool/gentoo/var/tmp/portage/dev-libs/libxml2-2.9.1-r2/work/libxml2-2.9.1-default/.libs/libxml2.so) symbol not found: getaddrinfo (/rpool/gentoo/var/tmp/portage/dev-libs/libxml2-2.9.1-r2/work/libxml2-2.9.1-default/.libs/libxml2.so) symbol not found: connect (/rpool/gentoo/var/tmp/portage/dev-libs/libxml2-2.9.1-r2/work/libxml2-2.9.1-default/.libs/libxml2.so) symbol not found: bind (/rpool/gentoo/var/tmp/portage/dev-libs/libxml2-2.9.1-r2/work/libxml2-2.9.1-default/.libs/libxml2.so) symbol not found: getsockopt (/rpool/gentoo/var/tmp/portage/dev-libs/libxml2-2.9.1-r2/work/libxml2-2.9.1-default/.libs/libxml2.so) symbol not found: send (/rpool/gentoo/var/tmp/portage/dev-libs/libxml2-2.9.1-r2/work/libxml2-2.9.1-default/.libs/libxml2.so) Reproducible: Always
Created attachment 372372 [details] build.log
Created attachment 372374 [details] emerge --info '=dev-libs/libxml2-2.9.1-r2::gentoo_prefix'
With LDFLAGS="-lnsl -lz -L/lib" I can get past configure stage, but it fails later during linking: libtool: link: i386-pc-solaris2.11-gcc -D_REENTRANT -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls -Wno-long-long -o .libs/testSchemas testSchemas.o -L/lib ./.libs/libxml2.so -L/rpool/gentoo/usr/lib -L/rpool/gentoo/lib -L/rpool/gentoo/tmp/usr/lib -lnsl -lpthread -lz /rpool/gentoo/usr/lib/libiconv.so -lm -lsocket -Wl,-rpath -Wl,/rpool/gentoo/usr/lib ./.libs/libxml2.so: undefined reference to `gzopen64' collect2: ld returned 1 exit status This is because with -L/lib it links against solaris libz.so (which is needed because otherwise /lib/libelf.so complains during configure configure:3613: i386-pc-solaris2.11-gcc -lnsl -L/lib conftest.c >&5 /lib/libelf.so.1: undefined reference to `inflateEnd@SUNW_1.1' /lib/libelf.so.1: undefined reference to `inflate@SUNW_1.1' /lib/libelf.so.1: undefined reference to `deflate@SUNW_1.1' /lib/libelf.so.1: undefined reference to `deflateReset@SUNW_1.1' /lib/libelf.so.1: undefined reference to `deflateInit_@SUNW_1.1' /lib/libelf.so.1: undefined reference to `inflateReset@SUNW_1.1' /lib/libelf.so.1: undefined reference to `deflateEnd@SUNW_1.1' /lib/libelf.so.1: undefined reference to `inflateInit_@SUNW_1.1' collect2: ld returned 1 exit status ) There is no gzopen64 in solaris provided libz: $ objdump -T /lib/libz.so | grep -i gzopen 00003d1c g DF .text 000005ee SUNW_1.1 gzopen there is gzopen64 in prefix libz (there are actually 2 versions – in /rpool/gentoo/lib/ and in /rpool/gentoo/tmp/usr/lib/): $ objdump -T /rpool/gentoo/tmp/usr/lib/libz.so.1.2.8 | grep gzopen 0000f6b0 g DF .text 00000016 Base gzopen64 0000f690 g DF .text 00000016 Base gzopen $ objdump -T /rpool/gentoo/lib/libz.so.1.2.8 | grep gzopen 0000f418 g DF .text 0000001b ZLIB_1.2.3.3 gzopen64 0000f3fd g DF .text 0000001b Base gzopen Is there any way I can get past this?
Created attachment 376506 [details] config.log
EXTRA_ECONF="--without-zlib" LDFLAGS="-lnsl -lz -L/lib" emerge libxml2 build successfully.
I notice that it fails to add -lnsl because it tries to find gethostent and dies with those inflate/deflate errors. I wonder why libelf has these undefined references. I also wonder if you have another libelf in the Gentoo system. Mine is at /usr/lib from the dev-libs/elfutils package but it doesn't have any references to inflate/deflate.
There is no libelf under /rpool/gentoo/ (actually dev-libs/elfutils are keyworded and dev-libs/libelf is masked in /rpool/gentoo/usr/portage/profiles/prefix/sunos/solaris/package.mask).
later I've hit similiar problem with libz while building python:2.7 with LDFLAGS="-lnsl -lz -L/lib" building 'binascii' extension i386-pc-solaris2.11-gcc -fPIC -fno-strict-aliasing -fwrapv -DNDEBUG -I. -I/rpool/gentoo/usr/include -I/rpool/gentoo/var/tmp/portage/dev-lang/python-2.7.5-r4/work/Python-2.7.5/Include -I/rpool/gentoo/var/tmp/portage/dev-lang/python-2.7.5-r4/work/i386-pc-solaris2.11 -c /rpool/gentoo/var/tmp/portage/dev-lang/python-2.7.5-r4/work/Python-2.7.5/Modules/binascii.c -o build/temp.solaris-2.11-i86pc.32bit-2.7/rpool/gentoo/var/tmp/portage/dev-lang/python-2.7.5-r4/work/Python-2.7.5/Modules/binascii.o -DUSE_ZLIB_CRC32 i386-pc-solaris2.11-gcc -shared -lnsl -lz -L/lib -L/rpool/gentoo/lib -L/rpool/gentoo/usr/lib -L/usr/lib -L. -lnsl -lz -L/lib -L/rpool/gentoo/lib -L/rpool/gentoo/usr/lib -L/usr/lib -L. -fno-strict-aliasing -fwrapv -DNDEBUG -I. -IInclude -I/rpool/gentoo/var/tmp/portage/dev-lang/python-2.7.5-r4/work/Python-2.7.5/Include -I/rpool/gentoo/usr/include build/temp.solaris-2.11-i86pc.32bit-2.7/rpool/gentoo/var/tmp/portage/dev-lang/python-2.7.5-r4/work/Python-2.7.5/Modules/binascii.o -L/lib -L/rpool/gentoo/lib -L/rpool/gentoo/usr/lib -L/usr/lib -L. -lz -lpython2.7 -o build/lib.solaris-2.11-i86pc.32bit-2.7/binascii.so *** WARNING: renaming "binascii" since importing it failed: ld.so.1: python: fatal: libz.so.1: open failed: No such file or directory
Fixed in the new bootstrap script.