{clang,gcc}_multi: remove manual throws (#426902)

This commit is contained in:
John Ericson
2025-07-21 14:39:01 -04:00
committed by GitHub
+26 -32
View File
@@ -5038,42 +5038,36 @@ with pkgs;
wrapCCMulti =
cc:
if stdenv.targetPlatform.system == "x86_64-linux" then
let
# Binutils with glibc multi
bintools = cc.bintools.override {
libc = glibc_multi;
};
in
lowPrio (wrapCCWith {
cc = cc.cc.override {
stdenv = overrideCC stdenv (wrapCCWith {
cc = cc.cc;
inherit bintools;
libc = glibc_multi;
});
profiledCompiler = false;
enableMultilib = true;
};
let
# Binutils with glibc multi
bintools = cc.bintools.override {
libc = glibc_multi;
inherit bintools;
extraBuildCommands = ''
echo "dontMoveLib64=1" >> $out/nix-support/setup-hook
'';
})
else
throw "Multilib ${cc.name} not supported for ${stdenv.targetPlatform.system}";
};
in
lowPrio (wrapCCWith {
cc = cc.cc.override {
stdenv = overrideCC stdenv (wrapCCWith {
cc = cc.cc;
inherit bintools;
libc = glibc_multi;
});
profiledCompiler = false;
enableMultilib = true;
};
libc = glibc_multi;
inherit bintools;
extraBuildCommands = ''
echo "dontMoveLib64=1" >> $out/nix-support/setup-hook
'';
});
wrapClangMulti =
clang:
if stdenv.targetPlatform.system == "x86_64-linux" then
callPackage ../development/compilers/llvm/multi.nix {
inherit clang;
gcc32 = pkgsi686Linux.gcc;
gcc64 = pkgs.gcc;
}
else
throw "Multilib ${clang.cc.name} not supported for '${stdenv.targetPlatform.system}'";
callPackage ../development/compilers/llvm/multi.nix {
inherit clang;
gcc32 = pkgsi686Linux.gcc;
gcc64 = pkgs.gcc;
};
gcc_multi = wrapCCMulti gcc;
clang_multi = wrapClangMulti clang;