[1/2] package/libmicrohttpd: fix pthread detection
diff mbox series

Message ID 20200324210041.628200-1-bernd.kuhls@t-online.de
State Changes Requested
Headers show
Series
  • [1/2] package/libmicrohttpd: fix pthread detection
Related show

Commit Message

Bernd Kuhls March 24, 2020, 9 p.m. UTC
Fixes:
http://autobuild.buildroot.net/results/ceb802eea0fee5812efd717ae4cdbd9673d9507e/

Quoted from config.log:
conftest.c:32:26: error: #error "_REENTRANT must be defined"

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
---
 package/libmicrohttpd/libmicrohttpd.mk | 3 +++
 1 file changed, 3 insertions(+)

Comments

Thomas Petazzoni March 26, 2020, 10:34 p.m. UTC | #1
Hello,

On Tue, 24 Mar 2020 22:00:40 +0100
Bernd Kuhls <bernd.kuhls@t-online.de> wrote:

> +# fixes pthreads detection
> +LIBMICROHTTPD_CFLAGS += -D_REENTRANT

Thanks, but unfortunately this is not the proper fix. The proper fix is
in gcc: when -pthread is passed, gcc should add -D_REENTRANT to the
CFLAGS.

We have a patch for gcc 7.x to fix this for RISC-V:

  package/gcc/7.5.0/0006-gcc-define-_REENTRANT-for-RISC-V-when-pthread-is-pas.patch

And this fix was merged in upstream gcc as of commit
75102502b3ee275c1d7aa8654dcb012e27c6a661.

We need the same fix for OpenRISC, i.e add:

#define CPP_SPEC "%{pthread:-D_REENTRANT}"

to gcc/config/or1k/linux.h.

Could you look into this instead, and report the bug to gcc ?

Thanks!

Thomas

Patch
diff mbox series

diff --git a/package/libmicrohttpd/libmicrohttpd.mk b/package/libmicrohttpd/libmicrohttpd.mk
index f47d7ec214..2f5c28cd58 100644
--- a/package/libmicrohttpd/libmicrohttpd.mk
+++ b/package/libmicrohttpd/libmicrohttpd.mk
@@ -22,4 +22,7 @@  LIBMICROHTTPD_LICENSE = LGPL-2.1+ or eCos
 LIBMICROHTTPD_CONF_OPTS += --disable-https
 endif
 
+# fixes pthreads detection
+LIBMICROHTTPD_CFLAGS += -D_REENTRANT
+
 $(eval $(autotools-package))