MaskRay added a comment.

In D118493#4075970 <https://reviews.llvm.org/D118493#4075970>, @JonChesterfield 
wrote:

> That works if you have one toolchain installed globally or you are happy to 
> cobble together a working system using environment variables. If you have 
> multiple toolchains, they can't all sit in the global directory. If you don't 
> have root, you can't install them there.
>
> Previously we required people to set LD_LIBRARY_PATH to use openmp at all. 
> That's an inherently poor UX and interacted especially poorly with module 
> setup systems found in HPC.
>
> We could make this opt-in, at the cost of new users seeing that openmp just 
> doesn't work out of the box and other ones having to modify build scripts. In 
> exchange we get - consistency with other tools that fail to work without 
> global installation or extra user burden.

Well, if you have a toolchain at a non-standard location (I do this a lot 
myself), you can go an extra mile by specifying `-Wl,-rpath=... in a Clang 
configuration file.
Gentoo has a nice summary of the feature 
https://blogs.gentoo.org/mgorny/2022/10/07/clang-in-gentoo-now-sets-default-runtimes-via-config-file/
libc++, libc++abi, libunwind, and compiler-rt don't add the extra DT_RUNPATH. 
Some build systems want to handle DT_RUNPATH themselves (e.g. 
`CMAKE_INSTALL_RPATH`).
I don't think it is a good idea for openmp to diverge and introduce an opt-out 
`-fno-openmp-implicit-rpath`.

> In my opinion dynamically linking language runtimes is a bad default. It wins 
> us an awful lot of failure modes. I've also argued against being able to swap 
> out individual components via environment variables as way too error prone 
> for a user facing interface. This is what the community consensus went for. 
> The combination of dynamically substitutable and requiring LD_LIBRARY_PATH 
> was especially sharp.

Well, some distributions have policies against DT_RUNPATH and this change is 
causing trouble. While a patch like D142174 <https://reviews.llvm.org/D142174> 
can mitigate the problem, the hard-coded paths are ugly and may not work for 
another Linux distribution or another ELF-based operating system.

You don't necessarily use `LD_LIBRARY_PATH`. You can use `-Wl,-rpath=...`


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D118493/new/

https://reviews.llvm.org/D118493

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to