-
Notifications
You must be signed in to change notification settings - Fork 364
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
Default visibility of shared library symbols #304
Comments
For windows builds (like on other OSes), it doesn't matter which option is default. Both should work fine. |
On windows with Clang though, |
Thanks for pointing this out. It sounds like what you're saying is that on Windows, we will always export only the annotated symbols, whereas on Linux we have the option via |
Yes. There's an option with gcc on windows ( |
Understood. I'm totally fine with documenting in the Does AppVeyor inherently use clang when building for Windows? |
Out of the 4 jobs on appveyor, first one uses gcc and the other 3 uses clang. |
Okay, here's my plan. I see that we have access
What should I use for gcc on Windows if I wanted the equivalent of Let me know if I left anything out. |
|
Okay, thanks. Once I finish the code modifications, you can comment on the logic and/or suggest changes as needed. |
@isuruf Take a look at the changes I made to |
As you probably noticed, I didn't bother branching for Windows vs non-Windows when using icc, mostly because we already don't make any effort to support Windows builds for anything beyond AppVeyor (gcc and clang). |
Made another update in 8093956, this time to add symbols that were missing that were needed by the testsuite when building in AppVeyor and linking to the shared library (this probably affected Linux too, but I just fixed it and didn't confirm). |
Looks good to me. Clang on Linux and OSX also support |
@isuruf Thanks for pointing that out. The appropriate change is in 6bfe381. I think I'm done with this issue for now. I'll leave it open for a while to solicit feedback on whether the default should be I'm also thinking about renaming the option to |
As I alluded to, I ended up changing the |
Since this issue has attracted no comments from the community, I'll assume that nobody really objects to |
Thanks to #303, we are very close to having a configure-time option to control the default (or starting) visibility of symbols within shared libraries. Thanks to Isuru's efforts, we have now annotated which function prototypes and global variable declarations correspond to "public" APIs and symbols, with the remaining symbols assumed to be eligible for being "hidden" (for internal use only). That is, by compiling with
-fvisibility=hidden
, the default visibility of all symbols is hidden, and then our new annotations selectively re-publicize those that should be exported. Similarly, when using-fvisibility=default
, the default visibility is "public" (default
here is a bit of a misnomer, as explained in the gcc man page), in which case all symbols, public and internal, get exported.I am working on a new
configure
option to BLIS,--enable-export-all
. This option would cause-fvisibility=default
to be used, which would mean all symbols are exported within shared libraries, even those that virtually every user of BLIS would have no need for.--disable-export-all
would cause-fvisibility=hidden
to be used, which would mean only symbols identified as part of our public APIs would be exported.My primary question for the community is: what should be the default for this new
configure
option? (My preference is for--disable-export-all
to be the default, meaning that we hide internal-only symbols from shared libraries unless the user asks for them at configure-time.)Secondarily, I wanted to ask @isuruf (and/or others) what compiler options (if any) should be used or withheld in each of the above cases (
--enable-export-all
and--disable-export-all
) in order to accommodate the AppVeyor build process for Windows binaries.The text was updated successfully, but these errors were encountered: