hc
2023-02-13 e440ec23c5a540cdd3f7464e8779219be6fd3d95
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
From 8ef5787701f4d7cf46a27771d38ab54af2499e25 Mon Sep 17 00:00:00 2001
From: Bernd Kuhls <bernd.kuhls@t-online.de>
Date: Fri, 27 Mar 2020 21:23:53 +0100
Subject: [PATCH] gcc: define _REENTRANT for OpenRISC when -pthread is passed
 
The detection of pthread support fails on OpenRISC unless _REENTRANT
is defined. Added the CPP_SPEC definition to correct this.
 
Patch sent upstream: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94372
 
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
---
 gcc/config/or1k/linux.h | 2 ++
 1 file changed, 2 insertions(+)
 
diff --git a/gcc/config/or1k/linux.h b/gcc/config/or1k/linux.h
index 196f3f3c8f0..0cbdc934af1 100644
--- a/gcc/config/or1k/linux.h
+++ b/gcc/config/or1k/linux.h
@@ -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}                \
-- 
2.35.1