Hello,

I have successfully embedded libltdl inside hwloc using the recursive
thanks to your advice a couple days ago. But I am now trying to see if
that works under windows too. I am seeing something beyond my
understanding. What seems to happen is that linking the ltdl la file
makes my symbols disappear from the .dll.a file used for linking my
programs.

This seems very specific to win32 (I am building on windows 7 with mingw
i686 from 2011/12/10, it's gcc-4.7, binutils 2.22.51, libtool 2.4.2).

The link verbose lines (a bit simplified) are:

/bin/sh ../libtool --tag=CC --mode=link i686-w64-mingw32-gcc \
--no-undefined -version-info 0:0:0 -lm -lgi32 -export-dynamic \
-o libhwloc.la -rpath ... \
<all my *.lo files> ../src/libltdl/libltdlc.a


which translate into

libtool: link: i686-w64-mingw32-gcc -shared <all my .libs/*.o> \
-Wl,--whole-archive ../src/libltdl/.libs/libltdlc.a -Wl,--no-whole-archive \
-lgi32 -o .libs/libhwloc-0.dll -Wl,--enable-auto-image-base \
-Xlinker --out-implib -X linker .libs/libhwloc.dll.a


When running this, the output libhwloc.dll.a that --out-implib generates
contains no symbol from my hwloc .o files. nm finds many symbols from
ltdl, but nothing else. Then linking my hwloc programs fails since it
misses all my hwloc symbols.

If I remove -Wl,--whole-archive, my symbols are back, and those of ltdl
are not visible anymore. But they don't need to be visible anyway. I can
successfully link my program using hwloc, things look good.

It looks like the symbols are in the .dll when they are missing in the
.dll.a. But I need the .dll.a for linking anyway.

>From what I understand -Wl,--whole-archive is added by libtool when
replacing libltdlc.la. Do you see a way to make this work?

Thanks!
Brice


_______________________________________________
https://lists.gnu.org/mailman/listinfo/libtool

Reply via email to