Skip to contentSkip to conversation

gcc: define _REENTRANT for OpenRISC when -pthread is passed

PATCH New Stafford Horne 1 participant 1 message Jan 31, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gcc: define _REENTRANT for OpenRISC when -pthread is passed

From: Bernd Kuhls <[email protected]>

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.

---
This was brought up on the buildroot list and somehow I missed it. Sending it now. I plan to commit soon.

 gcc/config/or1k/linux.h | 2 ++
 1 file changed, 2 insertions(+)
gcc/config/or1k/linux.h +2 -0
index 52909af41a6..80f77c72232 100644
@@ -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}				\
Signature · 1 line
2.31.1