-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Runtime dyld errors when using llvm 15 / Xcode 15 linker macos (PROJECT:dyld-1015.7) #12288
Labels
OS:macos
Issues specific to Apple Operating Systems like MacOS and iOS
Comments
I can also replicate this issue. |
Not a meson issue, but more of an undocumented change (bug?) in behaviour with XCode 15. |
eli-schwartz
pushed a commit
that referenced
this issue
May 29, 2024
This somewhat aligns "darwin" (Mach-O) with how ELF RPATHs are treated. Instead of blindly removing all RPATHs, only remove the ones that are in the rpath_dirs_to_remove set. This way, RPATHs that were added by the toolchain or user are left untouched. It is important not to remove RPATHs as they may be vital for the executable at runtime. Issues #12045 and #12288 are examples of this. Issue: #12045 Signed-off-by: Fabian Groffen <[email protected]> Signed-off-by: Eli Schwartz <[email protected]> (cherry picked from commit 78e9009)
soumyaDghosh
pushed a commit
to soumyaDghosh/meson
that referenced
this issue
Jun 4, 2024
This somewhat aligns "darwin" (Mach-O) with how ELF RPATHs are treated. Instead of blindly removing all RPATHs, only remove the ones that are in the rpath_dirs_to_remove set. This way, RPATHs that were added by the toolchain or user are left untouched. It is important not to remove RPATHs as they may be vital for the executable at runtime. Issues mesonbuild#12045 and mesonbuild#12288 are examples of this. Issue: mesonbuild#12045 Signed-off-by: Fabian Groffen <[email protected]> Signed-off-by: Eli Schwartz <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
After macOS was updated, xcode was updated from 14 => 15, I am having runtime linker troubles. I don't understand what is happening behind the scenes from 14=>15 that is causing the new issues, but i have characterized the issue and tried tweaking some flags to get things to work.
setup
andbuild
with my project is successful, but dyld runtime linking is not working anymore (worked fine on xcode 14). Note: I am trying to link to a library that is installed to /usr/local/lib which should be on default library search path.I have tested two cases 1) the example in the 'To reproduce' section below, 2) a larger project that involves cmake and explicitly loading libs with dlopen.
Runtime error looks something like this with case 1:
But with case 2 the error looks more like this:
In the simple case 1 - I was able to
export DYLD_LIBRARY_PATH=/usr/local/lib
and runtime worked fine. However, for case (2) this did not fix the dlopen error.If I instead set
export LDFLAGS="-rpath /usr/local/lib"
- that gets rid of the runtime linking issue in both cases.. (and also results in a lot ofld: warning: duplicate -rpath '/usr/local/lib' ignored
chatter)I also messed with
OTHER_LDFLAGS=-ld_classic
per xcode 15 release notes to no avail.more info on case 2
I have yet to reproduce the issue just by trying to dlopen a library built by meson that depends on a /usr/local/lib.. the setup where i see the error is a little more complicated by cmake:
libraryA
libraryB
I cant dlopen libraryA because it cant load/dlopen the third-party lib. This may very well be a cmake issue (on the cmake side,
-DCMAKE_INSTALL_RPATH_USE_LINK_PATH="ON"
has been fixing my pure cmake projects - they broke in this update too)I will keep working on a minimal example to reproduce this.. and this issue could be on me with a bad cmake file - but it did work before the update.
To Reproduce
install fastrtps (or some third party library) to /usr/local
Expected behavior
No runtime errors, as it worked on the same system just before the update from 14 to 15.
Did not expect to need to modify env with
export DYLD_LIBRARY_PATH=/usr/local/lib
orexport LDFLAGS="-rpath /usr/local/lib"
system parameters
Some concerning? meson output:
The text was updated successfully, but these errors were encountered: