diff --git a/pkgs/development/compilers/gcc/9/default.nix b/pkgs/development/compilers/gcc/9/default.nix index ebdc55ee3f8f..9d21ed667f6c 100644 --- a/pkgs/development/compilers/gcc/9/default.nix +++ b/pkgs/development/compilers/gcc/9/default.nix @@ -82,6 +82,7 @@ let majorVersion = "9"; ++ optional (targetPlatform != hostPlatform) ../libstdc++-target.patch ++ optional targetPlatform.isNetBSD ../libstdc++-netbsd-ctypes.patch ++ optional noSysDirs ../no-sys-dirs.patch + ++ optional (noSysDirs && hostPlatform.isRiscV) ../no-sys-dirs-riscv-gcc9.patch /* ++ optional (hostPlatform != buildPlatform) (fetchpatch { # XXX: Refine when this should be applied url = "https://git.busybox.net/buildroot/plain/package/gcc/${version}/0900-remove-selftests.patch?id=11271540bfe6adafbc133caf6b5b902a816f5f02"; sha256 = ""; # TODO: uncomment and check hash when available. diff --git a/pkgs/development/compilers/gcc/no-sys-dirs-riscv-gcc9.patch b/pkgs/development/compilers/gcc/no-sys-dirs-riscv-gcc9.patch new file mode 100644 index 000000000000..afe3f26360e4 --- /dev/null +++ b/pkgs/development/compilers/gcc/no-sys-dirs-riscv-gcc9.patch @@ -0,0 +1,17 @@ +diff --git a/gcc/config/riscv/riscv.h b/gcc/config/riscv/riscv.h +index 701f5ea1544..8de333caf54 100644 +--- a/gcc/config/riscv/riscv.h ++++ b/gcc/config/riscv/riscv.h +@@ -886,11 +886,7 @@ extern unsigned riscv_stack_boundary; + "%{mabi=lp64f:lp64f}" \ + "%{mabi=lp64d:lp64d}" \ + +-#define STARTFILE_PREFIX_SPEC \ +- "/lib" XLEN_SPEC "/" ABI_SPEC "/ " \ +- "/usr/lib" XLEN_SPEC "/" ABI_SPEC "/ " \ +- "/lib/ " \ +- "/usr/lib/ " ++#define STARTFILE_PREFIX_SPEC "" + + /* ISA constants needed for code generation. */ + #define OPCODE_LW 0x2003