From: Nathan Chancellor <nathan@kernel.org>
To: "Nathan Chancellor" <nathan@kernel.org>,
"Nicolas Schier" <nsc@kernel.org>,
"Thomas Weißschuh" <thomas.weissschuh@linutronix.de>,
"Arnd Bergmann" <arnd@arndb.de>
Cc: Nick Desaulniers <nick.desaulniers+lkml@gmail.com>,
Bill Wendling <morbo@google.com>,
Justin Stitt <justinstitt@google.com>,
linux-kbuild@vger.kernel.org, llvm@lists.linux.dev,
patches@lists.linux.dev
Subject: [PATCH] kbuild: uapi: Avoid testing certain headers on ARCH=arm with CC=clang
Date: Sat, 10 Jan 2026 17:52:28 -0700 [thread overview]
Message-ID: <20260110-uapi-test-disable-headers-arm-clang-unaligned-access-v1-1-b7b0fa541daa@kernel.org> (raw)
After commit e3970d77ec50 ("kbuild: uapi: drop dependency on
CC_CAN_LINK"), which enables compile testing of UAPI headers in more
circumstances due to dropping the dependency on CONFIG_CC_CAN_LINK,
there are new instances of -Wunaligned-access when building with clang
targeting ARCH=arm in a few headers:
In file included from <built-in>:1:
./usr/include/linux/hyperv.h:361:2: error: field within 'struct hv_kvp_exchg_msg_value' is less aligned than 'union hv_kvp_exchg_msg_value::(anonymous at ./usr/include/linux/hyperv.h:361:2)' and is usually due to 'struct hv_kvp_exchg_msg_value' being packed, which can lead to unaligned accesses [-Werror,-Wunaligned-access]
361 | union {
| ^
1 error generated.
In file included from <built-in>:1:
In file included from ./usr/include/linux/vboxguest.h:14:
usr/include/linux/vbox_vmmdev_types.h:239:4: error: field u within 'struct vmmdev_hgcm_function_parameter32' is less aligned than 'union (unnamed union at usr/include/linux/vbox_vmmdev_types.h:223:2)' and is usually due to 'struct vmmdev_hgcm_function_parameter32' being packed, which can lead to unaligned accesses [-Werror,-Wunaligned-access]
239 | } u;
| ^
usr/include/linux/vbox_vmmdev_types.h:254:6: error: field u within 'struct vmmdev_hgcm_function_parameter64::(unnamed at usr/include/linux/vbox_vmmdev_types.h:249:3)' is less aligned than 'union (unnamed union at usr/include/linux/vbox_vmmdev_types.h:251:4)' and is usually due to 'struct vmmdev_hgcm_function_parameter64::(unnamed at usr/include/linux/vbox_vmmdev_types.h:249:3)' being packed, which can lead to unaligned accesses [-Werror,-Wunaligned-access]
254 | } u;
| ^
2 errors generated.
These warnings are now fatal after commit 3788d69db18d ("kbuild: uapi:
fail header test on compiler warnings"). -Wunaligned-access is only
enabled at W=1 for the rest of the kernel because of numerous instances
of it.
To keep the build working while the root cause of the warnings is
investigated and resolved, disable testing these header files for
ARCH=arm when building with clang. This should be a minimal loss of
coverage; if the issue pointed out by this warning existed in the wild,
it should have been noticed in real testing at this point since some of
these structures have been around for many years. It is likely the case
that since these structures are for specialized applications, they have
never been used on an ARM platform that does not support unaligned
access.
Fixes: e3970d77ec50 ("kbuild: uapi: drop dependency on CC_CAN_LINK")
Link: https://github.com/ClangBuiltLinux/linux/issues/1576
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
usr/include/Makefile | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/usr/include/Makefile b/usr/include/Makefile
index 6d86a53c6f0a..d23a0c0363bd 100644
--- a/usr/include/Makefile
+++ b/usr/include/Makefile
@@ -52,6 +52,12 @@ ifeq ($(SRCARCH),arc)
no-header-test += linux/bpf_perf_event.h
endif
+ifeq ($(SRCARCH)_$(CONFIG_CC_IS_CLANG),arm_y)
+no-header-test += linux/hyperv.h
+no-header-test += linux/vboxguest.h
+no-header-test += linux/vbox_vmmdev_types.h
+endif
+
ifeq ($(SRCARCH),openrisc)
no-header-test += linux/bpf_perf_event.h
endif
---
base-commit: e3970d77ec504e54c3f91a48b2125775c16ba4c0
change-id: 20260110-uapi-test-disable-headers-arm-clang-unaligned-access-a2e104a20a1e
Best regards,
--
Nathan Chancellor <nathan@kernel.org>
next reply other threads:[~2026-01-11 0:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-11 0:52 Nathan Chancellor [this message]
2026-01-11 10:29 ` [PATCH] kbuild: uapi: Avoid testing certain headers on ARCH=arm with CC=clang Arnd Bergmann
2026-01-12 22:53 ` Nathan Chancellor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260110-uapi-test-disable-headers-arm-clang-unaligned-access-v1-1-b7b0fa541daa@kernel.org \
--to=nathan@kernel.org \
--cc=arnd@arndb.de \
--cc=justinstitt@google.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=morbo@google.com \
--cc=nick.desaulniers+lkml@gmail.com \
--cc=nsc@kernel.org \
--cc=patches@lists.linux.dev \
--cc=thomas.weissschuh@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox