Skip to content

Commit bdeb4be

Browse files
nickdesaulniersppajda
authored andcommitted
arm64: vdso32: require CROSS_COMPILE_COMPAT for gcc+bfd
commit 3e6f8d1fa18457d54b20917bd9174d27daf09ab9 upstream. Similar to commit 231ad7f409f1 ("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 ef94340583ee ("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 <nathan@kernel.org> Suggested-by: Nathan Chancellor <nathan@kernel.org> Tested-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com> Reviewed-by: Vincenzo Frascino <vincenzo.frascino@arm.com> Link: https://lore.kernel.org/r/20211019223646.1146945-5-ndesaulniers@google.com Signed-off-by: Will Deacon <will@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Change-Id: I91e4f7a6944819e9ec0dffc0f19da5436d62fec3 Signed-off-by: Pajdek <pajdek@gmail.com>
1 parent 7d484ef commit bdeb4be

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
@@ -1228,7 +1228,8 @@ config ARM64_TAGGED_ADDR_ABI
12281228

12291229
config COMPAT_VDSO
12301230
bool "Enable vDSO for 32-bit applications"
1231-
depends on !CPU_BIG_ENDIAN && "$(CROSS_COMPILE_COMPAT)" != ""
1231+
depends on !CPU_BIG_ENDIAN
1232+
depends on (CC_IS_CLANG && LD_IS_LLD) || "$(CROSS_COMPILE_COMPAT)" != ""
12321233
select GENERIC_COMPAT_VDSO
12331234
default y
12341235
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-
ifeq ($(LLVM),1)
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

@@ -47,10 +44,6 @@ VDSO_CPPFLAGS += $(LINUXINCLUDE)
4744
# Common C and assembly flags
4845
# From top-level Makefile
4946
VDSO_CAFLAGS := $(VDSO_CPPFLAGS)
50-
ifneq ($(shell $(CC_COMPAT) --version 2>&1 | head -n 1 | grep clang),)
51-
VDSO_CAFLAGS += --target=$(notdir $(CROSS_COMPILE_COMPAT:%-=%))
52-
endif
53-
5447
VDSO_CAFLAGS += $(call cc32-option,-fno-PIE)
5548
ifdef CONFIG_DEBUG_INFO
5649
VDSO_CAFLAGS += -g

0 commit comments

Comments
 (0)