-
Notifications
You must be signed in to change notification settings - Fork 82
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
Extension linking doesn't work with Xcode 14 (macOS 12.6) #790
Labels
Comments
tombruijn
changed the title
Extension linking doesn't work on macOS 12.6
Extension linking doesn't work with Xcode 14 (macOS 12.6)
Sep 15, 2022
Can confirm the issue is present with the latest command line tools on macOS 12.6. Here’s the output with the added
|
tombruijn
added a commit
that referenced
this issue
Sep 15, 2022
We ran into an issue with the new Xcode version 14 command line tools, version 2395. The linker gave a warning about `dynamic_lookup` not working with chained fixups, a thing that is now enabled by default on the command line tools looks like. ``` ld: warning: -undefined dynamic_lookup may not work with chained fixups ``` It looks like we can't use `dynamic_lookup`. Instead define a list ourselves of all the symbols we use in the `c_src/appsignal_extension.c` file. That way we tell the linker to ignore the undefined symbols, and have them be looked up at runtime when the Elixir NIF library is loaded. Every time we call another NIF function defined in `erl_nif.h` we need to update this list. ## ld documentation changes between Xcode versions that broke Xcode Version 13.4.1 (13F100), from macOS 12.5: ``` $ man ld -undefined treatment Specifies how undefined symbols are to be treated. Options are: error, warning, suppress, or dynamic_lookup. The default is error. ``` New Xcode Version 14.0 (14A309), from macOS 12.6: ``` $ man ld -undefined treatment Specifies how undefined symbols are to be treated. Options are: error, warning, suppress, or dynamic_lookup. The default is error. Note: dynamic_lookup that depends on lazy binding will not work with chained fixups. -U symbol_name Specified that it is ok for symbol_name to have no definition. With -two_levelnamespace, the resulting symbol will be marked dynamic_lookup which means dyld will search all loaded images. ``` Closes #790
tombruijn
added a commit
that referenced
this issue
Sep 15, 2022
We ran into an issue with the new Xcode version 14 command line tools, version 2395. The linker gave a warning about `dynamic_lookup` not working with chained fixups, a thing that is now enabled by default on the command line tools looks like. ``` ld: warning: -undefined dynamic_lookup may not work with chained fixups ``` It looks like we can't use `dynamic_lookup`. Instead define a list ourselves of all the symbols we use in the `c_src/appsignal_extension.c` file. That way we tell the linker to ignore the undefined symbols, and have them be looked up at runtime when the Elixir NIF library is loaded. Every time we call another NIF function defined in `erl_nif.h` we need to update this list. ## ld documentation changes between Xcode versions that broke Xcode Version 13.4.1 (13F100), from macOS 12.5: ``` $ man ld -undefined treatment Specifies how undefined symbols are to be treated. Options are: error, warning, suppress, or dynamic_lookup. The default is error. ``` New Xcode Version 14.0 (14A309), from macOS 12.6: ``` $ man ld -undefined treatment Specifies how undefined symbols are to be treated. Options are: error, warning, suppress, or dynamic_lookup. The default is error. Note: dynamic_lookup that depends on lazy binding will not work with chained fixups. -U symbol_name Specified that it is ok for symbol_name to have no definition. With -two_levelnamespace, the resulting symbol will be marked dynamic_lookup which means dyld will search all loaded images. ``` Closes #790 Co-authored-by: Jeff Kreeftmeijer <jeffkreeftmeijer@gmail.com>
jeffkreeftmeijer
added a commit
that referenced
this issue
Sep 15, 2022
We ran into an issue with the new Xcode version 14 command line tools, version 2395. The linker gave a warning about `dynamic_lookup` not working with chained fixups, a thing that is now enabled by default on the command line tools looks like. ``` ld: warning: -undefined dynamic_lookup may not work with chained fixups ``` It looks like we can't use `dynamic_lookup`. Instead define a list ourselves of all the symbols we use in the `c_src/appsignal_extension.c` file. That way we tell the linker to ignore the undefined symbols, and have them be looked up at runtime when the Elixir NIF library is loaded. Every time we call another NIF function defined in `erl_nif.h` we need to update this list. ## ld documentation changes between Xcode versions that broke Xcode Version 13.4.1 (13F100), from macOS 12.5: ``` $ man ld -undefined treatment Specifies how undefined symbols are to be treated. Options are: error, warning, suppress, or dynamic_lookup. The default is error. ``` New Xcode Version 14.0 (14A309), from macOS 12.6: ``` $ man ld -undefined treatment Specifies how undefined symbols are to be treated. Options are: error, warning, suppress, or dynamic_lookup. The default is error. Note: dynamic_lookup that depends on lazy binding will not work with chained fixups. -U symbol_name Specified that it is ok for symbol_name to have no definition. With -two_levelnamespace, the resulting symbol will be marked dynamic_lookup which means dyld will search all loaded images. ``` Closes #790 Co-authored-by: Jeff Kreeftmeijer <jeffkreeftmeijer@gmail.com> Co-authored-by: Jeff Kreeftmeijer <jeffkreeftmeijer@gmail.com>
Fixed by PR #792, released in package version 2.2.17. |
Fixed for real in PR #793. Fix is released in package version 2.2.18. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The linker shipped with XCode Version 14.0 (14A309) breaks linking for Elixir apps on macOS 12.6.
Xcode Version 13.4.1 (13F100), from macOS 12.5
You can also have this older version of Xcode installed on macOS 12.6.
New Xcode Version 14.0 (14A309), from macOS 12.6
See how it says "dynamic_lookup that depends on lazy binding will not work with chained fixups", the thing the new error is about.
Research
This change gives me verbose output on the error:
"Workarounds"
Notes
The text was updated successfully, but these errors were encountered: