Skip to content

Commit

Permalink
gcc9: Add no-sys-dir patch for RISC-V
Browse files Browse the repository at this point in the history
Same as in gcc{10,11} (NixOS#147942).
  • Loading branch information
zhaofengli committed Jan 9, 2022
1 parent 4bedea7 commit 2952075
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkgs/development/compilers/gcc/9/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
17 changes: 17 additions & 0 deletions pkgs/development/compilers/gcc/no-sys-dirs-riscv-gcc9.patch
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 2952075

Please sign in to comment.