Bug 10865 - [ia64] gcc -pthread does not add -D_REENTRANT
Summary: [ia64] gcc -pthread does not add -D_REENTRANT
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 3.0.4
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: documentation
Depends on:
Blocks: 14300
  Show dependency treegraph
 
Reported: 2003-05-19 15:36 UTC by francois-xavier.kowalski
Modified: 2005-07-29 11:02 UTC (History)
3 users (show)

See Also:
Host: ia64-redhat-linux
Target: ia64-redhat-linux
Build: ia64-redhat-linux
Known to work:
Known to fail:
Last reconfirmed: 2005-01-10 15:44:15


Attachments
pthbug.c (185 bytes, application/octet-stream)
2003-05-21 15:17 UTC, francois-xavier.kowalski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description francois-xavier.kowalski 2003-05-19 15:36:00 UTC
when invoked with option -pthread, gcc-3.x does not add the pre-processor definition -D_REENTRANT, as explained in the documentation & as gcc-2.x was previously doing.

This behaviour is duplicated on the old gcc-3.0.4 on RedHat 7.2 / ia64, then on the same compiler on RedHat Advanced Server 2.1, then on gcc-3.2.3 for Debian Sarge / ia64.

Ref: <http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=84589>

RedHat did not take this bug into account.

Release:
gcc-3.x

Environment:
Linux ia64

How-To-Repeat:
Steps to Reproduce:
1. get the attached program pthbug.c
2. compile it with gcc -v -pthread -Wall -Wstrict-prototypes pthbug.c
3. note that -D_REENTRANT is not defined
Comment 1 Loren Rittle 2003-05-20 00:19:36 UTC
State-Changed-From-To: open->feedback
State-Changed-Why: [Before responding, I checked the gcc documentation that shipped
    with both FSF gcc 3.2.2 and FSF gcc 3.3.]
    
    Question: To which documentation are you referring?  To my knowledge, there was no documentation shipped with FSF gcc
    3.2.X or FSF gcc 3.3 which claims that -D_REENTRANT is added
    when -pthread is present.  It is true that some ports do indeed
    add it under that condition however I can find no documentation
    on the matter.
Comment 2 francois-xavier.kowalski 2003-05-20 09:38:50 UTC
From: Francois-Xavier Kowalski <francois-xavier.kowalski@hp.com>
To: ljrittle@gcc.gnu.org, francois-xavier.kowalski@hp.com,
	gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org,
	jean-pierre.joannin@hp.com, nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: target/10865: [ia64] gcc -pthread does not add -D_REENTRANT
Date: Tue, 20 May 2003 09:38:50 +0200

 Hello,
 
 [sorry for the direct replay, but I cannot find any "Edit PR" button on 
 the page below & on the entire gants/gcc web. Thanks to point me to a 
 link, so that I can copy/paste the below in the gnats database].
 
 "-pthread" is documented as an RS6000/PowerPC option only:
 
 <http://gcc.gnu.org/onlinedocs/gcc-3.2.2/gcc/RS-6000-and-PowerPC-Options.html#RS%2f6000%20and%20PowerPC%20Options>
 
 Quoting:
 
     |-pthread|
         Adds support for multithreading with the pthreads library. This
         option sets flags for both the preprocessor and linker.
 
 However, this option exists for every architectures I worked with 
 (HP-UX, Linux, ia32, ia64...). It is even reported as part of the gcc specs:
 
 RedHat 8.0 / i386:
 
 gcc -v
 Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2/specs
 Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --host=i386-redhat-linux --with-system-zlib --enable-__cxa_atexit
 Thread model: *posix*
 gcc version 3.2 20020903 (Red Hat Linux 8.0 3.2-7)
   
 
 Debian Sarge / ia64:
 
  gcc-3.2 -v
 Reading specs from /usr/lib/gcc-lib/ia64-linux/3.2.3/specs
 Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,proto,objc,ada --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.2 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-java-gc=boehm --enable-objc-gc ia64-linux
 Thread model: *posix*
 gcc version 3.2.3 20030309 (Debian prerelease)
   
 
 So I have always assumed (as it always worked) that the description for 
 RS6000/PowerPC was Ok for every supported architecture.
 
 What I can observe in the current GCC I am using is that the linker 
 option (-lpthread) is set, but not the pre-compiler option
 
 -- FiX
 
 ljrittle@gcc.gnu.org wrote:
 
 >Synopsis: [ia64] gcc -pthread does not add -D_REENTRANT
 >
 >State-Changed-From-To: open->feedback
 >State-Changed-By: ljrittle
 >State-Changed-When: Tue May 20 00:19:36 2003
 >State-Changed-Why:
 >    [Before responding, I checked the gcc documentation that shipped
 >    with both FSF gcc 3.2.2 and FSF gcc 3.3.]
 >    
 >    Question: To which documentation are you referring?  To my knowledge, there was no documentation shipped with FSF gcc
 >    3.2.X or FSF gcc 3.3 which claims that -D_REENTRANT is added
 >    when -pthread is present.  It is true that some ports do indeed
 >    add it under that condition however I can find no documentation
 >    on the matter.
 >
 >http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10865
 >  
 >
 
 -- 
 Francois-Xavier "FiX" KOWALSKI     /_ __    Tel: +33 (0)4 76 14 63 27
 OpenCall Business Unit -- OCBU    / //_/    Fax: +33 (0)4 76 14 43 23
 Signalling Products                 /       HP Telnet: 779-6327
 http://www.hp.com/go/opencall   i n v e n t
Comment 3 Dara Hazeghi 2003-06-05 01:00:26 UTC
Loren,

is there a reason this report is still in WAITING? Thanks,

Dara
Comment 4 francois-xavier.kowalski 2003-07-07 11:59:10 UTC
1. Do I have to populate any kind of information so that this DR can move
forward to a non-WAITING state?

2. BTW, the pre-processor #define that should be added for GCC on HP-UX 11.x are
"-D_REENTRANT -D_PTHREADS_DRAFT4", not only "-D_REENTRANT".  The link statement
remain "-lpthread".
Comment 5 Loren Rittle 2003-07-07 19:07:08 UTC
I have no further opinion on this matter (my position is that this is an
inconsistency
between ports not a bug with any one of them).  It appears that the only way to move
out of WAITING is to supply a patch to an HP maintainer or excite one to fix it.
Please note that I'm not such a person.
Comment 6 Andrew Pinski 2003-08-20 21:20:49 UTC
I really want to say this is documentation error rather than an errror due to GCC so changing back 
to NEW.  The documentation should talk about -pthread in a more non-target specfic way and 
then add something about it for AIX unless some else (maintainers) agrues otherwise.
Comment 7 Steve Ellcey 2005-06-02 18:23:08 UTC
I am going to resolve this as invalid since I can't find any documentation to
fix. All the existing documentation I checked, even 3.2.2, is generic about what
flags pthread sets.  None of them mention _REENTRENT.
Comment 8 David Hopwood 2005-07-29 11:02:44 UTC
This bug is not invalid; it is a special case of bug 20705.