-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
Crash on macOS: dyld[50112]: Library not loaded: @rpath/libclang.dylib #6
Comments
I used DYLD_FALLBACK_LIBRARY_PATH to set my libclang.dylib path and it worked afterwards. Not sure if there is any way to fix this via code. I seen that opencv faces this issue in rust |
Thats good i think we can't solve this using code but when we release executables we don't need dyn linking for all users I will mark this issue as solution for anyone who faced same issue Thank you |
Please note that macOS sanitizes your environment if you have System Integrity Protection (SIP) enabled. E.g. The following variables are sanitized:
See more info here: https://briandfoy.github.io/macos-s-system-integrity-protection-sanitizes-your-environment/ Please also note that from macOS Sonoma onwards the dynamic linker no longer sets
Last choice offers most flexibility to relocate the executable binary. However, low level system tools should probably use option 1. I think this tool probably should as well. For more information see So, the proper solution here is to somehow pass |
Thank you so much for information, I will use them in CD Too |
@AmrDeveloper Try using compiler flags -rpath liek @mario-grgic suggested. When I faced this problem for cpp project I built in that way not sure if there is a way to do that in Rust or not. |
Describe the bug
Built clangql from git on macOS Sonoma 14.4.1 with rust 1.71.1 and the resulting binary is crashing due to unset LC_RPATH, and hence the binary fails to load libclang.dylib
The text was updated successfully, but these errors were encountered: