Skip to contentSkip to conversation

libmicrohttpd: fix build on riscv

PATCH New Fabrice Fontaine 2 participants 2 messages Nov 10, 2018 – Nov 11, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libmicrohttpd: fix build on riscv

Define _REENTRANT like already done for ARC otherwise pthread detection will fail

Fixes:
- https://autobuild.buildroot.org/results/910dc7164312637bf4dcd89e4cb476ae198466c8

---
 package/libmicrohttpd/libmicrohttpd.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
package/libmicrohttpd/libmicrohttpd.mk +2 -2
index 1cda434819..c22ad08478 100644
@@ -11,10 +11,10 @@ LIBMICROHTTPD_INSTALL_STAGING = YES
 LIBMICROHTTPD_CONF_OPTS = --disable-curl --disable-examples
 LIBMICROHTTPD_CFLAGS = $(TARGET_CFLAGS) -std=c99
 
-# gcc on arc doesn't define _REENTRANT when -pthread is passed while
+# gcc on arc and riscv doesn't define _REENTRANT when -pthread is passed while
 # it should. Compensate this deficiency here otherwise libmicrohttpd
 # configure script doesn't find that thread support is enabled.
-ifeq ($(BR2_arc),y)
+ifeq ($(BR2_arc)$(BR2_riscv),y)
 LIBMICROHTTPD_CFLAGS += -D_REENTRANT
 endif
 
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 libmicrohttpd: fix build on riscv

Hello,

+Mark Corbin in Cc.

Quoted 10 lines · Fabrice Fontaine

Define _REENTRANT like already done for ARC otherwise pthread detection will fail

Fixes:
- https://autobuild.buildroot.org/results/910dc7164312637bf4dcd89e4cb476ae198466c8

---
 package/libmicrohttpd/libmicrohttpd.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Applied to master, thanks.

Mark: could you report upstream to the RISC-V gcc developers that the gcc port should define _REENTRANT when -pthread is passed ?

I.E, most platforms do some variations of:

#define SUBTARGET_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"

in their gcc/config/<ARCH>/linux.h file.

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com