Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] gcc/config/riscv: define _REENTRANT for RISC-V when -pthread is passed
@ 2018-11-22 13:31 Mark Corbin
  2018-11-24 10:51 ` Thomas Petazzoni
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Corbin @ 2018-11-22 13:31 UTC (permalink / raw)
  To: buildroot

The detection of pthread support fails on RISC-V unless _REENTRANT
is defined. Added the CPP_SPEC definition from gcc 8.1.0 to correct
this.

Signed-off-by: Mark Corbin <mark.corbin@embecosm.com>
---
 ...TRANT-for-RISC-V-when-pthread-is-pas.patch | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 package/gcc/7.3.0/1001-gcc-define-_REENTRANT-for-RISC-V-when-pthread-is-pas.patch

diff --git a/package/gcc/7.3.0/1001-gcc-define-_REENTRANT-for-RISC-V-when-pthread-is-pas.patch b/package/gcc/7.3.0/1001-gcc-define-_REENTRANT-for-RISC-V-when-pthread-is-pas.patch
new file mode 100644
index 0000000000..4f96bf7d81
--- /dev/null
+++ b/package/gcc/7.3.0/1001-gcc-define-_REENTRANT-for-RISC-V-when-pthread-is-pas.patch
@@ -0,0 +1,30 @@
+From 6ea832d09415cd82b744d0cf168cdd728c43df47 Mon Sep 17 00:00:00 2001
+From: Mark Corbin <mark.corbin@embecosm.com>
+Date: Thu, 22 Nov 2018 12:19:11 +0000
+Subject: [PATCH 1/1] gcc: define _REENTRANT for RISC-V when -pthread is passed
+
+The detection of pthread support fails on RISC-V unless _REENTRANT
+is defined. Added the CPP_SPEC definition from gcc 8.1.0 to correct
+this.
+
+Signed-off-by: Mark Corbin <mark.corbin@embecosm.com>
+---
+ gcc/config/riscv/linux.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h
+index 4b2f7b6e1fd..b00d23ddfa0 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.19.1
+
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Buildroot] [PATCH 1/1] gcc/config/riscv: define _REENTRANT for RISC-V when -pthread is passed
  2018-11-22 13:31 [Buildroot] [PATCH 1/1] gcc/config/riscv: define _REENTRANT for RISC-V when -pthread is passed Mark Corbin
@ 2018-11-24 10:51 ` Thomas Petazzoni
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2018-11-24 10:51 UTC (permalink / raw)
  To: buildroot

Hello,

On Thu, 22 Nov 2018 13:31:12 +0000, Mark Corbin wrote:
> The detection of pthread support fails on RISC-V unless _REENTRANT
> is defined. Added the CPP_SPEC definition from gcc 8.1.0 to correct
> this.
> 
> Signed-off-by: Mark Corbin <mark.corbin@embecosm.com>
> ---
>  ...TRANT-for-RISC-V-when-pthread-is-pas.patch | 30 +++++++++++++++++++
>  1 file changed, 30 insertions(+)
>  create mode 100644 package/gcc/7.3.0/1001-gcc-define-_REENTRANT-for-RISC-V-when-pthread-is-pas.patch

Applied to master, thanks. I have also reverted all the
package-specific fixes we had to add _REENTRANT to fix this RISC-V
issue.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-11-24 10:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-22 13:31 [Buildroot] [PATCH 1/1] gcc/config/riscv: define _REENTRANT for RISC-V when -pthread is passed Mark Corbin
2018-11-24 10:51 ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox