[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#15673: Problem when linking non-libNAMEd modules on AIX 6.1
From: |
Thomas Jahns |
Subject: |
bug#15673: Problem when linking non-libNAMEd modules on AIX 6.1 |
Date: |
Mon, 21 Oct 2013 18:13:52 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130922 Icedove/17.0.9 |
Hello,
I was investigating a problem with libtool on AIX which occured as part of the
testcase libtool7.sh of automake 1.14.
The test project tries to link via -dlpreopen a module named mod2.la.
libtool then goes on to replace, as can be seen below, mod2.la with -L.libs
-lmod2
$ make
/client/bin/bash ./libtool --tag=CC --mode=link xlc_r -q32 -qmaxmem=-1 -O
-o prg prg.o -dlopen libmod1.la -dlpreopen mod2.la
libtool: link: rm -f .libs/prg.nm .libs/prg.nmS .libs/prg.nmT
libtool: link: (cd .libs && xlc_r -q32 -qmaxmem=-1 -O -c "prgS.c")
libtool: link: rm -f ".libs/prgS.c" ".libs/prg.nm" ".libs/prg.nmS"
".libs/prg.nmT"
libtool: link: xlc_r -q32 -qmaxmem=-1 -O -o .libs/prg prg.o .libs/prgS.o
-L./.libs -lmod2
-Wl,-blibpath:/sw/src/autotools/automake-1.14-build/t/libtool7.dir/_inst/lib:/sw/ibm/xlc/11.1.0.8/usr/lib:/sw/ibm/xlc/11.1.0.8/usr/vac/lib:/usr/lib:/lib
ld: 0706-006 Cannot find or open library file: -l mod2
ld:open(): No such file or directory
make: *** [prg] Error 255
When I make the change to the resolution of dlpreopen modules to libtool (see
attached patch), the problem goes away:
$ make
/client/bin/bash ./libtool --tag=CC --mode=link xlc_r -q32 -qmaxmem=-1 -O
-o prg prg.o -dlopen libmod1.la -dlpreopen mod2.la
libtool: link: rm -f .libs/prg.nm .libs/prg.nmS .libs/prg.nmT
libtool: link: (cd .libs && xlc_r -q32 -qmaxmem=-1 -O -c "prgS.c")
libtool: link: rm -f ".libs/prgS.c" ".libs/prg.nm" ".libs/prg.nmS"
".libs/prg.nmT"
libtool: link: xlc_r -q32 -qmaxmem=-1 -O -o .libs/prg prg.o .libs/prgS.o
-bstatic ./.libs/mod2.a -bdynamic
-Wl,-blibpath:/sw/src/autotools/automake-1.14-build/t/libtool7.dir/_inst/lib:/sw/ibm/xlc/11.1.0.8/usr/lib:/sw/ibm/xlc/11.1.0.8/usr/vac/lib:/usr/lib:/lib
I'm sure my patch is imperfect in that it shouldn't simply switch back to
dynamic mode but instead infer from other flags what the current state of the
link editor was before switching to -bstatic but I don't know how to make that
happern. At least it's working for the moment. Because shared object can be
linked statically on AIX, it would probably also be preferrable to link the
mod2.so file.
Regards, Thomas
host-triplet: powerpc-ibm-aix6.1.0.0
shell: GNU bash 4.0.10(1)-release (powerpc-ibm-aix5.3.0.0
compiler: xlc_r 13.1.0.8
compiler flags: -q32 -qmaxmem=-1 -O
linker: /usr/bin/ld ld: LD 1.65.5.1 (1/10/12)
libtool: 2.4.2
automake 1.14
autoconf 2.69
--
Thomas Jahns
DKRZ GmbH, Department: Application software
Deutsches Klimarechenzentrum
Bundesstraße 45a
D-20146 Hamburg
Phone: +49-40-460094-151
Fax: +49-40-460094-270
Email: Thomas Jahns <address@hidden>
aix-dlpreopen.patch
Description: Text Data
smime.p7s
Description: S/MIME Cryptographic Signature
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- bug#15673: Problem when linking non-libNAMEd modules on AIX 6.1,
Thomas Jahns <=