I wrote a test case, see attached tar ball.

To run, execute:

tar xzf bugreport391427.tar.gz
cd bugreport391427
./autoconf.sh
make
./tst


The reason that it does work seems to be that debian's libtool
doesn't detect that '-lx' depends on -ldl. The ./tst succeeds
when either:

1) -ldl is added to the libtool command (right of -lx)
   This cause libtool to delete the previous -ldl.
   Thus: having: ./libltdl/libltdlc.la -Linstall/lib -lx -ldl
   results in:
   libltdlc.a -ldl libx.so -ldl internally, which is then
   changed correctly to: libltdlc.a libx.so -ldl

OR

2) It is even possible to let libtool detect that -lx
   depends on -ldl by editting the libtool file and
   changing:
   link_all_deplibs=no
   into
   link_all_deplibs=yes

After doing 2), we get:

/bin/sh ./libtool --tag=CC --mode=link gcc  -g -O2   -o tst  tst.o 
./libltdl/libltdlc.la -Linstall/lib -lx
mkdir .libs
gcc -g -O2 -o tst tst.o  ./libltdl/.libs/libltdlc.a 
-L/home/carlo/src/debian/bugreport391427/install/lib 
/home/carlo/src/debian/bugreport391427/libx/../install/lib/libx.so -ldl 
-Wl,--rpath -Wl,/home/carlo/src/debian/bugreport391427/libx/../install/lib 
-Wl,--rpath -Wl,/home/carlo/src/debian/bugreport391427/libx/../install/lib


Note how the libtool command line does NOT contain -ldl,
and that -ldl appears AFTER libx.so.

~/src/debian/bugreport391427>./tst
Success!

Also note, that this edit of libtool is not needed
with the stock/upstream libtool.

Attached: tst.tar.gz

-- 
Carlo Wood <[EMAIL PROTECTED]>

Attachment: bugreport391427.tar.gz
Description: Binary data

Reply via email to