gcc{10,11}: add no-sys-dir patch for RiscV

RiscV has an individual STARTFILE_PREFIX_SPEC macro which also need to
be patched.
This commit is contained in:
oxalica 2021-11-30 15:17:55 +08:00
parent a5851f18c5
commit 0d1750e9c0
No known key found for this signature in database
GPG key ID: CED392DE0C483D00
3 changed files with 14 additions and 0 deletions

View file

@ -64,6 +64,7 @@ let majorVersion = "10";
patches =
optional (targetPlatform != hostPlatform) ../libstdc++-target.patch
++ optional noSysDirs ../no-sys-dirs.patch
++ optional (noSysDirs && hostPlatform.isRiscV) ../no-sys-dirs-riscv.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.

View file

@ -64,6 +64,7 @@ let majorVersion = "11";
patches =
optional (targetPlatform != hostPlatform) ../libstdc++-target.patch
++ optional noSysDirs ../no-sys-dirs.patch
++ optional (noSysDirs && hostPlatform.isRiscV) ../no-sys-dirs-riscv.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.

View file

@ -0,0 +1,12 @@
--- a/gcc/config/riscv/linux.h
+++ b/gcc/config/riscv/linux.h
@@ -69,8 +69,4 @@
#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
-#define STARTFILE_PREFIX_SPEC \
- "/lib" XLEN_SPEC "/" ABI_SPEC "/ " \
- "/usr/lib" XLEN_SPEC "/" ABI_SPEC "/ " \
- "/lib/ " \
- "/usr/lib/ "
+#define STARTFILE_PREFIX_SPEC ""