2020-01-24 23:17:00 +00:00
|
|
|
{ runCommand, stdenv, llvm, lld, version }:
|
|
|
|
|
|
|
|
let
|
|
|
|
prefix =
|
|
|
|
if stdenv.hostPlatform != stdenv.targetPlatform
|
|
|
|
then "${stdenv.targetPlatform.config}-"
|
|
|
|
else "";
|
2023-01-19 21:39:04 +00:00
|
|
|
in runCommand "llvm-binutils-${version}" {
|
|
|
|
preferLocalBuild = true;
|
|
|
|
passthru = {
|
|
|
|
isLLVM = true;
|
|
|
|
};
|
|
|
|
} ''
|
2020-01-24 23:17:00 +00:00
|
|
|
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
|
2020-07-28 21:06:17 +01:00
|
|
|
|
|
|
|
ln -s ${llvm}/bin/llvm-ar $out/bin/${prefix}ar
|
2023-01-16 22:28:04 +00:00
|
|
|
ln -s ${llvm}/bin/llvm-ar $out/bin/${prefix}dlltool
|
|
|
|
ln -s ${llvm}/bin/llvm-ar $out/bin/${prefix}ranlib
|
|
|
|
ln -s ${llvm}/bin/llvm-cxxfilt $out/bin/${prefix}c++filt
|
2020-07-28 21:06:17 +01:00
|
|
|
ln -s ${llvm}/bin/llvm-dwp $out/bin/${prefix}dwp
|
|
|
|
ln -s ${llvm}/bin/llvm-nm $out/bin/${prefix}nm
|
|
|
|
ln -s ${llvm}/bin/llvm-objcopy $out/bin/${prefix}objcopy
|
2023-01-16 22:28:04 +00:00
|
|
|
ln -s ${llvm}/bin/llvm-objcopy $out/bin/${prefix}strip
|
2020-07-28 21:06:17 +01:00
|
|
|
ln -s ${llvm}/bin/llvm-objdump $out/bin/${prefix}objdump
|
2023-01-16 22:28:04 +00:00
|
|
|
ln -s ${llvm}/bin/llvm-readobj $out/bin/${prefix}readelf
|
2020-07-28 21:06:17 +01:00
|
|
|
ln -s ${llvm}/bin/llvm-size $out/bin/${prefix}size
|
2023-01-16 22:28:04 +00:00
|
|
|
ln -s ${llvm}/bin/llvm-strings $out/bin/${prefix}strings
|
|
|
|
ln -s ${llvm}/bin/llvm-symbolizer $out/bin/${prefix}addr2line
|
2020-07-28 21:06:17 +01:00
|
|
|
|
2020-01-24 23:17:00 +00:00
|
|
|
ln -s ${lld}/bin/lld $out/bin/${prefix}ld
|
|
|
|
''
|