From 4728ef130e17f194fddedfea386e4fc909e1c4cb Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Mon, 26 Feb 2018 05:24:36 -0500 Subject: [PATCH] RISC-V: Add upstream gcc patch to fix -pthread. Fixes libmicrohttpd build. --- pkgs/development/compilers/gcc/7/default.nix | 4 +++- .../compilers/gcc/7/riscv-pthread-reentrant.patch | 13 +++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/compilers/gcc/7/riscv-pthread-reentrant.patch 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} \