-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Fix symbol visibility on Linux when compiling with -fvisibility=hidden #1535
Fix symbol visibility on Linux when compiling with -fvisibility=hidden #1535
Conversation
Thanks for the PR. Looks good but please fix the CI errors. |
I'm quite puzzled by the CI errors, since I cannot reproduce them locally. Apparently it's testing some different compile configuration there than what I have locally. I'll have to find the time to figure out what's going on here. If you have any hints that would be appreciated. |
Ah, |
dcd956f
to
c1ac04e
Compare
this should fix the linux build, but I wonder if the |
AFAIK yes, it is required by MSVC. I suggest introducing another macro (sigh) |
With the AppVeyor build passing... do we really need this? Shouldn't that test this API too, just like the Linux CI on Travis did? |
We do. CI doesn't test all possible configurations, just several common ones. |
c1ac04e
to
a8eddc2
Compare
Make FMT_API symbols use the default visibility on non-Windows platforms. Otherwise, one cannot use the generated fmt library when compiling globally with -fvisibility=hidden. Fixes compile errors like: ``` ../3rdParty/fmt/include/fmt/core.h:757: error: undefined reference to 'fmt::v6::internal::assert_fail(char const*, int, char const*)' ``` Note that the symbol exists, but is local: ``` $ nm -C libfmtd.so.6.1.3 | grep assert_fail U __assert_fail 0000000000233ffa t fmt::v6::internal::assert_fail(char const*, int, char const*) ``` With this patch, the compile error is gone and the symbol is properly exported: ``` $ nm -a bin/libfmtd.so -C | grep assert_fail U __assert_fail 00000000002366ba T fmt::v6::internal::assert_fail(char const*, int, char const*) ``` Change-Id: I96054e622d9a2ae81907e1b01a1033e629767a91
a8eddc2
to
7977db4
Compare
Thanks! |
Make FMT_API symbols use the default visibility on non-Windows
platforms. Otherwise, one cannot use the generated fmt library when
compiling globally with -fvisibility=hidden.
Fixes compile errors like:
Note that the symbol exists, but is local:
With this patch, the compile error is gone and the symbol is properly
exported:
I agree that my contributions are licensed under the {fmt} license, and agree to future changes to the licensing.