Skip to content

Commit b2909a4

Browse files
committed
Merge branch 'for-next/vdso' into for-next/core
* for-next/vdso: arm64: vdso32: require CROSS_COMPILE_COMPAT for gcc+bfd arm64: vdso32: suppress error message for 'make mrproper' arm64: vdso32: drop test for -march=armv8-a arm64: vdso32: drop the test for dmb ishld
2 parents e5f5210 + 3e6f8d1 commit b2909a4

File tree

3 files changed

+10
-36
lines changed

3 files changed

+10
-36
lines changed

arch/arm64/Kconfig

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

13801380
config COMPAT_VDSO
13811381
bool "Enable vDSO for 32-bit applications"
1382-
depends on !CPU_BIG_ENDIAN && "$(CROSS_COMPILE_COMPAT)" != ""
1382+
depends on !CPU_BIG_ENDIAN
1383+
depends on (CC_IS_CLANG && LD_IS_LLD) || "$(CROSS_COMPILE_COMPAT)" != ""
13831384
select GENERIC_COMPAT_VDSO
13841385
default y
13851386
help

arch/arm64/include/asm/vdso/compat_barrier.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,9 @@
2020

2121
#define dmb(option) __asm__ __volatile__ ("dmb " #option : : : "memory")
2222

23-
#if __LINUX_ARM_ARCH__ >= 8 && defined(CONFIG_AS_DMB_ISHLD)
2423
#define aarch32_smp_mb() dmb(ish)
2524
#define aarch32_smp_rmb() dmb(ishld)
2625
#define aarch32_smp_wmb() dmb(ishst)
27-
#else
28-
#define aarch32_smp_mb() dmb(ish)
29-
#define aarch32_smp_rmb() aarch32_smp_mb()
30-
#define aarch32_smp_wmb() dmb(ishst)
31-
#endif
32-
3326

3427
#undef smp_mb
3528
#undef smp_rmb

arch/arm64/kernel/vdso32/Makefile

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,22 @@ 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

2825
cc32-option = $(call try-run,\
2926
$(CC_COMPAT) $(1) -c -x c /dev/null -o "$$TMP",$(1),$(2))
3027
cc32-disable-warning = $(call try-run,\
3128
$(CC_COMPAT) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1)))
32-
cc32-as-instr = $(call try-run,\
33-
printf "%b\n" "$(1)" | $(CC_COMPAT) $(VDSO_AFLAGS) -c -x assembler -o "$$TMP" -,$(2),$(3))
3429

3530
# We cannot use the global flags to compile the vDSO files, the main reason
3631
# being that the 32-bit compiler may be older than the main (64-bit) compiler
@@ -40,16 +35,13 @@ cc32-as-instr = $(call try-run,\
4035
# As a result we set our own flags here.
4136

4237
# KBUILD_CPPFLAGS and NOSTDINC_FLAGS from top-level Makefile
43-
VDSO_CPPFLAGS := -DBUILD_VDSO -D__KERNEL__ -nostdinc -isystem $(shell $(CC_COMPAT) -print-file-name=include)
38+
VDSO_CPPFLAGS := -DBUILD_VDSO -D__KERNEL__ -nostdinc
39+
VDSO_CPPFLAGS += -isystem $(shell $(CC_COMPAT) -print-file-name=include 2>/dev/null)
4440
VDSO_CPPFLAGS += $(LINUXINCLUDE)
4541

4642
# Common C and assembly flags
4743
# From top-level Makefile
4844
VDSO_CAFLAGS := $(VDSO_CPPFLAGS)
49-
ifneq ($(shell $(CC_COMPAT) --version 2>&1 | head -n 1 | grep clang),)
50-
VDSO_CAFLAGS += --target=$(notdir $(CROSS_COMPILE_COMPAT:%-=%))
51-
endif
52-
5345
VDSO_CAFLAGS += $(call cc32-option,-fno-PIE)
5446
ifdef CONFIG_DEBUG_INFO
5547
VDSO_CAFLAGS += -g
@@ -67,13 +59,7 @@ endif
6759
# From arm vDSO Makefile
6860
VDSO_CAFLAGS += -fPIC -fno-builtin -fno-stack-protector
6961
VDSO_CAFLAGS += -DDISABLE_BRANCH_PROFILING
70-
71-
72-
# Try to compile for ARMv8. If the compiler is too old and doesn't support it,
73-
# fall back to v7. There is no easy way to check for what architecture the code
74-
# is being compiled, so define a macro specifying that (see arch/arm/Makefile).
75-
VDSO_CAFLAGS += $(call cc32-option,-march=armv8-a -D__LINUX_ARM_ARCH__=8,\
76-
-march=armv7-a -D__LINUX_ARM_ARCH__=7)
62+
VDSO_CAFLAGS += -march=armv8-a
7763

7864
VDSO_CFLAGS := $(VDSO_CAFLAGS)
7965
VDSO_CFLAGS += -DENABLE_COMPAT_VDSO=1
@@ -113,12 +99,6 @@ endif
11399
VDSO_AFLAGS := $(VDSO_CAFLAGS)
114100
VDSO_AFLAGS += -D__ASSEMBLY__
115101

116-
# Check for binutils support for dmb ishld
117-
dmbinstr := $(call cc32-as-instr,dmb ishld,-DCONFIG_AS_DMB_ISHLD=1)
118-
119-
VDSO_CFLAGS += $(dmbinstr)
120-
VDSO_AFLAGS += $(dmbinstr)
121-
122102
# From arm vDSO Makefile
123103
VDSO_LDFLAGS += -Bsymbolic --no-undefined -soname=linux-vdso.so.1
124104
VDSO_LDFLAGS += -z max-page-size=4096 -z common-page-size=4096

0 commit comments

Comments
 (0)