This was added to LLVM 6, 8, 9, 10, 13, and 14 (but no others) in
695fe131c2, and then I guess gradually
got removed from all of them except 13. Anyway, I successfully built
`llvmPackages_13.stdenv` with the default GCC.
Otherwise we install a weird `update_core_linalg_named_ops.sh`
maintainer script that refers to the build directory.
There are explicit install targets for some of these and probably
better ways we could install the others, but the Clang derivation
also just explicitly copies a bunch of them, so meh.
libclc requires a compatible version of spirv-llvm-translator. If we
don't have such a version, we get an eval error. This means that
OfBorg builds of llvmPackages sets where libclc is unavailable will
produce an eval error, which is very confusing. To fix this, restrict
the libclc attribute to LLVM versions where it actually exists.
Link: https://github.com/NixOS/nixpkgs/pull/414615#issuecomment-3126935312
When Clang is statically linked against other programs they are unable to
find the headers in Clang's resource directory. Typically the resource
directory is found by searching a path relative to argv[0] but this
would only really work for Clang itself due to each binary having a
separate prefix (and not in Nix because of the full resource directory
being split between multiple derivations and assembled in the wrapper).
Because users of Clang as a library typically only need include in order
for parsing to succeed, let's set that as the resource directory. The LLVM
patch to make this work was sent upstream in llvm/llvm-project#145996,
I intend to land it upstream and drop it from this PR.
Since #380683, broken symlinks prevent the package from building on
pkgsStatic.pkgsLLVM.
So far as I know, isStatic builds don't have shared objects, so don't
emit these broken symlinks for them.
Signed-off-by: Peter Waller <p@pwaller.net>