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

Purge RPATH from libs installed with julia #5743

Closed
wants to merge 1 commit into from

Conversation

apaz-cli
Copy link

No description provided.

@@ -58,7 +58,8 @@ else
--host=\${MACHTYPE} \\
--with-sysroot="\${prefix}/$(compiler_target)/sys-root" \\
--enable-multilib \\
--disable-werror
--disable-werror \\
--enable-new-dtags
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not supported by this version of binutils

Comment on lines +116 to +119
for lib in libgfortran libasan libtsan libubsan liblsan; do
[ ! -f "${libdir}/${lib}.so" ] || patchelf --set-rpath "\$ORIGIN" "${libdir}/${lib}.so"
done

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #3703 (comment). I believe this can be fixed in the audit pass, instead of having to manually fix it here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that would be somewhat simpler, but @staticfloat had thought it might fail in the verifier, so he suggested we do this manually

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I replied in #3703 (comment), I think the assessment was ill-informed

Comment on lines +276 to +282
shopt -s nullglob
for x in ${prefix}/lib/*.so; do
# All things that have RPATH or doesn't have $ORIGIN,
# but not those without $RUNPATH and $ORIGIN
[ -n "$(objdump -x "$x" | grep 'RPATH\|RUNPATH')" ] && \
patchelf --set-rpath "\$ORIGIN" "$x";
done
Copy link
Member

@giordano giordano Oct 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also here, the fact that we have $ORIGIN/../lib as RPATH makes me think this should have always been $ORIGIN (library is in ${prefix}/lib, so $ORIGIN/../lib is just $ORIGIN). Maybe when we normalise the rpaths we should flatten relative paths, so that these identities become clear and we can simplify the paths we put there. However experimenting with LLVM is way less fun than with CSL, since building LLVM in the first place takes forever (at least with cold ccache) and audit also takes long.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the library may later get moved to lib/julia, resulting in breakage for people linking against it

that was fixed in Julia v1.7 (JuliaLang/julia#42788), but strictly only on that release branch (@vchuravy)

@apaz-cli
Copy link
Author

Closing in favor of JuliaPackaging/BinaryBuilder.jl#1240

@apaz-cli apaz-cli closed this Oct 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants