Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

kbuild: userprogs: avoid duplication of flags inherited from kernel

The duplication makes maintenance harder. Changes need to be done in two
places and the lines will grow overly long.

Use an intermediary variable instead.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Reviewed-by: Nicolas Schier <n.schier@avm.de>
Acked-by: Masahiro Yamada <masahiroy@kernel.org>
Link: https://lore.kernel.org/r/20250813-kbuild-userprogs-bits-v1-1-2d9f7f411083@linutronix.de
Signed-off-by: Nathan Chancellor <nathan@kernel.org>

authored by

Thomas Weißschuh and committed by
Nathan Chancellor
2d0ec4a9 27758d8c

+3 -2
+3 -2
Makefile
··· 1135 1135 endif 1136 1136 1137 1137 # Align the bit size of userspace programs with the kernel 1138 - KBUILD_USERCFLAGS += $(filter -m32 -m64 --target=%, $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS)) 1139 - KBUILD_USERLDFLAGS += $(filter -m32 -m64 --target=%, $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS)) 1138 + USERFLAGS_FROM_KERNEL := -m32 -m64 --target=% 1139 + KBUILD_USERCFLAGS += $(filter $(USERFLAGS_FROM_KERNEL), $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS)) 1140 + KBUILD_USERLDFLAGS += $(filter $(USERFLAGS_FROM_KERNEL), $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS)) 1140 1141 1141 1142 # userspace programs are linked via the compiler, use the correct linker 1142 1143 ifdef CONFIG_CC_IS_CLANG