[WIP] Set visibility attribute on internal function symbols to hidden#3658
[WIP] Set visibility attribute on internal function symbols to hidden#3658martin-frbg wants to merge 37 commits intoOpenMathLib:developfrom martin-frbg:hidesymbols
Conversation
|
It would be nice if this could be resolved in a way that works cross-platform. Unfortunately, Windows doesn't understand See also, e.g., https://www.gnu.org/software/gnulib/manual/html_node/Exported-Symbols-of-Shared-Libraries.html for a more complete description. |
|
The PR so far has the attribute setting conditional on C_MSVC not being set, and my understanding from the original issue is that no similar problem was observed in their Windows builds. Are you suggesting that this approach is wrong ? |
|
The approach here isn't wrong. It's just not easily portable to Windows (because on that platform, there is just a flag for "export this" and there is none for "don't export this"). I'm not sure what the "dll namespaces" could be that are supposedly helping on Windows. The instructions at the end of the Gnulib article miss the correct flags for MinGW. Something like the following in a header that is included in all files that export symbols could work: With that, all symbols that should be exported could be tagged with |
I'll note that SciPy does this; it has many separate submodules with one or multiple Python extension modules using BLAS/LAPACK, and the support for ILP64 was implemented in stages (and is still incomplete). The PR description at scipy/scipy#11193 talks about how use of 32-bit and 64-bit BLAS libraries at the same time is done. |
cf. MacPython/openblas-libs#79 (remaining symbol conflicts between builds with and without INTERFACE64 as the internally used functions to not get suffixed. Adding suffixes for them would be the second-best solution if some compiler balks at the attribute)