Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 500786 - net-dns/bind-tools USE=abi_mips_n32 - /usr/lib/libdl.so: could not read symbols: File in wrong format
Summary: net-dns/bind-tools USE=abi_mips_n32 - /usr/lib/libdl.so: could not read symbo...
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: MIPS Linux
: Normal normal (vote)
Assignee: MIPS Porters
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-09 14:28 UTC by Stuart Shelton
Modified: 2018-03-28 01:28 UTC (History)
1 user (show)

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


Attachments
bind-tools-9.9.3_p2:20140209-134056.log.gz (bind-tools-9.9.3_p2:20140209-134056.log.gz,27.40 KB, application/gzip)
2014-02-09 14:28 UTC, Stuart Shelton
Details
emerge --info (emerge.info,14.92 KB, text/plain)
2014-02-09 14:30 UTC, Stuart Shelton
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stuart Shelton 2014-02-09 14:28:40 UTC
Created attachment 369948 [details]
bind-tools-9.9.3_p2:20140209-134056.log.gz

It appears that bind-tools is linking against libraries in (/usr)/lib, rather than those in (/usr)/lib32 on MIPS with n32 ABI:

if [ X"/usr/bin/perl" = X -o X"${MAKE_SYMTABLE:-}" = X ] ; then    mips64-unknown-linux-gnu-gcc  -I/usr/portage/local/edgemax/tmp/portage/net-dns/bind-tools-9.9.3_p2/work/bind-9.9.3-P2 -I./include -I/usr/portage/local/edgemax/tmp/portage/net-dns/bind-tools-9.9.3_p2/work/bind-9.9.3-P2/lib/dns/include -I../../lib/dns/include -I/usr/portage/local/edgemax/tmp/portage/net-dns/bind-tools-9.9.3_p2/work/bind-9.9.3-P2/lib/bind9/include -I../../lib/bind9/include -I/usr/portage/local/edgemax/tmp/portage/net-dns/bind-tools-9.9.3_p2/work/bind-9.9.3-P2/lib/isc/include -I../../lib/isc -I../../lib/isc/include -I../../lib/isc/unix/include -I../../lib/isc/nothreads/include -I../../lib/isc/mips/include -I/usr/portage/local/edgemax/tmp/portage/net-dns/bind-tools-9.9.3_p2/work/bind-9.9.3-P2/lib/lwres/include -I../../lib/lwres/unix/include -I../../lib/lwres/include -I/usr/portage/local/edgemax/tmp/portage/net-dns/bind-tools-9.9.3_p2/work/bind-9.9.3-P2/lib/isccfg/include -I../../lib/isccfg/include -I/usr/include  -DVERSION=\"9.9.3-P2\" -D_GNU_SOURCE -march=octeon+ -Os -pipe -DDIG_SIGCHASE -I/usr/include/libxml2  -W -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wformat -Wpointer-arith -fno-strict-aliasing  -Wl,-O1 -Wl,--as-needed -o nslookup ${BASEOBJS} ${LIBS0} ../../lib/lwres/liblwres.a ../../lib/dns/libdns.a  -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lcrypto ../../lib/bind9/libbind9.a ../../lib/isccfg/libisccfg.a ../../lib/isc/libisc.a -L/usr/lib -lidnkit  -ldl -lcap  -L/usr/lib32 -lxml2 -lz -lm -ldl; else rm -f nslookuptmp0;    mips64-unknown-linux-gnu-gcc  -I/usr/portage/local/edgemax/tmp/portage/net-dns/bind-tools-9.9.3_p2/work/bind-9.9.3-P2 -I./include -I/usr/portage/local/edgemax/tmp/portage/net-dns/bind-tools-9.9.3_p2/work/bind-9.9.3-P2/lib/dns/include -I../../lib/dns/include -I/usr/portage/local/edgemax/tmp/portage/net-dns/bind-tools-9.9.3_p2/work/bind-9.9.3-P2/lib/bind9/include -I../../lib/bind9/include -I/usr/portage/local/edgemax/tmp/portage/net-dns/bind-tools-9.9.3_p2/work/bind-9.9.3-P2/lib/isc/include -I../../lib/isc -I../../lib/isc/include -I../../lib/isc/unix/include -I../../lib/isc/nothreads/include -I../../lib/isc/mips/include -I/usr/portage/local/edgemax/tmp/portage/net-dns/bind-tools-9.9.3_p2/work/bind-9.9.3-P2/lib/lwres/include -I../../lib/lwres/unix/include -I../../lib/lwres/include -I/usr/portage/local/edgemax/tmp/portage/net-dns/bind-tools-9.9.3_p2/work/bind-9.9.3-P2/lib/isccfg/include -I../../lib/isccfg/include -I/usr/include  -DVERSION=\"9.9.3-P2\" -D_GNU_SOURCE -march=octeon+ -Os -pipe -DDIG_SIGCHASE -I/usr/include/libxml2  -W -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wformat -Wpointer-arith -fno-strict-aliasing  -Wl,-O1 -Wl,--as-needed -o nslookuptmp0 ${BASEOBJS} ${LIBS0} ../../lib/lwres/liblwres.a ../../lib/dns/libdns.a  -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lcrypto ../../lib/bind9/libbind9.a ../../lib/isccfg/libisccfg.a ../../lib/isc/libisc.a -L/usr/lib -lidnkit  -ldl -lcap  -L/usr/lib32 -lxml2 -lz -lm -ldl || exit 1; rm -f nslookup-symtbl.c nslookup-symtbl.o; /usr/bin/perl ../../util/mksymtbl.pl -o nslookup-symtbl.c nslookuptmp0 || exit 1; make nslookup-symtbl.o || exit 1; rm -f nslookuptmp1;    mips64-unknown-linux-gnu-gcc  -I/usr/portage/local/edgemax/tmp/portage/net-dns/bind-tools-9.9.3_p2/work/bind-9.9.3-P2 -I./include -I/usr/portage/local/edgemax/tmp/portage/net-dns/bind-tools-9.9.3_p2/work/bind-9.9.3-P2/lib/dns/include -I../../lib/dns/include -I/usr/portage/local/edgemax/tmp/portage/net-dns/bind-tools-9.9.3_p2/work/bind-9.9.3-P2/lib/bind9/include -I../../lib/bind9/include -I/usr/portage/local/edgemax/tmp/portage/net-dns/bind-tools-9.9.3_p2/work/bind-9.9.3-P2/lib/isc/include -I../../lib/isc -I../../lib/isc/include -I../../lib/isc/unix/include -I../../lib/isc/nothreads/include -I../../lib/isc/mips/include -I/usr/portage/local/edgemax/tmp/portage/net-dns/bind-tools-9.9.3_p2/work/bind-9.9.3-P2/lib/lwres/include -I../../lib/lwres/unix/include -I../../lib/lwres/include -I/usr/portage/local/edgemax/tmp/portage/net-dns/bind-tools-9.9.3_p2/work/bind-9.9.3-P2/lib/isccfg/include -I../../lib/isccfg/include -I/usr/include  -DVERSION=\"9.9.3-P2\" -D_GNU_SOURCE -march=octeon+ -Os -pipe -DDIG_SIGCHASE -I/usr/include/libxml2  -W -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wformat -Wpointer-arith -fno-strict-aliasing  -Wl,-O1 -Wl,--as-needed -o nslookuptmp1 ${BASEOBJS} nslookup-symtbl.o ${LIBS0} ../../lib/lwres/liblwres.a ../../lib/dns/libdns.a  -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lcrypto ../../lib/bind9/libbind9.a ../../lib/isccfg/libisccfg.a ../../lib/isc/libisc-nosymtbl.a -L/usr/lib -lidnkit  -ldl -lcap  -L/usr/lib32 -lxml2 -lz -lm -ldl || exit 1; rm -f nslookup-symtbl.c nslookup-symtbl.o; /usr/bin/perl ../../util/mksymtbl.pl -o nslookup-symtbl.c nslookuptmp1 || exit 1; make nslookup-symtbl.o || exit 1;    mips64-unknown-linux-gnu-gcc  -I/usr/portage/local/edgemax/tmp/portage/net-dns/bind-tools-9.9.3_p2/work/bind-9.9.3-P2 -I./include -I/usr/portage/local/edgemax/tmp/portage/net-dns/bind-tools-9.9.3_p2/work/bind-9.9.3-P2/lib/dns/include -I../../lib/dns/include -I/usr/portage/local/edgemax/tmp/portage/net-dns/bind-tools-9.9.3_p2/work/bind-9.9.3-P2/lib/bind9/include -I../../lib/bind9/include -I/usr/portage/local/edgemax/tmp/portage/net-dns/bind-tools-9.9.3_p2/work/bind-9.9.3-P2/lib/isc/include -I../../lib/isc -I../../lib/isc/include -I../../lib/isc/unix/include -I../../lib/isc/nothreads/include -I../../lib/isc/mips/include -I/usr/portage/local/edgemax/tmp/portage/net-dns/bind-tools-9.9.3_p2/work/bind-9.9.3-P2/lib/lwres/include -I../../lib/lwres/unix/include -I../../lib/lwres/include -I/usr/portage/local/edgemax/tmp/portage/net-dns/bind-tools-9.9.3_p2/work/bind-9.9.3-P2/lib/isccfg/include -I../../lib/isccfg/include -I/usr/include  -DVERSION=\"9.9.3-P2\" -D_GNU_SOURCE -march=octeon+ -Os -pipe -DDIG_SIGCHASE -I/usr/include/libxml2  -W -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wformat -Wpointer-arith -fno-strict-aliasing  -Wl,-O1 -Wl,--as-needed -o nslookuptmp2 ${BASEOBJS} nslookup-symtbl.o ${LIBS0} ../../lib/lwres/liblwres.a ../../lib/dns/libdns.a  -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lcrypto ../../lib/bind9/libbind9.a ../../lib/isccfg/libisccfg.a ../../lib/isc/libisc-nosymtbl.a -L/usr/lib -lidnkit  -ldl -lcap  -L/usr/lib32 -lxml2 -lz -lm -ldl; /usr/bin/perl ../../util/mksymtbl.pl -o nslookup-symtbl2.c nslookuptmp2; count=0; until diff nslookup-symtbl.c nslookup-symtbl2.c > /dev/null ; do count=`expr $count + 1` ; test $count = 42 && exit 1 ; rm -f nslookup-symtbl.c nslookup-symtbl.o; /usr/bin/perl ../../util/mksymtbl.pl -o nslookup-symtbl.c nslookuptmp2 || exit 1; make nslookup-symtbl.o || exit 1;    mips64-unknown-linux-gnu-gcc  -I/usr/portage/local/edgemax/tmp/portage/net-dns/bind-tools-9.9.3_p2/work/bind-9.9.3-P2 -I./include -I/usr/portage/local/edgemax/tmp/portage/net-dns/bind-tools-9.9.3_p2/work/bind-9.9.3-P2/lib/dns/include -I../../lib/dns/include -I/usr/portage/local/edgemax/tmp/portage/net-dns/bind-tools-9.9.3_p2/work/bind-9.9.3-P2/lib/bind9/include -I../../lib/bind9/include -I/usr/portage/local/edgemax/tmp/portage/net-dns/bind-tools-9.9.3_p2/work/bind-9.9.3-P2/lib/isc/include -I../../lib/isc -I../../lib/isc/include -I../../lib/isc/unix/include -I../../lib/isc/nothreads/include -I../../lib/isc/mips/include -I/usr/portage/local/edgemax/tmp/portage/net-dns/bind-tools-9.9.3_p2/work/bind-9.9.3-P2/lib/lwres/include -I../../lib/lwres/unix/include -I../../lib/lwres/include -I/usr/portage/local/edgemax/tmp/portage/net-dns/bind-tools-9.9.3_p2/work/bind-9.9.3-P2/lib/isccfg/include -I../../lib/isccfg/include -I/usr/include  -DVERSION=\"9.9.3-P2\" -D_GNU_SOURCE -march=octeon+ -Os -pipe -DDIG_SIGCHASE -I/usr/include/libxml2  -W -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wformat -Wpointer-arith -fno-strict-aliasing  -Wl,-O1 -Wl,--as-needed -o nslookuptmp2 ${BASEOBJS} nslookup-symtbl.o ${LIBS0} ../../lib/lwres/liblwres.a ../../lib/dns/libdns.a  -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lcrypto ../../lib/bind9/libbind9.a ../../lib/isccfg/libisccfg.a ../../lib/isc/libisc-nosymtbl.a -L/usr/lib -lidnkit  -ldl -lcap  -L/usr/lib32 -lxml2 -lz -lm -ldl; /usr/bin/perl ../../util/mksymtbl.pl -o nslookup-symtbl2.c nslookuptmp2; done ; mv nslookuptmp2 nslookup; rm -f nslookuptmp0 nslookuptmp1 nslookuptmp2 nslookup-symtbl2.c; fi
/usr/lib/libdl.so: could not read symbols: File in wrong format
collect2: error: ld returned 1 exit status
make: *** [dig] Error 1
make: *** Waiting for unfinished jobs....
/usr/lib/libdl.so: could not read symbols: File in wrong format
collect2: error: ld returned 1 exit status
/usr/lib/libdl.so: could not read symbols: File in wrong format
collect2: error: ld returned 1 exit status
make: *** [nslookup] Error 1
make: *** [host] Error 1
make: Leaving directory `/usr/portage/local/edgemax/tmp/portage/net-dns/bind-tools-9.9.3_p2/work/bind-9.9.3-P2/bin/dig'
 * ERROR: net-dns/bind-tools-9.9.3_p2::gentoo failed (compile phase):
 *   emake failed

'/usr/lib' seems to be hardcoded several times in configure.in.

OTOH, Building the same packages for amd64 x32 ABI succeeds - and this also has libraries in /lib32.

libdl libraries on the problem system are as follows:

# ls -l /lib*/libdl*
-rwxr-xr-x 1 root sys  10464 Nov 12 05:43 /lib32/libdl-2.17.so
lrwxrwxrwx 1 root root    13 Nov 12 05:57 /lib32/libdl.so.2 -> libdl-2.17.so
-rwxr-xr-x 1 root sys  15392 Nov 12 05:41 /lib64/libdl-2.17.so
lrwxrwxrwx 1 root root    13 Nov 12 05:55 /lib64/libdl.so.2 -> libdl-2.17.so
-rwxr-xr-x 1 root sys  10516 Nov 12 05:42 /lib/libdl-2.17.so
lrwxrwxrwx 1 root root    13 Nov 12 05:57 /lib/libdl.so.2 -> libdl-2.17.so
# ls -l /usr/lib*/libdl*
-rw-r--r-- 1 root sys  11834 Nov 12 05:43 /usr/lib32/libdl.a
lrwxrwxrwx 1 root root    22 Nov 12 05:57 /usr/lib32/libdl.so -> ../../lib32/libdl.so.2
-rw-r--r-- 1 root sys  16256 Nov 12 05:41 /usr/lib64/libdl.a
lrwxrwxrwx 1 root root    22 Nov 12 05:56 /usr/lib64/libdl.so -> ../../lib64/libdl.so.2
-rw-r--r-- 1 root sys  11610 Nov 12 05:42 /usr/lib/libdl.a
lrwxrwxrwx 1 root root    20 Nov 12 05:57 /usr/lib/libdl.so -> ../../lib/libdl.so.2
# file /lib*/libdl-2*
/lib32/libdl-2.17.so: ELF 32-bit MSB shared object, MIPS, N32 MIPS64 rel2 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, stripped
/lib64/libdl-2.17.so: ELF 64-bit MSB shared object, MIPS, MIPS64 rel2 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, stripped
/lib/libdl-2.17.so:   ELF 32-bit MSB shared object, MIPS, MIPS64 rel2 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, stripped

Patching the ebuild to correct configure.in with the result of $(get-libdir) as follows:

        # Fix hard-coding of .../lib/
        sed -ri "s:(openssl|gssapi|kame_path|prefix|libiconv|idn_path|atf)/lib([/ ]):\1/$(get_libdir)\2:g" \
                configure.in || die

... allows the build to succeed, but the tools don't seem to work correctly:

# host google.com
socket.c:2376: socket() failed: Protocol not supported
host: isc_socket_create: unexpected error

... although it is possible that this may be an unrelated problem.
Comment 1 Stuart Shelton 2014-02-09 14:30:22 UTC
Created attachment 369950 [details]
emerge --info
Comment 2 Christian Ruppert (idl0r) gentoo-dev 2014-11-15 21:05:59 UTC
@mips, that might be for you.
Comment 3 Anthony Basile gentoo-dev 2015-02-07 18:55:01 UTC
(In reply to Christian Ruppert (idl0r) from comment #2)
> @mips, that might be for you.

The bug looks legitimate, and even typical of multilib mips, but I wasn't able to reproduce on my lemote desktop which has default/linux/mips/13.0/multilib/n32.

@the reporter.  I know this is a bit old, but can you tell me what USE flags you were using.  Maybe I'm not triggering it?
Comment 4 Stuart Shelton 2015-02-08 11:29:33 UTC
I /suspect/ that the USE-flags may have been:

    gssapi idn ipv6 readline ssl urandom xml -doc -gost

... but in the intervening time since, the MIPS system I encountered this error on - an EdgeMAX EdgeRouter Lite 3 - died and was replaced several times over, ultimately to be exchanged for an x86-based PCEngines APU1c (I need a low-power SFF platform with at least three ethernet sockets) - so I'm afraid I no longer have access to the affected system.


(In reply to Anthony Basile from comment #3)
> (In reply to Christian Ruppert (idl0r) from comment #2)
> > @mips, that might be for you.
> 
> The bug looks legitimate, and even typical of multilib mips, but I wasn't
> able to reproduce on my lemote desktop which has
> default/linux/mips/13.0/multilib/n32.
> 
> @the reporter.  I know this is a bit old, but can you tell me what USE flags
> you were using.  Maybe I'm not triggering it?
Comment 5 Anthony Basile gentoo-dev 2015-02-11 13:20:18 UTC
(In reply to Stuart Shelton from comment #4)
> I /suspect/ that the USE-flags may have been:
> 
>     gssapi idn ipv6 readline ssl urandom xml -doc -gost
> 
> ... but in the intervening time since, the MIPS system I encountered this
> error on - an EdgeMAX EdgeRouter Lite 3 - died and was replaced several
> times over, ultimately to be exchanged for an x86-based PCEngines APU1c (I
> need a low-power SFF platform with at least three ethernet sockets) - so I'm
> afraid I no longer have access to the affected system.
> 

Wierd mine died too.  I tested on the lemote yeeloong with 

profile = default/linux/mips/13.0/mipsel/multilib/n32

which should be the equivalent of your big endian profile.

There have been other changes too, like I restructured the profiles back in Oct 2014.  This bug maybe an artifact of the new multilib USE flags before the profiles were ready for them, but I'm just guessing.  I can't reproduce this bug no matter what I do.

I'm going to close WORKSFORME.  If I hit it (or you do) we'll just reopen.
Comment 6 Anthony Basile gentoo-dev 2015-02-12 12:00:40 UTC
I finally hit the problem.  Not exactly the same but clearly related.  The original was with libdl.so whereas I hit it with libgssapi_krb5.so.  So something is going on in the buidl system of bind-tools that gets the wrong libdir.
Comment 7 Matt Turner gentoo-dev 2018-03-28 01:28:35 UTC
Unable to reproduce.