gcc: define _REENTRANT for OpenRISC when -pthread is passed
authorBernd Kuhls <bernd.kuhls@t-online.de>
Fri, 27 Mar 2020 20:23:53 +0000 (21:23 +0100)
committerStafford Horne <shorne@gmail.com>
Wed, 2 Feb 2022 11:02:59 +0000 (20:02 +0900)
The detection of pthread support fails on OpenRISC unless _REENTRANT
is defined. Added the CPP_SPEC definition to correct this.

gcc/ChangeLog:

PR target/94372
* config/or1k/linux.h (CPP_SPEC): Define.

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
gcc/config/or1k/linux.h

index 52909af..80f77c7 100644 (file)
@@ -32,6 +32,8 @@
 #undef MUSL_DYNAMIC_LINKER
 #define MUSL_DYNAMIC_LINKER  "/lib/ld-musl-or1k.so.1"
 
+#define CPP_SPEC "%{pthread:-D_REENTRANT}"
+
 #undef LINK_SPEC
 #define LINK_SPEC "%{h*}                       \
    %{static:-Bstatic}                          \