RISC-V: Add upstream gcc patch to fix -pthread.

Fixes libmicrohttpd build.
This commit is contained in:
Shea Levy 2018-02-26 05:24:36 -05:00
parent 6b1ab50738
commit 4728ef130e
No known key found for this signature in database
GPG Key ID: 5C0BD6957D86FE27
2 changed files with 16 additions and 1 deletions

View File

@ -73,7 +73,9 @@ let version = "7.3.0";
# The GNAT Makefiles did not pay attention to CFLAGS_FOR_TARGET for its # The GNAT Makefiles did not pay attention to CFLAGS_FOR_TARGET for its
# target libraries and tools. # target libraries and tools.
++ optional langAda ../gnat-cflags.patch ++ optional langAda ../gnat-cflags.patch
++ optional langFortran ../gfortran-driving.patch; ++ optional langFortran ../gfortran-driving.patch
# https://gcc.gnu.org/ml/gcc-patches/2018-02/msg00633.html
++ optional targetPlatform.isRiscV ./riscv-pthread-reentrant.patch;
javaEcj = fetchurl { javaEcj = fetchurl {
# The `$(top_srcdir)/ecj.jar' file is automatically picked up at # The `$(top_srcdir)/ecj.jar' file is automatically picked up at

View File

@ -0,0 +1,13 @@
Index: gcc/config/riscv/linux.h
===================================================================
--- a/gcc/config/riscv/linux.h (revision 257620)
+++ b/gcc/config/riscv/linux.h (revision 257621)
@@ -47,6 +47,8 @@
#define ICACHE_FLUSH_FUNC "__riscv_flush_icache"
+#define CPP_SPEC "%{pthread:-D_REENTRANT}"
+
#define LINK_SPEC "\
-melf" XLEN_SPEC "lriscv \
%{shared} \