RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 617719 - [RHEL6] info page for gcc needs update re: -pthread
Summary: [RHEL6] info page for gcc needs update re: -pthread
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: gcc
Version: 6.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Jakub Jelinek
QA Contact: qe-baseos-tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-07-23 19:40 UTC by Issue Tracker
Modified: 2018-11-14 19:16 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-11-30 14:05:20 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Issue Tracker 2010-07-23 19:40:06 UTC
Escalated to Bugzilla from IssueTracker

Comment 1 Issue Tracker 2010-07-23 19:40:08 UTC
Event posted on 07-21-2010 12:46pm EDT by woodard

Description of problem:
The info page says one thing:

`-mt'
`-pthread'
     Add support for multithreading using the POSIX threads library.
     This option sets flags for both the preprocessor and linker.  It
     does not affect the thread safety of object code produced by the
     compiler or that of libraries supplied with it.  These are HP-UX
     specific flags.

This email says something else:
http://gcc.gnu.org/ml/gcc/2010-05/msg00059.html

It looks like the docs need to be updated a bit.

This issue needs to be cloned for RHEL5 as well. Same problem.
This event sent from IssueTracker by tgummels  [LLNL (HPC)]
 issue 1168973

Comment 3 Travis Gummels 2010-07-23 19:45:37 UTC
Email referenced in Comment 1

Magnus Fromreide <magfr.se> writes:

> I recently ended up in a discussion about the -pthread flag at work and
> when looking at the documentation I noticed that it is defined onlt for
> SPARC and RS/6000/PowerPC.
>
> Additionally -fopenmp and -ftree-parallelize-loops say they are only
> supported on targets where -pthread are available.
>
> Now, on x86-linux it seems as if -pthread does something but there is no
> documentation of it so I'd like to know
>
>       * What does -pthread do on x86?

On x86 GNU/Linux -pthread defines _REENTRANT for the preprocessor and
links against -lpthread.

>       * If I am to compile a threaded program am I then requiered to use
>         -pthread?

On GNU/Linux, you need to use -pthread or -D_REENTRANT at compilation
time, and you need to use -pthread or -lpthread at link time.

I agree that this really ought to be documented.

Ian

Comment 4 Jakub Jelinek 2010-11-22 08:48:52 UTC
-D_REENTRANT has so little effect on Linux that it is IMNSHO not worth mentioning.
It affects only presence of getlogin_r prototype in unistd.h, but that prototype is defined either if _REENTRANT is defined, or if POSIX >= 199506 is requested (the latter is by default, unless you request strict compliance with something older).  So, in reality, -pthread is basically ignored during compilation, and during linking it is just equivalent of -lpthread.

Comment 5 RHEL Program Management 2010-11-30 14:05:20 UTC
Development Management has reviewed and declined this request.  You may appeal
this decision by reopening this request.


Note You need to log in before you can comment on or make changes to this bug.