RISC-V: define _REENTRANT with -pthread

Message ID mvmr2pqe9x6.fsf@suse.de
State New
Headers show
Series
  • RISC-V: define _REENTRANT with -pthread
Related show

Commit Message

Andreas Schwab Feb. 12, 2018, 11:15 a.m.
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.

Comments

Jim Wilson Feb. 12, 2018, 11 p.m. | #1
On 02/12/2018 03:15 AM, Andreas Schwab wrote:
> 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.

OK.

Jim

Patch

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} \