-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support a cross-platform symbol export list for library targets #4298
Comments
Maybe for convenience we could have a parameter |
It should be noted that the recommended and portable way of controlling symbol visibility is visibility attributes. If it is in any way possible to use (or port to) those, you really should. It also makes it possible for the compiler to do extra optimizations. |
@jpakkane One of the issues I have with the visbility attributes is that they don't appear to allow hiding symbols re-exported by static includes. For a concrete example, this build script sets Do you know of a way around that without relying on a linker script? |
I believe the way to do that is |
Thats not portable, it does not work with the macOS linker for example. And even if it would I guess it would not help with object files that are built by generators like So I believe there is a need for a portable way to specify a symbol export list in meson, like it can be done for libtool. |
To control symbol visibility, the FAQ suggests hard-coding
-Wl,--version-script,foo.map
withfoo.map
being a GCC linker script. However, this approach is not portable to various other compilers. It will not easily work on windows, macOS, etc.Instead of having projects hard-code stuff like this, I think it would be a good idea for meson to take care of symbol visibility in a cross-platform way. I suggest adding an extra parameter to the
library()
targets, likesymbols:
or whatever, which takes a list of symbols to export. (Or a path to a file or whatever)Some hints for how to use this symbol list on various platforms can be taken from
waflib/extras/syms.py
:The text was updated successfully, but these errors were encountered: