Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 504198 - dev-libs/libxml2-2.9.1-r2 - ./.libs/libxml2.so: undefined reference to `bind', `...'
Summary: dev-libs/libxml2-2.9.1-r2 - ./.libs/libxml2.so: undefined reference to `bind'...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: AMD64 Solaris
: Normal normal (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-11 12:14 UTC by tao
Modified: 2014-11-24 10:07 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,120.40 KB, text/plain)
2014-03-11 12:17 UTC, tao
Details
emerge --info '=dev-libs/libxml2-2.9.1-r2::gentoo_prefix' (emerge-info.txt,3.37 KB, text/plain)
2014-03-11 12:17 UTC, tao
Details
config.log (config.log,140.41 KB, text/plain)
2014-05-06 18:13 UTC, tao
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tao 2014-03-11 12:14:21 UTC
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
Comment 1 tao 2014-03-11 12:17:08 UTC
Created attachment 372372 [details]
build.log
Comment 2 tao 2014-03-11 12:17:59 UTC
Created attachment 372374 [details]
emerge --info '=dev-libs/libxml2-2.9.1-r2::gentoo_prefix'
Comment 3 tao 2014-05-05 18:34:37 UTC
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?
Comment 4 tao 2014-05-06 18:13:01 UTC
Created attachment 376506 [details]
config.log
Comment 5 tao 2014-05-06 18:49:55 UTC
EXTRA_ECONF="--without-zlib" LDFLAGS="-lnsl -lz -L/lib" emerge libxml2 build successfully.
Comment 6 James Le Cuirot gentoo-dev 2014-05-06 18:59:35 UTC
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.
Comment 7 tao 2014-05-07 12:17:49 UTC
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).
Comment 8 tao 2014-05-07 12:56:20 UTC
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
Comment 9 Ruud Koolen (RETIRED) archtester gentoo-dev Security 2014-11-24 10:07:45 UTC
Fixed in the new bootstrap script.