Skip to content
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

Python bindings build warning "dynamic_lookup may not work with chained fixups" on MacOS #280

Open
ckreibich opened this issue Sep 17, 2022 · 2 comments

Comments

@ckreibich
Copy link
Member

@vpax writes on Slack:

For a fresh checkout of master under MacOS Monterey, when building I get a warning:

Linking CXX shared module auxil/broker/python/broker/_broker.so
ld: warning: -undefined dynamic_lookup may not work with chained fixups

Presumably this is harmless, but thought I should flag it

A few other projects have hit this:

This suggests the fix might be easy: https://issues.guix.gnu.org/issue/57849#4

Since Broker's test cases cover this and we cover MacOS in CI, I'm thinking this doesn't affect use of the bindings in practice.

@Neverlord
Copy link
Member

Thanks for the ticket.

This suggests the fix might be easy: https://issues.guix.gnu.org/issue/57849#4

Seems like it isn't that easy. From the same thread:

-bundle_loader requires -bundle. Ld gives an error if
-bundle_loader is used without -bundle. A "bundle" in Mach-O, which is
what MacOS is using instead of ELF, say, is something different than a
shared library.

We don't build bundle targets in Broker. Adding the flag to our shared library target does indeed fail:

clang: error: invalid argument '-bundle_loader -compatibility_version' not allowed with '-dynamiclib'

After a bit of digging, we actually don't set -undefined dynamic_lookup anywhere. The only match seems to be in pybind11: https://github.com/pybind/pybind11/blob/master/tools/pybind11Common.cmake#L78. So we probably can't fix that on our end and I'm not sure how a fix would look like for sending a PR.

There's one more match, though: https://github.com/zeek/cmake/blob/master/ZeekPluginDynamic.cmake#L225. Are Zeek plugins raising the same warning?

@CsBigDataHub
Copy link

FYI.. https://issues.guix.gnu.org/issue/57849

Looks like using -Wl,-w will help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants