Skip to content

Commit 3e6f8d1

Browse files
nickdesaulnierswilldeacon
authored andcommitted
arm64: vdso32: require CROSS_COMPILE_COMPAT for gcc+bfd
Similar to commit 231ad7f ("Makefile: infer --target from ARCH for CC=clang") There really is no point in setting --target based on $CROSS_COMPILE_COMPAT for clang when the integrated assembler is being used, since commit ef94340 ("arm64: vdso32: drop -no-integrated-as flag"). Allows COMPAT_VDSO to be selected without setting $CROSS_COMPILE_COMPAT when using clang and lld together. Before: $ ARCH=arm64 CROSS_COMPILE_COMPAT=arm-linux-gnueabi- make -j72 LLVM=1 defconfig $ grep CONFIG_COMPAT_VDSO .config CONFIG_COMPAT_VDSO=y $ ARCH=arm64 make -j72 LLVM=1 defconfig $ grep CONFIG_COMPAT_VDSO .config $ After: $ ARCH=arm64 CROSS_COMPILE_COMPAT=arm-linux-gnueabi- make -j72 LLVM=1 defconfig $ grep CONFIG_COMPAT_VDSO .config CONFIG_COMPAT_VDSO=y $ ARCH=arm64 make -j72 LLVM=1 defconfig $ grep CONFIG_COMPAT_VDSO .config CONFIG_COMPAT_VDSO=y Reviewed-by: Nathan Chancellor <[email protected]> Suggested-by: Nathan Chancellor <[email protected]> Tested-by: Nathan Chancellor <[email protected]> Signed-off-by: Nick Desaulniers <[email protected]> Reviewed-by: Vincenzo Frascino <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent 14831fa commit 3e6f8d1

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

arch/arm64/Kconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1264,7 +1264,8 @@ config KUSER_HELPERS
12641264

12651265
config COMPAT_VDSO
12661266
bool "Enable vDSO for 32-bit applications"
1267-
depends on !CPU_BIG_ENDIAN && "$(CROSS_COMPILE_COMPAT)" != ""
1267+
depends on !CPU_BIG_ENDIAN
1268+
depends on (CC_IS_CLANG && LD_IS_LLD) || "$(CROSS_COMPILE_COMPAT)" != ""
12681269
select GENERIC_COMPAT_VDSO
12691270
default y
12701271
help

arch/arm64/kernel/vdso32/Makefile

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,15 @@ include $(srctree)/lib/vdso/Makefile
1010

1111
# Same as cc-*option, but using CC_COMPAT instead of CC
1212
ifeq ($(CONFIG_CC_IS_CLANG), y)
13-
CC_COMPAT_CLANG_FLAGS := --target=$(notdir $(CROSS_COMPILE_COMPAT:%-=%))
14-
1513
CC_COMPAT ?= $(CC)
16-
CC_COMPAT += $(CC_COMPAT_CLANG_FLAGS)
17-
18-
ifneq ($(LLVM),)
19-
LD_COMPAT ?= $(LD)
14+
CC_COMPAT += --target=arm-linux-gnueabi
2015
else
21-
LD_COMPAT ?= $(CROSS_COMPILE_COMPAT)ld
16+
CC_COMPAT ?= $(CROSS_COMPILE_COMPAT)gcc
2217
endif
18+
19+
ifeq ($(CONFIG_LD_IS_LLD), y)
20+
LD_COMPAT ?= $(LD)
2321
else
24-
CC_COMPAT ?= $(CROSS_COMPILE_COMPAT)gcc
2522
LD_COMPAT ?= $(CROSS_COMPILE_COMPAT)ld
2623
endif
2724

@@ -45,10 +42,6 @@ VDSO_CPPFLAGS += $(LINUXINCLUDE)
4542
# Common C and assembly flags
4643
# From top-level Makefile
4744
VDSO_CAFLAGS := $(VDSO_CPPFLAGS)
48-
ifneq ($(shell $(CC_COMPAT) --version 2>&1 | head -n 1 | grep clang),)
49-
VDSO_CAFLAGS += --target=$(notdir $(CROSS_COMPILE_COMPAT:%-=%))
50-
endif
51-
5245
VDSO_CAFLAGS += $(call cc32-option,-fno-PIE)
5346
ifdef CONFIG_DEBUG_INFO
5447
VDSO_CAFLAGS += -g

0 commit comments

Comments
 (0)