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
macOS linker warnings in macOS ventura #97524
Comments
|
CC @ambv @ned-deily |
|
Unfortunately this warning also propagates to all extension modules built with the given Python. |
|
Linking with libpython is also problematic because on macOS shared libraries are referenced by absolute path which means linking with libpython ties the extension to a specific interpreter (e.g. makes it impossible to build an extension using the Python.org installer and load it using a homebrew install). For the user this will result in seemingly random crashes (due to libpython being loaded twice while only one is initialised). I haven't spend time on looking into this particular issue yet, with some luck there's another option beyond disabling chained lookups. |
|
FYI.. https://issues.guix.gnu.org/issue/57849 Looks like using -Wl,-w will help. |
That doesn't really help, it just suppresses the warning. |
|
You can pass |
It will likely won't because chained fixups are the new linker information for the dynamic symbol tables. So we will be just delaying the inevitable |
|
Another workaround is to target an older deployment target (before 11.0), but that's also not a long term solution. |
|
For static builds using This doesn't work with dynamic builds though, even when using Note that just linking extensions with libpython isn't a realistic option because that results in C extensions that target a specific python prefix and hence would loose interoperability for wheels build with our installer and homebrew. |
|
What does work for a dynamic build (again with a tweaked Something similar should also work for framework builds (but using a different reexport flag), but I haven't tested this yet. Mostly because I'm not happy with the link flags I've used for a shared build. All of this was tested by manual patching of the Makefile, I haven't looked into tweaking the configure script and makefile template yet. |
|
Hi — this issue has also been raised in the pybind11 and CMake projects, including a fix similar to what was suggested above by @ronaldoussoren. Links:
All of this raises a few questions (pybind/pybind11#4301 (comment)) that would be good to figure out together with somebody who is familiar with the intricacies of Darwin's dynamic linker. |
|
Hi @wjakob, We are currently waiting for some clarifications from Apple. Will follow up with anything we find. |
|
Anyone with Apple clout could push this PR into their attention sphere: apple-opensource/ld64#1 It basically says "here's a library; make any symbol that is resolved here |
Correct me if I'm wrong, but it seems to me like this PR targets a different use case: it enables While the issue discussed here is that the very mechanism that drives |
|
One more data point in case it is useful: explicitly enumerating all relevant Python symbols using the
|
|
Maybe? But if |
I am not sure that anyone at apple monitors that repo. If you check it has no pull requests and nobody ever answered an issue |
|
Yeah, I'm aware. I had contacts at Apple, but they've since moved elsewhere… |
|
I did a bit more investigation with the Links:
The third option being discussed ( Somebody from Apple needs to come here and confirm that this warning is a fluke. Otherwise, we have a problem |
Yeah, we are unlikely to proceed with anything in CPython unless we have direct authoritative confirmation from Apple that everything is working as we expect and we are not going to have problems down the line. |
My first attempt at contacting Apple failed. Asking developer support resulted in getting forwarded to the forumes to ask about system extensions... I'll try again after November 14th, before that my agenda is too full to quickly respond. |
My current plan is to try to contact someone from Apple (if he still works there), and if that fails use one of the code-level support tickets included in a paid developer subscription. |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

pablogsal commentedSep 24, 2022
Turns out
ldshipped with Xcode 14+ emits a warning when using-undefined dynamic_lookup.`Some investigation reveals that in fact
-undefined dynamic_lookupdoesn't work when:This is because
-undefined dynamic_lookupuses lazy-bindings and they won't be bound while dyld fixes-up by traversing chained-fixup info.However, we build extension modules with as bundles (
-bundle) and they are loaded only throughdlopen, so it's safe to use -undefined dynamic_lookup in theory. So the warning produced by ld64 islikely to be a false-positive.
ld64also provides the-bundle_loader <executable>option, which allows resolving symbols defined in the executable symbol table while linking. It behaves almost the same with-undefined dynamic_lookup, but it makes the following changes:-undefined dynamic_lookuplookups all symbol tables as flat namespace)See "New Features" subsection under "Linking" section for chained fixup
developer.apple.com/documentation/xcode-release-notes/xcode-13-release-notes for more information.
Also, check the same problem in ruby where most of this information is taken from.
The text was updated successfully, but these errors were encountered: