linux/tools
Joy H.J. Lee 4f489a1540 tools/compiler: match glibc 2.42 definition of __attribute_const__
commit 8700a4761b upstream.

glibc 2.42 added __attribute_const__ to sys/cdefs.h:

    # define __attribute_const__ __attribute__ ((__const__))

GCC 15 warns when a macro is redefined to a different replacement list
(-Wbuiltin-macro-redefined). Since host tool Makefiles (resolve_btfids,
objtool) pass -Werror, this conflict becomes fatal.

The warning is suppressed on standard native builds because GCC treats
/usr/include as a system header path (-isystem), and macro-redefinition
warnings from system headers are silently suppressed by GCC. It fires
when glibc headers are on a regular include path (-I) instead, which
is the case in cross-compilation setups such as NixOS, where the
sysroot's glibc is passed explicitly via -I rather than -isystem.

Per (C11 6.10.3), identical replacement lists are accepted silently.
Match the glibc definition exactly, including the space before "((", so
the redefinition is accepted without warning regardless of whether
glibc headers are treated as system or non-system includes.

Link: https://lore.kernel.org/20260701200635.3992767-1-rkr0k0r@gmail.com
Signed-off-by: Joy H.J. Lee <rkr0k0r@gmail.com>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: David Laight <david.laight.linux@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2026-09-14 13:20:04 +02:00
..
accounting SPDX patches for 5.7-rc1. 2020-04-03 13:12:26 -07:00
arch x86/CPU/AMD: Prevent improper isolation of shared resources in Zen2's op cache 2026-05-15 14:48:45 +02:00
bootconfig tools/bootconfig: fix fd leak in load_xbc_file() on fstat failure 2026-04-18 10:33:22 +02:00
bpf bpftool: Use libbpf error code for flow dissector query 2026-07-24 15:51:32 +02:00
build tools build: Align warning options with perf 2025-10-19 16:21:42 +02:00
cgroup tools/cgroup/slabinfo.py: updated to work on current kernel 2021-04-23 14:42:40 -07:00
debugging tools: Fix "the the" in a message in kernel-chktaint 2021-06-13 17:01:17 -06:00
edid tools/edid: Move EDID data sets from Documentation/ 2020-02-19 04:10:32 -07:00
firewire treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
firmware Driver Core and debugfs changes for 5.3-rc1 2019-07-12 12:24:03 -07:00
gpio tools: gpio: fix debounce_period_us output of lsgpio 2023-06-21 15:59:12 +02:00
hv vmbus_testing: fix wrong python syntax for integer value comparison 2023-09-19 12:22:28 +02:00
iio tools/iio: Add memory allocation failure check for trigger_name 2024-10-17 15:11:52 +02:00
include tools/compiler: match glibc 2.42 definition of __attribute_const__ 2026-09-14 13:20:04 +02:00
io_uring tools/io_uring/io_uring-cp: sync with liburing example 2021-08-13 08:58:11 -06:00
kvm/kvm_stat tools/kvm_stat: fix display of error when multiple processes are found 2022-08-11 13:07:51 +02:00
laptop change email address for Pali Rohár 2020-04-10 15:36:22 -07:00
leds .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
lib tools lib api: Fix mount_overload() snprintf truncation and toupper range 2026-07-24 15:51:38 +02:00
memory-model tools/memory-model: Fix bug in lock.cat 2024-08-19 05:45:15 +02:00
objtool objtool: Fix Clang jump table detection 2026-04-18 10:33:29 +02:00
pci tools: PCI: Zero-initialize param 2021-08-05 11:01:30 +01:00
pcmcia .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
perf bitops: make BYTES_TO_BITS() treewide-available 2026-07-24 15:51:56 +02:00
power tools/power cpupower: Reset errno before strtoull() 2026-03-04 07:19:57 -05:00
rcu tools/rcu: Add drgn script to dump number of RCU callbacks 2021-05-10 15:39:19 -07:00
scripts tools: Override makefile ARCH variable if defined, but empty 2024-12-14 19:51:30 +01:00
spi spi: tools: Add include folder to .gitignore 2026-03-04 07:19:32 -05:00
testing selftests/ftrace: refactor eprobes test to fix argument checks 2026-08-19 17:14:13 +02:00
thermal/tmon tools/thermal: Fix possible path truncations 2022-08-17 14:24:15 +02:00
time treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 282 2019-06-05 17:36:37 +02:00
tracing tracing/tools: Fix incorrcet short option in usage text for --threads 2025-12-07 06:09:32 +09:00
usb usbip: tools: support SuperSpeedPlus devices 2026-07-24 15:51:23 +02:00
virtio tools/virtio: check mmap return value in vringh_test 2026-07-24 15:51:34 +02:00
vm tools/mm/slabinfo: fix total_objects attribute name 2026-07-24 15:51:26 +02:00
wmi treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
Makefile tracing/tools: Add the latency-collector to tools directory 2021-02-12 11:52:59 -05:00