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 1763325 - argp.h kills __attribute__, causing gcc 4.8.5 with -std=c++ results in compile / link errors for __gthrw_pthread_mutex_* functions
Summary: argp.h kills __attribute__, causing gcc 4.8.5 with -std=c++ results in compil...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: glibc
Version: 7.7
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Florian Weimer
QA Contact: qe-baseos-tools-bugs
URL:
Whiteboard:
Depends On:
Blocks: 1782203
TreeView+ depends on / blocked
 
Reported: 2019-10-18 19:48 UTC by Frank Ch. Eigler
Modified: 2021-08-27 22:24 UTC (History)
10 users (show)

Fixed In Version: glibc-2.17-315.el7
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-09-29 19:20:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
gcc -E preprocessed form of a random snapshot of elfutils debuginfod (1.36 MB, text/plain)
2019-10-18 19:48 UTC, Frank Ch. Eigler
no flags Details
same, with -E -dD (1.64 MB, text/plain)
2019-10-18 20:13 UTC, Frank Ch. Eigler
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2020:3861 0 None None None 2020-09-29 19:21:09 UTC
Sourceware 16907 0 P2 RESOLVED <argp.h> compiled with --std=cXX disables __attribute__ 2020-09-29 09:20:19 UTC

Description Frank Ch. Eigler 2019-10-18 19:48:26 UTC
Created attachment 1627252 [details]
gcc -E  preprocessed form of a random snapshot of elfutils debuginfod

attached .i file, compiled thusly:

$ g++ -std=c++11 -g -O2  -c -o debuginfod.o debuginfod.i

shows:

/usr/include/c++/4.8.2/x86_64-redhat-linux/bits/gthr-default.h:115:37: warning: ‘int __gthrw_pthread_mutex_lock(pthread_mutex_t*) throw ()’ used but never defined [enabled by default]
 __gthrw(pthread_mutex_lock)
                                     ^
/usr/include/c++/4.8.2/x86_64-redhat-linux/bits/gthr-default.h:120:39: warning: ‘int __gthrw_pthread_mutex_unlock(pthread_mutex_t*) throw ()’ used but never defined [enabled by default]
 __gthrw(pthread_mutex_unlock)
                                       ^

linking fails with these gthr-relevant symbols:

$ g++ -std=c++11  -g -O2  -o debuginfod debuginfod.i|& grep gthr
[...]
/tmp/cc92jQNh.o: In function `__gthread_mutex_lock':
/usr/include/c++/4.8.2/x86_64-redhat-linux/bits/gthr-default.h:748: undefined reference to `__gthrw_pthread_mutex_lock(pthread_mutex_t*)'
/usr/include/c++/4.8.2/x86_64-redhat-linux/bits/gthr-default.h:748: undefined reference to `__gthrw_pthread_mutex_lock(pthread_mutex_t*)'
/tmp/cc92jQNh.o: In function `__gthread_mutex_unlock':
[...]

Comment 2 Jakub Jelinek 2019-10-18 20:02:26 UTC
Something is doing
#define __attribute__(x)
or something similar before including the libstdc++ headers.  That can't work.

Comment 3 Frank Ch. Eigler 2019-10-18 20:13:21 UTC
Created attachment 1627254 [details]
same, with -E -dD

Comment 4 Frank Ch. Eigler 2019-10-18 20:19:20 UTC
from discussions with jakub:
glibc-headers-2.17-292.el7.x86_64

/usr/include/argp.h:

#ifndef __attribute__
/* This feature is available in gcc versions 2.5 and later.  */
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || \
  defined __STRICT_ANSI__
#  define __attribute__(Spec) /* empty */
# endif


this bit in argp.h disables the __attribute__ mechanism that other system libraries rely on.  The __STRICT_ANSI__ condition is probably unnecessary here.


https://sourceware.org/bugzilla/show_bug.cgi?id=16907 appears to be this same bug.  Please consider a backport.

Comment 6 Florian Weimer 2019-11-25 16:03:08 UTC
Upstream commit:

commit 2c820533c61fed175390bc6058afbbe42d2edc37
Author: Florian Weimer <fweimer>
Date:   Thu Aug 18 11:15:42 2016 +0200

    argp: Do not override GCC keywords with macros [BZ #16907]
    
    glibc provides fallback definitions already.  It is not necessary to
    suppress warnings for unknown attributes because GCC does this
    automatically for system headers.
    
    This commit does not sync with gnulib because gnulib has started to use
    _GL_* macros in the header file, which are arguably in the gnulib
    implementation space and not suitable for an installed glibc header
    file.

Comment 12 errata-xmlrpc 2020-09-29 19:20:26 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Low: glibc security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:3861


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