@@ -10,28 +10,11 @@ obj-vdso64 = sigtramp64-64.o gettimeofday-64.o datapage-64.o cacheflush-64.o not
10
10
11
11
ifneq ($(c-gettimeofday-y ) ,)
12
12
CFLAGS_vgettimeofday-32.o += -include $(c-gettimeofday-y )
13
- CFLAGS_vgettimeofday-32.o += $(DISABLE_LATENT_ENTROPY_PLUGIN )
14
- CFLAGS_vgettimeofday-32.o += $(call cc-option, -fno-stack-protector)
15
- CFLAGS_vgettimeofday-32.o += -DDISABLE_BRANCH_PROFILING
16
- CFLAGS_vgettimeofday-32.o += -ffreestanding -fasynchronous-unwind-tables
17
- CFLAGS_REMOVE_vgettimeofday-32.o = $(CC_FLAGS_FTRACE )
18
- CFLAGS_REMOVE_vgettimeofday-32.o += -mcmodel=medium -mabi=elfv1 -mabi=elfv2 -mcall-aixdesc
19
- # This flag is supported by clang for 64-bit but not 32-bit so it will cause
20
- # an unused command line flag warning for this file.
21
- ifdef CONFIG_CC_IS_CLANG
22
- CFLAGS_REMOVE_vgettimeofday-32.o += -fno-stack-clash-protection
23
- endif
24
- CFLAGS_vgettimeofday-64.o += -include $(c-gettimeofday-y )
25
- CFLAGS_vgettimeofday-64.o += $(DISABLE_LATENT_ENTROPY_PLUGIN )
26
- CFLAGS_vgettimeofday-64.o += $(call cc-option, -fno-stack-protector)
27
- CFLAGS_vgettimeofday-64.o += -DDISABLE_BRANCH_PROFILING
28
- CFLAGS_vgettimeofday-64.o += -ffreestanding -fasynchronous-unwind-tables
29
- CFLAGS_REMOVE_vgettimeofday-64.o = $(CC_FLAGS_FTRACE )
30
13
# Go prior to 1.16.x assumes r30 is not clobbered by any VDSO code. That used to be true
31
14
# by accident when the VDSO was hand-written asm code, but may not be now that the VDSO is
32
15
# compiler generated. To avoid breaking Go tell GCC not to use r30. Impact on code
33
16
# generation is minimal, it will just use r29 instead.
34
- CFLAGS_vgettimeofday-64.o += $(call cc-option, -ffixed-r30)
17
+ CFLAGS_vgettimeofday-64.o += -include $( c-gettimeofday-y ) $(call cc-option, -ffixed-r30)
35
18
endif
36
19
37
20
# Build rules
@@ -49,6 +32,11 @@ targets += $(obj-vdso64) vdso64.so.dbg vgettimeofday-64.o
49
32
obj-vdso64 := $(addprefix $(obj ) /, $(obj-vdso64 ) )
50
33
51
34
ccflags-y := -fno-common -fno-builtin
35
+ ccflags-y += $(DISABLE_LATENT_ENTROPY_PLUGIN )
36
+ ccflags-y += $(call cc-option, -fno-stack-protector)
37
+ ccflags-y += -DDISABLE_BRANCH_PROFILING
38
+ ccflags-y += -ffreestanding -fasynchronous-unwind-tables
39
+ ccflags-remove-y := $(CC_FLAGS_FTRACE )
52
40
ldflags-y := -Wl,--hash-style=both -nostdlib -shared -z noexecstack $(CLANG_FLAGS )
53
41
ldflags-$(CONFIG_LD_IS_LLD) += $(call cc-option,--ld-path=$(LD ) ,-fuse-ld=lld)
54
42
ldflags-$(CONFIG_LD_ORPHAN_WARN) += -Wl,--orphan-handling=$(CONFIG_LD_ORPHAN_WARN_LEVEL )
@@ -57,6 +45,12 @@ ldflags-$(CONFIG_LD_ORPHAN_WARN) += -Wl,--orphan-handling=$(CONFIG_LD_ORPHAN_WAR
57
45
ldflags-y += $(filter-out $(CC_AUTO_VAR_INIT_ZERO_ENABLER ) $(CC_FLAGS_FTRACE ) -Wa$(comma ) % , $(KBUILD_CFLAGS ) )
58
46
59
47
CC32FLAGS := -m32
48
+ CC32FLAGSREMOVE := -mcmodel=medium -mabi=elfv1 -mabi=elfv2 -mcall-aixdesc
49
+ # This flag is supported by clang for 64-bit but not 32-bit so it will cause
50
+ # an unused command line flag warning for this file.
51
+ ifdef CONFIG_CC_IS_CLANG
52
+ CC32FLAGSREMOVE += -fno-stack-clash-protection
53
+ endif
60
54
LD32FLAGS := -Wl,-soname=linux-vdso32.so.1
61
55
AS32FLAGS := -D__VDSO32__
62
56
@@ -105,7 +99,7 @@ quiet_cmd_vdso32ld_and_check = VDSO32L $@
105
99
quiet_cmd_vdso32as = VDSO32A $@
106
100
cmd_vdso32as = $(VDSOCC ) $(a_flags ) $(CC32FLAGS ) $(AS32FLAGS ) -c -o $@ $<
107
101
quiet_cmd_vdso32cc = VDSO32C $@
108
- cmd_vdso32cc = $(VDSOCC ) $(c_flags ) $(CC32FLAGS ) -c -o $@ $<
102
+ cmd_vdso32cc = $(VDSOCC ) $(filter-out $( CC32FLAGSREMOVE ) , $( c_flags ) ) $(CC32FLAGS ) -c -o $@ $<
109
103
110
104
quiet_cmd_vdso64ld_and_check = VDSO64L $@
111
105
cmd_vdso64ld_and_check = $(VDSOCC ) $(ldflags-y ) $(LD64FLAGS ) -o $@ -Wl,-T$(filter % .lds,$^ ) $(filter % .o,$^ ) ; $(cmd_vdso_check )
0 commit comments