[Top][All Lists]

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

Re: extra exports with libtool (pr-msvc-support)

From: Peter Rosin
Subject: Re: extra exports with libtool (pr-msvc-support)
Date: Thu, 27 Aug 2009 16:53:27 +0200
User-agent: Thunderbird (Windows/20090812)

Den 2009-08-25 22:54 skrev David Byron:
Re-ordering paragraphs...

Not on all systems, but I think that will happen with gcc/ld though.
I think they will only export dllexported symbols if at least one such
symbol exist. However, this causes some trouble if you e.g. have a
library that is not decorated with dllexport and which uses ltdl as a
convinience library. Since ltdl is decorated with dllexport, only the
ltdl symbols are exported in that case, which of course is not what
you generally want...

Using ltdl seems like the more complicated case.  Clearly I'm biased, but
requiring extra work to prepare a library for ltdl seems more natural than
the other way around.

Which is more work depends on where you are coming from. The portable
way to specify which symbols you want to be visible (with libtool)
is to use -export-symbols or -export-symbols-regex, IIUC. So,
assuming you have some visibility requirements you are better off
using those options anyway.

Given that, and the fact that I have found no way to detect which
symbols have been dllexport-decorated, it seemed best to export
everything unless any of the above options are given.

This is by design. For the msvc branch, libtool digs
through the object files to get all public symbols and
exports those, regardless of any dllexport decorations.

This is a bit surprising.  If gcc/ld doesn't do it, and msvc doesn't do it,
why does libtool do it by default?

gcc/ld does something equivalent if there are no dllexport
decorations at all, at least with the options libtool is
using (I think so anyway, but I may be wrong here too). So,
I suspect that fewer and fewer packages will have the
dllexport decorations and rely on auto-export instead.

 What can I do to convince libtool to keep function foo
Use one of the -export-symbols SYMFILE or
-export-symbols-regex REGEX options.

Whether it's the default or not, is there some way to convince libtool to
look at the __declspec(export) decorations I've already got in place?

Not that I know of, sorry...


reply via email to

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