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

Fix RPATH of libLLVM.so on FreeBSD and Linux #42788

Merged
merged 1 commit into from
Oct 31, 2021

Conversation

vchuravy
Copy link
Member

The RPATH of LLVM is wrong (JuliaPackaging/Yggdrasil#3703) after we move it to lib/julia.
This causes us to not find libz.so.

I see three options:

  1. Fix RPATH on installation
  2. Fix RPATH on build (time consuming)
  3. Preload libz in the loader (more invasive)

I went with 1. since that fixes the wrong RPATH, without requiring a rebuild of LLVM or changing the loader.

@vchuravy vchuravy added this to the 1.7 milestone Oct 25, 2021
@vchuravy vchuravy added building Build system, or building Julia or its dependencies external dependencies Involves LLVM, OpenBLAS, or other linked libraries labels Oct 25, 2021
@ararslan
Copy link
Member

I can confirm that this fixes #42781 for me locally, but I'm now hitting #41943, so one of the changes in RC2 must have introduced that to release-1.7.

@vchuravy
Copy link
Member Author

Also the failure on tester_freebs64:

ERROR: Unable to load dependent library /usr/home/julia/buildbot/w2_tester/tester_freebsd64/build/bin/../lib/julia/libjulia-internal.so.1
Message:/usr/home/julia/buildbot/w2_tester/tester_freebsd64/build/lib/julia/libLLVM-12jl.so: program header too large

@staticfloat any ideas?

@vchuravy
Copy link
Member Author

I can confirm that this fixes #42781 for me locally, but I'm now hitting #41943, so one of the changes in RC2 must have introduced that to release-1.7.

Can you bisect?

@staticfloat
Copy link
Member

program header too large

This is a known issue with using patchelf on FreeBSD. :(
NixOS/patchelf#153

@ararslan
Copy link
Member

ararslan commented Oct 25, 2021

I'm now hitting #41943

wtf, now I'm getting it on v1.7.0-rc1 too, but only after the first time I run tests?

@vchuravy
Copy link
Member Author

program header too large

This is a known issue with using patchelf on FreeBSD. :( NixOS/patchelf#153

@staticfloat Okay I now that preloading works, that might be the alternative? Otherwise does reducing the rpath entry length help, patchelf might then not need to relocate the header to the end?

@staticfloat
Copy link
Member

Okay I now that preloading works, that might be the alternative?

We are going to do this anyway, eventually, once I finally get around to finishing up the JLL stdlib work.

Otherwise does reducing the rpath entry length help, patchelf might then not need to relocate the header to the end?

Yes, but this is kind of sensitive to things outside of our control. If we had a way to "pad" the program header, a la -headerpad_max_install_names on macOS, this would be a lot easier.

@vchuravy vchuravy marked this pull request as ready for review October 31, 2021 20:19
@vchuravy vchuravy added the merge me PR is reviewed. Merge when all tests are passing label Oct 31, 2021
@vchuravy vchuravy merged commit 57f6f27 into backports-release-1.7 Oct 31, 2021
@vchuravy vchuravy deleted the vc/freebsd_fix branch October 31, 2021 21:51
@DilumAluthge DilumAluthge removed the merge me PR is reviewed. Merge when all tests are passing label Oct 31, 2021
@haampie
Copy link
Contributor

haampie commented Mar 26, 2022

This shouldn't apply to external LLVM, it follows symlinks. Just hit this in Spack which sets the correct rpaths for all LLVM dependencies, but Julia deletes them and replaces them with $ORIGIN:$ORIGIN/.., that was surprising 😅.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
building Build system, or building Julia or its dependencies external dependencies Involves LLVM, OpenBLAS, or other linked libraries
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants