[Buildroot] [PATCH 1/2] package/libmicrohttpd: fix pthread detection

Thomas Petazzoni thomas.petazzoni at bootlin.com
Thu Mar 26 22:34:36 UTC 2020


Hello,

On Tue, 24 Mar 2020 22:00:40 +0100
Bernd Kuhls <bernd.kuhls at 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
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com



More information about the buildroot mailing list