This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] RISC-V: define _REENTRANT with -pthread
- From: Andreas Schwab <schwab at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 12 Feb 2018 12:15:17 +0100
- Subject: [PATCH] RISC-V: define _REENTRANT with -pthread
- Authentication-results: sourceware.org; auth=none
This is expected by the AX_PTHREAD autoconf macro from
<http://www.gnu.org/software/autoconf-archive/ax_pthread.html>.
* config/riscv/linux.h (CPP_SPEC): Define.
diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h
index 1da1b0a74e..ad03654e8d 100644
--- a/gcc/config/riscv/linux.h
+++ b/gcc/config/riscv/linux.h
@@ -47,6 +47,8 @@ along with GCC; see the file COPYING3. If not see
#define ICACHE_FLUSH_FUNC "__riscv_flush_icache"
+#define CPP_SPEC "%{pthread:-D_REENTRANT}"
+
#define LINK_SPEC "\
-melf" XLEN_SPEC "lriscv \
%{shared} \
--
2.16.1
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."