summary refs log tree commit diff
path: root/pkgs/development/compilers
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2018-02-26 05:24:36 -0500
committerShea Levy <shea@shealevy.com>2018-02-26 05:24:36 -0500
commit4728ef130e17f194fddedfea386e4fc909e1c4cb (patch)
tree837ac03dc00e7aa21440b01432571bb6e521552a /pkgs/development/compilers
parent6b1ab50738d1f61cdb9d2b2f8d85ed8368b76366 (diff)
downloadnixpkgs-4728ef130e17f194fddedfea386e4fc909e1c4cb.tar
nixpkgs-4728ef130e17f194fddedfea386e4fc909e1c4cb.tar.gz
nixpkgs-4728ef130e17f194fddedfea386e4fc909e1c4cb.tar.bz2
nixpkgs-4728ef130e17f194fddedfea386e4fc909e1c4cb.tar.lz
nixpkgs-4728ef130e17f194fddedfea386e4fc909e1c4cb.tar.xz
nixpkgs-4728ef130e17f194fddedfea386e4fc909e1c4cb.tar.zst
nixpkgs-4728ef130e17f194fddedfea386e4fc909e1c4cb.zip
RISC-V: Add upstream gcc patch to fix -pthread.
Fixes libmicrohttpd build.
Diffstat (limited to 'pkgs/development/compilers')
-rw-r--r--pkgs/development/compilers/gcc/7/default.nix4
-rw-r--r--pkgs/development/compilers/gcc/7/riscv-pthread-reentrant.patch13
2 files changed, 16 insertions, 1 deletions
diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix
index e8997b1efb0..68a47987b2e 100644
--- a/pkgs/development/compilers/gcc/7/default.nix
+++ b/pkgs/development/compilers/gcc/7/default.nix
@@ -73,7 +73,9 @@ let version = "7.3.0";
       # The GNAT Makefiles did not pay attention to CFLAGS_FOR_TARGET for its
       # target libraries and tools.
       ++ 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 {
       # The `$(top_srcdir)/ecj.jar' file is automatically picked up at
diff --git a/pkgs/development/compilers/gcc/7/riscv-pthread-reentrant.patch b/pkgs/development/compilers/gcc/7/riscv-pthread-reentrant.patch
new file mode 100644
index 00000000000..c7527ffb2b1
--- /dev/null
+++ b/pkgs/development/compilers/gcc/7/riscv-pthread-reentrant.patch
@@ -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} \