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.

init: deduplicate cc-can-link.sh invocations

The command to invoke scripts/cc-can-link.sh is very long and new usages
are about to be added.

Add a helper variable to make the code easier to read and maintain.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Reviewed-by: Nicolas Schier <nsc@kernel.org>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Link: https://patch.msgid.link/20251114-kbuild-userprogs-bits-v3-2-4dee0d74d439@linutronix.de
Signed-off-by: Nicolas Schier <nsc@kernel.org>

authored by

Thomas Weißschuh and committed by
Nicolas Schier
80623f2c d81d9d38

+5 -2
+2 -2
init/Kconfig
··· 84 84 85 85 config CC_CAN_LINK 86 86 bool 87 - default $(success,$(srctree)/scripts/cc-can-link.sh $(CC) $(CLANG_FLAGS) $(USERCFLAGS) $(USERLDFLAGS) $(m64-flag)) if 64BIT 88 - default $(success,$(srctree)/scripts/cc-can-link.sh $(CC) $(CLANG_FLAGS) $(USERCFLAGS) $(USERLDFLAGS) $(m32-flag)) 87 + default $(cc_can_link_user,$(m64-flag)) if 64BIT 88 + default $(cc_can_link_user,$(m32-flag)) 89 89 90 90 # Fixed in GCC 14, 13.3, 12.4 and 11.5 91 91 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113921
+3
scripts/Kconfig.include
··· 65 65 m32-flag := $(cc-option-bit,-m32) 66 66 m64-flag := $(cc-option-bit,-m64) 67 67 68 + # Test whether the compiler can link userspace applications 69 + cc_can_link_user = $(success,$(srctree)/scripts/cc-can-link.sh $(CC) $(CLANG_FLAGS) $(USERCFLAGS) $(USERLDFLAGS) $(1)) 70 + 68 71 rustc-version := $(shell,$(srctree)/scripts/rustc-version.sh $(RUSTC)) 69 72 rustc-llvm-version := $(shell,$(srctree)/scripts/rustc-llvm-version.sh $(RUSTC)) 70 73