hc
2024-05-10 748e4f3d702def1a4bff191e0cf93b6a05340f01
kernel/arch/sparc/vdso/Makefile
....@@ -1,8 +1,7 @@
1
+# SPDX-License-Identifier: GPL-2.0-only
12 #
23 # Building vDSO images for sparc.
34 #
4
-
5
-KBUILD_CFLAGS += $(DISABLE_LTO)
65
76 VDSO64-$(CONFIG_SPARC64) := y
87 VDSOCOMPAT-$(CONFIG_COMPAT) := y
....@@ -33,16 +32,14 @@
3332
3433 CPPFLAGS_vdso.lds += -P -C
3534
36
-VDSO_LDFLAGS_vdso.lds = -m64 -Wl,-soname=linux-vdso.so.1 \
37
- -Wl,--no-undefined \
38
- -Wl,-z,max-page-size=8192 -Wl,-z,common-page-size=8192 \
39
- $(DISABLE_LTO)
35
+VDSO_LDFLAGS_vdso.lds = -m elf64_sparc -soname linux-vdso.so.1 --no-undefined \
36
+ -z max-page-size=8192
4037
4138 $(obj)/vdso64.so.dbg: $(obj)/vdso.lds $(vobjs) FORCE
4239 $(call if_changed,vdso)
4340
4441 HOST_EXTRACFLAGS += -I$(srctree)/tools/include
45
-hostprogs-y += vdso2c
42
+hostprogs += vdso2c
4643
4744 quiet_cmd_vdso2c = VDSO2C $@
4845 cmd_vdso2c = $(obj)/vdso2c $< $(<:%.dbg=%) $@
....@@ -54,26 +51,27 @@
5451 # Don't omit frame pointers for ease of userspace debugging, but do
5552 # optimize sibling calls.
5653 #
57
-CFL := $(PROFILING) -mcmodel=medlow -fPIC -O2 -fasynchronous-unwind-tables \
58
- -m64 -ffixed-g2 -ffixed-g3 -fcall-used-g4 -fcall-used-g5 -ffixed-g6 \
59
- -ffixed-g7 $(filter -g%,$(KBUILD_CFLAGS)) \
60
- $(call cc-option, -fno-stack-protector) -fno-omit-frame-pointer \
61
- -foptimize-sibling-calls -DBUILD_VDSO
54
+CFL := $(PROFILING) -mcmodel=medlow -fPIC -O2 -fasynchronous-unwind-tables -m64 \
55
+ $(filter -g%,$(KBUILD_CFLAGS)) -fno-stack-protector \
56
+ -fno-omit-frame-pointer -foptimize-sibling-calls \
57
+ -DDISABLE_BRANCH_PROFILING -DBUILD_VDSO
6258
63
-$(vobjs): KBUILD_CFLAGS += $(CFL)
59
+SPARC_REG_CFLAGS = -ffixed-g4 -ffixed-g5 -fcall-used-g5 -fcall-used-g7
60
+
61
+$(vobjs): KBUILD_CFLAGS := $(filter-out $(GCC_PLUGINS_CFLAGS) $(SPARC_REG_CFLAGS),$(KBUILD_CFLAGS)) $(CFL)
6462
6563 #
6664 # vDSO code runs in userspace and -pg doesn't help with profiling anyway.
6765 #
68
-CFLAGS_REMOVE_vdso-note.o = -pg
6966 CFLAGS_REMOVE_vclock_gettime.o = -pg
67
+CFLAGS_REMOVE_vdso32/vclock_gettime.o = -pg
7068
7169 $(obj)/%.so: OBJCOPYFLAGS := -S
72
-$(obj)/%.so: $(obj)/%.so.dbg
70
+$(obj)/%.so: $(obj)/%.so.dbg FORCE
7371 $(call if_changed,objcopy)
7472
75
-CPPFLAGS_vdso32.lds = $(CPPFLAGS_vdso.lds)
76
-VDSO_LDFLAGS_vdso32.lds = -m32 -Wl,-m,elf32_sparc,-soname=linux-gate.so.1
73
+CPPFLAGS_vdso32/vdso32.lds = $(CPPFLAGS_vdso.lds)
74
+VDSO_LDFLAGS_vdso32.lds = -m elf32_sparc -soname linux-gate.so.1
7775
7876 #This makes sure the $(obj) subdirectory exists even though vdso32/
7977 #is not a kbuild sub-make subdirectory
....@@ -91,8 +89,9 @@
9189 KBUILD_CFLAGS_32 := $(filter-out -mcmodel=medlow,$(KBUILD_CFLAGS_32))
9290 KBUILD_CFLAGS_32 := $(filter-out -fno-pic,$(KBUILD_CFLAGS_32))
9391 KBUILD_CFLAGS_32 := $(filter-out $(GCC_PLUGINS_CFLAGS),$(KBUILD_CFLAGS_32))
94
-KBUILD_CFLAGS_32 += -m32 -msoft-float -fpic -mno-app-regs -ffixed-g7
95
-KBUILD_CFLAGS_32 += $(call cc-option, -fno-stack-protector)
92
+KBUILD_CFLAGS_32 := $(filter-out $(SPARC_REG_CFLAGS),$(KBUILD_CFLAGS_32))
93
+KBUILD_CFLAGS_32 += -m32 -msoft-float -fpic
94
+KBUILD_CFLAGS_32 += -fno-stack-protector
9695 KBUILD_CFLAGS_32 += $(call cc-option, -foptimize-sibling-calls)
9796 KBUILD_CFLAGS_32 += -fno-omit-frame-pointer
9897 KBUILD_CFLAGS_32 += -DDISABLE_BRANCH_PROFILING
....@@ -109,12 +108,12 @@
109108 # The DSO images are built using a special linker script.
110109 #
111110 quiet_cmd_vdso = VDSO $@
112
- cmd_vdso = $(CC) -nostdlib -o $@ \
111
+ cmd_vdso = $(LD) -nostdlib -o $@ \
113112 $(VDSO_LDFLAGS) $(VDSO_LDFLAGS_$(filter %.lds,$(^F))) \
114
- -Wl,-T,$(filter %.lds,$^) $(filter %.o,$^)
113
+ -T $(filter %.lds,$^) $(filter %.o,$^) && \
114
+ sh $(srctree)/$(src)/checkundef.sh '$(OBJDUMP)' '$@'
115115
116
-VDSO_LDFLAGS = -fPIC -shared $(call cc-ldoption, -Wl$(comma)--hash-style=sysv) \
117
- $(call cc-ldoption, -Wl$(comma)--build-id) -Wl,-Bsymbolic
116
+VDSO_LDFLAGS = -shared --hash-style=both --build-id=sha1 -Bsymbolic
118117 GCOV_PROFILE := n
119118
120119 #