@@ -10,27 +10,22 @@ include $(srctree)/lib/vdso/Makefile
10
10
11
11
# Same as cc-*option, but using CC_COMPAT instead of CC
12
12
ifeq ($(CONFIG_CC_IS_CLANG ) , y)
13
- CC_COMPAT_CLANG_FLAGS := --target=$(notdir $(CROSS_COMPILE_COMPAT:%-=% ) )
14
-
15
13
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
20
15
else
21
- LD_COMPAT ?= $(CROSS_COMPILE_COMPAT ) ld
16
+ CC_COMPAT ?= $(CROSS_COMPILE_COMPAT ) gcc
22
17
endif
18
+
19
+ ifeq ($(CONFIG_LD_IS_LLD ) , y)
20
+ LD_COMPAT ?= $(LD )
23
21
else
24
- CC_COMPAT ?= $(CROSS_COMPILE_COMPAT ) gcc
25
22
LD_COMPAT ?= $(CROSS_COMPILE_COMPAT ) ld
26
23
endif
27
24
28
25
cc32-option = $(call try-run,\
29
26
$(CC_COMPAT ) $(1 ) -c -x c /dev/null -o "$$TMP",$(1 ) ,$(2 ) )
30
27
cc32-disable-warning = $(call try-run,\
31
28
$(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 ) )
34
29
35
30
# We cannot use the global flags to compile the vDSO files, the main reason
36
31
# 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,\
40
35
# As a result we set our own flags here.
41
36
42
37
# 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)
44
40
VDSO_CPPFLAGS += $(LINUXINCLUDE )
45
41
46
42
# Common C and assembly flags
47
43
# From top-level Makefile
48
44
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
-
53
45
VDSO_CAFLAGS += $(call cc32-option,-fno-PIE)
54
46
ifdef CONFIG_DEBUG_INFO
55
47
VDSO_CAFLAGS += -g
67
59
# From arm vDSO Makefile
68
60
VDSO_CAFLAGS += -fPIC -fno-builtin -fno-stack-protector
69
61
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
77
63
78
64
VDSO_CFLAGS := $(VDSO_CAFLAGS )
79
65
VDSO_CFLAGS += -DENABLE_COMPAT_VDSO=1
@@ -113,12 +99,6 @@ endif
113
99
VDSO_AFLAGS := $(VDSO_CAFLAGS )
114
100
VDSO_AFLAGS += -D__ASSEMBLY__
115
101
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
-
122
102
# From arm vDSO Makefile
123
103
VDSO_LDFLAGS += -Bsymbolic --no-undefined -soname=linux-vdso.so.1
124
104
VDSO_LDFLAGS += -z max-page-size=4096 -z common-page-size=4096
0 commit comments