summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorThomas Weißschuh <thomas.weissschuh@linutronix.de>2025-02-13 15:55:17 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-02-21 13:57:17 +0100
commit16467ffd3d201ba470a9059d1c5843de67b1c2a4 (patch)
treeff07c6c3f065d257286c5eebfedb37babed9ab13 /Makefile
parentf8bef3f067b667c87ed30c17d0e69a250a3f301c (diff)
downloadlinux-16467ffd3d201ba470a9059d1c5843de67b1c2a4.tar.gz
linux-16467ffd3d201ba470a9059d1c5843de67b1c2a4.tar.bz2
linux-16467ffd3d201ba470a9059d1c5843de67b1c2a4.zip
kbuild: userprogs: fix bitsize and target detection on clang
commit 1b71c2fb04e7a713abc6edde4a412416ff3158f2 upstream. scripts/Makefile.clang was changed in the linked commit to move --target from KBUILD_CFLAGS to KBUILD_CPPFLAGS, as that generally has a broader scope. However that variable is not inspected by the userprogs logic, breaking cross compilation on clang. Use both variables to detect bitsize and target arguments for userprogs. Fixes: feb843a469fb ("kbuild: add $(CLANG_FLAGS) to KBUILD_CPPFLAGS") Cc: stable@vger.kernel.org Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Reviewed-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile4
1 files changed, 2 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index cbd091c511d8..ab2724aeeb68 100644
--- a/Makefile
+++ b/Makefile
@@ -1054,8 +1054,8 @@ LDFLAGS_vmlinux += --orphan-handling=$(CONFIG_LD_ORPHAN_WARN_LEVEL)
endif
# Align the bit size of userspace programs with the kernel
-KBUILD_USERCFLAGS += $(filter -m32 -m64 --target=%, $(KBUILD_CFLAGS))
-KBUILD_USERLDFLAGS += $(filter -m32 -m64 --target=%, $(KBUILD_CFLAGS))
+KBUILD_USERCFLAGS += $(filter -m32 -m64 --target=%, $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS))
+KBUILD_USERLDFLAGS += $(filter -m32 -m64 --target=%, $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS))
# make the checker run with the right architecture
CHECKFLAGS += --arch=$(ARCH)