libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

recursive ltdl causes symbols to disappear from .dll.a on mingw32


From: Brice Goglin
Subject: recursive ltdl causes symbols to disappear from .dll.a on mingw32
Date: Sat, 25 Aug 2012 10:44:20 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.5) Gecko/20120624 Icedove/10.0.5

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]