Bug 94372 - pthread doesn't define _REENTRANT in preprocessor on OpenRISC
Summary: pthread doesn't define _REENTRANT in preprocessor on OpenRISC
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: unknown
: P3 normal
Target Milestone: ---
Assignee: Stafford Horne
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-27 21:21 UTC by bernd.kuhls
Modified: 2022-02-02 11:15 UTC (History)
1 user (show)

See Also:
Host:
Target: or1k-buildroot-linux-uclibc
Build:
Known to work:
Known to fail:
Last reconfirmed: 2020-03-28 00:00:00


Attachments
Patch (520 bytes, application/mbox)
2020-03-27 21:21 UTC, bernd.kuhls
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bernd.kuhls 2020-03-27 21:21:33 UTC
Created attachment 48138 [details]
Patch

OpenRISC doesn't have _REENTRANT defined when -pthread is appended.

Some software, like libmicrohttpd, check in their configure script if _REENTRANT is correctly defined as seen on buildroot autobuilders:
http://autobuild.buildroot.net/results/ceb802eea0fee5812efd717ae4cdbd9673d9507e/libmicrohttpd-0.9.70/config.log

This bug is similar to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84475
Comment 1 Jonathan Wakely 2020-03-28 16:20:50 UTC
Setting component=target without populating the "Target" field is meaningless, please add the output of 'gcc -dumpmachine' to the Target field.
Comment 2 Stafford Horne 2022-01-31 13:52:57 UTC
The patch looks fine, I missed it as it seems the patch was only posted in bugzilla.  Usually sending a patch to gcc-patches will get more attention.
Comment 3 GCC Commits 2022-02-02 11:03:22 UTC
The master branch has been updated by Stafford Horne <shorne@gcc.gnu.org>:

https://gcc.gnu.org/g:cac2f69cdad434ad5cb60f5fe931d45cd82ef476

commit r12-6996-gcac2f69cdad434ad5cb60f5fe931d45cd82ef476
Author: Bernd Kuhls <bernd.kuhls@t-online.de>
Date:   Fri Mar 27 21:23:53 2020 +0100

    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 <bernd.kuhls@t-online.de>
Comment 4 Stafford Horne 2022-02-02 11:15:33 UTC
Patch applied. Thank you