From: Bernd Kuhls Date: Fri, 27 Mar 2020 20:23:53 +0000 (+0100) Subject: gcc: define _REENTRANT for OpenRISC when -pthread is passed X-Git-Tag: basepoints/gcc-13~1317 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cac2f69cdad434ad5cb60f5fe931d45cd82ef476;p=thirdparty%2Fgcc.git 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. gcc/ChangeLog: PR target/94372 * config/or1k/linux.h (CPP_SPEC): Define. Signed-off-by: Bernd Kuhls --- diff --git a/gcc/config/or1k/linux.h b/gcc/config/or1k/linux.h index 52909af41a6e..80f77c722322 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} \