diff --git a/lib/systems/platforms.nix b/lib/systems/platforms.nix index a01f167a02b..b3a4f9fc13c 100644 --- a/lib/systems/platforms.nix +++ b/lib/systems/platforms.nix @@ -459,7 +459,6 @@ rec { riscv-multiplatform = bits: { name = "riscv-multiplatform"; kernelArch = "riscv"; - bfdEmulation = "elf${bits}lriscv"; kernelTarget = "vmlinux"; kernelAutoModules = true; kernelBaseConfig = "defconfig"; diff --git a/pkgs/build-support/bintools-wrapper/default.nix b/pkgs/build-support/bintools-wrapper/default.nix index 3b1b8ff570a..6da0e58436d 100644 --- a/pkgs/build-support/bintools-wrapper/default.nix +++ b/pkgs/build-support/bintools-wrapper/default.nix @@ -167,7 +167,7 @@ stdenv.mkDerivation { else if targetPlatform.isWindows then "pe" else "elf" + toString targetPlatform.parsed.cpu.bits; endianPrefix = if targetPlatform.isBigEndian then "big" else "little"; - sep = optionalString (!targetPlatform.isMips && !targetPlatform.isPower) "-"; + sep = optionalString (!targetPlatform.isMips && !targetPlatform.isPower && !targetPlatform.isRiscV) "-"; arch = /**/ if targetPlatform.isAarch64 then endianPrefix + "aarch64" else if targetPlatform.isAarch32 then endianPrefix + "arm" @@ -187,6 +187,7 @@ stdenv.mkDerivation { else if targetPlatform.isAlpha then "alpha" else if targetPlatform.isVc4 then "vc4" else if targetPlatform.isOr1k then "or1k" + else if targetPlatform.isRiscV then "lriscv" else throw "unknown emulation for platform: ${targetPlatform.config}"; in if targetPlatform.useLLVM or false then "" else targetPlatform.platform.bfdEmulation or (fmt + sep + arch);