Hi all,
I package lots of freeware stuff on AIX, and I always have to redo
the work that libtool does to create and link to shared objects.
Its only over the last week or so that I've finally isolated the
problem, and the problem is in the AIX linker. However there is
a simple workaround.
I'm going to try to submit a defect to AIX, but I'm wondering if the
workaround has already been integrated into a recent version of libtool. I
did look at the archive of the mailing list but I couldn't find
anything...
The testcase for the defect is in attachement. Here's what is generated
when I run the makefile:
# make
cc -c -o main.o main.c
cc -c -o dodl.o dodl.c
cc -o libdodl.so -bM:SRE -bnoentry -bexpall dodl.o
cc -c -o shr.o shr.c
cc -o realshr.so -bM:SRE -bnoentry -bexpall shr.o
cc -o main_so main.o -L. -ldodl -brtl
ld: 0711-224 WARNING: Duplicate symbol: p_xargc
ld: 0711-224 WARNING: Duplicate symbol: p_xargv
ld: 0711-224 WARNING: Duplicate symbol: p_xrcfg
ld: 0711-224 WARNING: Duplicate symbol: p_xrc
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
rm -f libdodl.a
ar -gcr libdodl.a libdodl.so
cc -o main_a main.o -L. -ldodl
cc -o main_tst main.o libdodl.so
ld: 0711-224 WARNING: Duplicate symbol: p_xargc
ld: 0711-224 WARNING: Duplicate symbol: p_xargv
ld: 0711-224 WARNING: Duplicate symbol: p_xrcfg
ld: 0711-224 WARNING: Duplicate symbol: p_xrc
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
esther #
In other words the AIX linker treats a shared object wrapped in an archive
file differently to a shared object either given directly on the
commandline or "found" in the library search phase when the -brtl (run
time linking) option is used.
All the versions of libtool that I've seen just make a symbolic link
between the .so object and the .a filename. This also produces the
Duplicate symbol warnings.
Although my testcase does run without problems, I can certify that
this problem *does* cause coredumps in real applications (that's why
I always end up redoing the link manually..).
Thanks,
Ciaran
+-------------------------------------------------------------------------+
Ciaran Deignan Tel: (France) 04 76 29 79 92
BULL XS-BU (http://www-frec.bull.com) HA and Consolidation
Mail to: [EMAIL PROTECTED] Bullcom: 229 79 92
PGP: B1 78 FB 88 FD 86 58 A8 89 7B 22 8C D0 E8 71 FC Fax: 229 75 18
+-------------------------------------------------------------------------+
aix_ld_tst.tar.gz