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 2183212 - glibc: _FloatN and _FloatNx problem if _GNUC__ is not defined
Summary: glibc: _FloatN and _FloatNx problem if _GNUC__ is not defined
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: glibc
Version: 8.7
Hardware: All
OS: Linux
unspecified
low
Target Milestone: rc
: ---
Assignee: glibc team
QA Contact: qe-baseos-tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-03-30 15:22 UTC by Paulo Andrade
Modified: 2023-04-26 17:05 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-04-24 10:35:10 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-153626 0 None None None 2023-03-30 15:23:58 UTC

Description Paulo Andrade 2023-03-30 15:22:43 UTC
Sample reproducer:

$ cat > test.c <<EOF
 #include <stdio.h>
#include <stdlib.h>
void foo(void) {
}
EOF
$ gcc -c -U__GNUC__ test.c

  User wants to preprocess source files with __GNUC__ undefined.

  Ignoring possible ABI or unrelated issues, maybe a good approach
would be to change /usr/include/bits/floatn-common.h from:

#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
typedef float _Float32;
#  endif

to:
#  if (!__GNUC_PREREQ (7, 0) && __STDC_WANT_IEC_60559_TYPES_EXT__) || defined __cplusplus
typedef float _Float32;
#  endif

or similar pattern as appropriate.

Quoting https://access.redhat.com/documentation/fr-fr/red_hat_enterprise_linux/8/html/considerations_in_adopting_rhel_8/compilers-and-development-tools_considerations-in-adopting-rhel-8
"""
The _FloatN and _FloatNx type names specified by the ISO/IEC TS 18661-3:2015 standard are now recognized by the C front end.
"""

Comment 1 Florian Weimer 2023-04-03 08:03:23 UTC
__STDC_WANT_IEC_60559_TYPES_EXT__ does not seem to be quite the right macro here. I expect this to cause problems elsewhere, particularly with -D_GNU_SOURCE or with Clang.

I think we need a way to override the type availability check that's not dependent on GCC versions. It's going to be cumbersome to use. Basically, the user will have to define macros for all built-in compiler types.

As a workaround, the customer can probably use additional macro definitions like -D_Float32=_Float32_renamed etc. to hide the GCC-defined type, or use Clang, which does not define _Float32 yet.

Comment 2 Florian Weimer 2023-04-03 08:07:36 UTC
Raised this on libc-alpha:

Using glibc headers with non-GCC compilers which define _Float32 etc.
<https://sourceware.org/pipermail/libc-alpha/2023-April/146861.html>

Comment 3 Florian Weimer 2023-04-03 09:57:30 UTC
Upstream suggests that we should enable support for compilers on a case-by-case basis. If the customer has a compiler that does not work due to this (and they used -U__GNUC__ with GCC just to demonstrate the issue), we should fix that upstream and consider a backport.

If they want to use -U__GNUC__ to test compatibility with hypothetical compilers that do not define __GNUC__, I think they need to use one of the workarounds I suggested.

Comment 6 Florian Weimer 2023-04-24 10:35:10 UTC
We do not consider this a bug. As explained, building with -U__GNUC__ with a compiler that defines the _Float* types (such as GCC itself) is not supported. There are no plans to change that upstream or downstream. If this causes compatibility issues with a specific compiler, we can fix the glibc headers upstream to recognize that compiler (like it presently recognizes GCC). But this requires information about the specific compiler for which header file support is requested.

The customer has a workaround, so I'm closing this bug.


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