mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-11 08:03:55 +00:00
e076c4513d
On macOS, extension library builds usually rely on the flag ``-undefined dynamic_lookup`` to get the linker to temporarily accept missing CPython API symbols. As the name implies, those symbols are then dynamically resolved when Python imports such an extension library. Binaries produced in this way are more portable since they don't contain a hardcoded path to the CPython library. This is critical when distributing binary wheels on PyPI, etc.. When targeting macOS>=12, XCode recently started to generate a somewhat ominous warning: ``-undefined dynamic_lookup may not work with chained fixups`` For further detail on what chained fixups are, see the following informative WWDC https://developer.apple.com/videos/play/wwdc2022/110362/ (the relevant part starts about 20mins into the video) The message that the dynamic resolution functionality became broken. I reported this to Apple via feedback request FB11767124. Apple investigated the request and updated the behavior of ``ld`` starting with XCode 14.3b1+: it now disables the fixup chain linker optimization whenever ``-undefined dynamic_lookup`` is specified. The feedback from Apple also stated that the parameter ``-Wl,-no_fixup_chains`` should be specified on pre-14.3 XCode versions to ensure correct behavior. This commit realizes those changes by passing a flag to *always* disable fixup chains. Related discussion is available in the CPython repository (https://github.com/python/cpython/issues/97524). |
||
---|---|---|
.. | ||
check-style.sh | ||
cmake_uninstall.cmake.in | ||
codespell_ignore_lines_from_errors.py | ||
FindCatch.cmake | ||
FindEigen3.cmake | ||
FindPythonLibsNew.cmake | ||
JoinPaths.cmake | ||
libsize.py | ||
make_changelog.py | ||
pybind11.pc.in | ||
pybind11Common.cmake | ||
pybind11Config.cmake.in | ||
pybind11NewTools.cmake | ||
pybind11Tools.cmake | ||
pyproject.toml | ||
setup_global.py.in | ||
setup_main.py.in |