libtool
[Top][All Lists]
Advanced

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

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


From: Brice Goglin
Subject: Re: recursive ltdl causes symbols to disappear from .dll.a on mingw32
Date: Tue, 04 Sep 2012 15:15:48 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.5) Gecko/20120624 Icedove/10.0.5

FYI, I finally found the problem.
ltdl symbols are marked as __declspec(dllexport) while my symbols are
not. It looks like it causes all my symbols to be hidden after link.
I am going to look at marking my symbols as dllexport too (we only
optionally used gcc's visibility attributes so far).
Does anybody know if marking as dllexport could cause other problems?

Thanks
Brice



Le 25/08/2012 10:44, Brice Goglin a écrit :
> 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]