-
Notifications
You must be signed in to change notification settings - Fork 120
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
docs: GNU symbol visibility option #994
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -572,6 +572,22 @@ If a file is added to the CMake build system by updating one of the ``CMakeLists | |||||||
will not explicitly reconfigure the project. Instead, the generated build-system will automatically | ||||||||
detect the change and reconfigure the project after :meth:`skbuild.cmaker.CMaker.make` is called. | ||||||||
|
||||||||
.. _symbol_visibility: | ||||||||
|
||||||||
Controlling exported symbol visibility | ||||||||
-------------------------------------- | ||||||||
|
||||||||
When using a GNU based compiler on Linux, scikit-build will reduce the binary size by removing all the native exported methods. | ||||||||
By default, only the ``PyInit_<moduleName>`` (or ``init<moduleName>``) entry point is exported from the native module. | ||||||||
If you need to preserve native exports in your module, you may set ``SKBUILD_GNU_SKIP_LOCAL_SYMBOL_EXPORT_OVERRIDE`` as a | ||||||||
`CMake option <https://scikit-build.readthedocs.io/en/latest/usage.html#cmake-configure-options>`_ | ||||||||
or | ||||||||
`setup.py option <https://scikit-build.readthedocs.io/en/latest/usage.html#scikit-build-options>`_. | ||||||||
|
||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
It would be nice to further improve to provide some historical contest based on the summary available at #703 (comment) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added a little more detail as to how this works and on what systems. |
||||||||
Modules built with a GNU based compiler on Linux, can control exports through a `version script <https://ftp.gnu.org/old-gnu/Manuals/ld-2.9.1/html_node/ld_25.html>`_. | ||||||||
For this platform/compiler combination, regardless of the target Python version, scikit-build always creates a version script. | ||||||||
When this option is set to ``OFF``, a version script is created that specifies all local methods to be excluded from export. | ||||||||
When this option is set to ``ON``, a version script is created allowing all local methods to be exported and available in the built module. | ||||||||
|
||||||||
Environment variable configuration | ||||||||
---------------------------------- | ||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is part of PythonExtensions, not all of scikit-build, right? Most or all pybind11 and nanobind projects do not use PythonExtensions. Also, FindPythonInterp and FindPythonLibs is being removed (sort-of) from CMake 3.27; users using FindPython won't be affected by this variable either, I believe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jcfr is there another caveot I am missing as to when this would be used?