Bug 2276084 - kernel headers using unuglified names of GNU attributes
Summary: kernel headers using unuglified names of GNU attributes
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel-headers
Version: 40
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Justin M. Forbes
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-04-19 16:50 UTC by Jakub Jelinek
Modified: 2024-04-29 16:35 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Jakub Jelinek 2024-04-19 16:50:36 UTC
Some libstdc++-v3 tests in gcc fail because kernel-headers on s390x has in /usr/include/asm/types.h
} __attribute__((packed, aligned(4))) __vector128;
see
https://kojipkgs.fedoraproject.org/packages/gcc/14.0.1/0.15.fc40/data/logs/s390x/build.log
FAIL: 17_intro/headers/c++1998/all_attributes.cc   (test for excess errors)
FAIL: 17_intro/headers/c++2011/all_attributes.cc   (test for excess errors)
FAIL: 17_intro/headers/c++2014/all_attributes.cc   (test for excess errors)
FAIL: 17_intro/headers/c++2017/all_attributes.cc   (test for excess errors)
FAIL: 17_intro/headers/c++2020/all_attributes.cc   (test for excess errors)
These tests attempt to verify that libstdc++ headers themselves never use __attribute__((packed)) etc., but __attribute__((__packed__)) etc., because the former are in the implementation namespace.
grep __attribute__ `rpm -ql kernel-headers` 2>/dev/null | grep -v '((__'
shows hundreds of hits (of course, in some headers it is far more important than in others, the more important ones are those typically included by glibc or libstdc++ headers directly or indirectly).
I think kernel folks don't really want to switch to using those __ prefixed and suffixed versions, could this be done by some sed/awk/python script done when preparing the headers for shipping as user asm/ and linux/ headers?

grep __attribute__ `rpm -ql kernel-headers` 2>/dev/null | grep -v '((__' | sed 's/^.*ttribute__[[:blank:]]*((//;s/))\([^)]*\|$\)//' | sort -u
aligned(256);
aligned(4);
aligned(4) packed_ulong;
aligned(4 * sizeof(__u64));
aligned(8)
aligned(8);
aligned(8) *config;
aligned(8) timestamp_ns;
aligned (__alignof__(struct ebt_replace));
aligned(sizeof(__u64));
aligned(VRING_AVAIL_ALIGN_SIZE)
aligned(VRING_DESC_ALIGN_SIZE)
aligned(VRING_USED_ALIGN_SIZE)
bitwise
packed
packed, aligned(4);
packed,aligned(4)
packed, deprecated

shows that it is really just a couple of attributes and uglifying their names shouldn't be that hard inside of __attribute__(( ... )) arguments.

Reproducible: Always

Comment 1 Justin M. Forbes 2024-04-26 15:25:13 UTC
This sounds like something that should really be changed upstream.  If they are not willing, it would be worth having a discussion with at least RHEL, to make sure we have a single solution that works with everything.

Comment 2 Jakub Jelinek 2024-04-29 07:33:28 UTC
Sure, feel free to forward it there.  I wasn't where kernel-headers bugreporting goes to, if it acts as a separate project or is handled together with the kernel.
Because I doubt kernel itself wants to uglify all their attribute names.

Comment 3 Justin M. Forbes 2024-04-29 16:35:31 UTC
It is not a separate project, and comes directly from the kernel. The only reason that fedora builds it as a separate package is to get around the chicken/egg problem when things like perf define something new in headers, and then need to use that build. RHEL builds kernel-headers as a subpackage of kernel.  So if kernel is not interested, this needs to at least be a discussion with RHEL so make sure that both Fedora and RHEL are on the same page about it.


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