nixpkgs/pkgs/development/compilers/llvm/8/bintools.nix
David Truby 46e5ea5af6 llvm*: remove symlinks to llvm-diff, llvm-as and associated LLVM IR utilities.
These llvm-prefixed utilities are not drop-in replacements for the utilities
with similar names, they are specifically for operating on LLVM IR files.
Symlinking these without the prefix causes incompatibilities with tools that
expect diff, as and others to behave normally.
2020-07-28 16:26:12 +01:00

19 lines
530 B
Nix

{ runCommand, stdenv, llvm, lld, version }:
let
prefix =
if stdenv.hostPlatform != stdenv.targetPlatform
then "${stdenv.targetPlatform.config}-"
else "";
in runCommand "llvm-binutils-${version}" { preferLocalBuild = true; } ''
mkdir -p $out/bin
for prog in ${lld}/bin/*; do
ln -s $prog $out/bin/${prefix}$(basename $prog)
done
for prog in ${llvm}/bin/*; do
ln -sf $prog $out/bin/${prefix}$(basename $prog)
done
rm -f $out/bin/${prefix}cat
ln -s ${lld}/bin/lld $out/bin/${prefix}ld
''