Makefile (74c12ee02af109adcde36ec184fa59c0afb0edaa) Makefile (40d04110f87940b6a03bf0aa19cd29e84f465f20)
1# SPDX-License-Identifier: GPL-2.0
2#
3# Building vDSO images for x86.
4#
5
6# Absolute relocation type $(ARCH_REL_TYPE_ABS) needs to be defined before
7# the inclusion of generic Makefile.
8ARCH_REL_TYPE_ABS := R_X86_64_JUMP_SLOT|R_X86_64_GLOB_DAT|R_X86_64_RELATIVE|
9ARCH_REL_TYPE_ABS += R_386_GLOB_DAT|R_386_JMP_SLOT|R_386_RELATIVE
10include $(srctree)/lib/vdso/Makefile
11
12KBUILD_CFLAGS += $(DISABLE_LTO)
1# SPDX-License-Identifier: GPL-2.0
2#
3# Building vDSO images for x86.
4#
5
6# Absolute relocation type $(ARCH_REL_TYPE_ABS) needs to be defined before
7# the inclusion of generic Makefile.
8ARCH_REL_TYPE_ABS := R_X86_64_JUMP_SLOT|R_X86_64_GLOB_DAT|R_X86_64_RELATIVE|
9ARCH_REL_TYPE_ABS += R_386_GLOB_DAT|R_386_JMP_SLOT|R_386_RELATIVE
10include $(srctree)/lib/vdso/Makefile
11
12KBUILD_CFLAGS += $(DISABLE_LTO)
13
14# Sanitizer runtimes are unavailable and cannot be linked here.
13KASAN_SANITIZE := n
14UBSAN_SANITIZE := n
15KASAN_SANITIZE := n
16UBSAN_SANITIZE := n
17KCSAN_SANITIZE := n
15OBJECT_FILES_NON_STANDARD := y
16
17# Prevents link failures: __sanitizer_cov_trace_pc() is not linked in.
18KCOV_INSTRUMENT := n
19
20VDSO64-$(CONFIG_X86_64) := y
21VDSOX32-$(CONFIG_X86_X32_ABI) := y
22VDSO32-$(CONFIG_X86_32) := y

--- 31 unchanged lines hidden (view full) ---

54
55VDSO_LDFLAGS_vdso.lds = -m elf_x86_64 -soname linux-vdso.so.1 --no-undefined \
56 -z max-page-size=4096
57
58$(obj)/vdso64.so.dbg: $(obj)/vdso.lds $(vobjs) FORCE
59 $(call if_changed,vdso_and_check)
60
61HOST_EXTRACFLAGS += -I$(srctree)/tools/include -I$(srctree)/include/uapi -I$(srctree)/arch/$(SUBARCH)/include/uapi
18OBJECT_FILES_NON_STANDARD := y
19
20# Prevents link failures: __sanitizer_cov_trace_pc() is not linked in.
21KCOV_INSTRUMENT := n
22
23VDSO64-$(CONFIG_X86_64) := y
24VDSOX32-$(CONFIG_X86_X32_ABI) := y
25VDSO32-$(CONFIG_X86_32) := y

--- 31 unchanged lines hidden (view full) ---

57
58VDSO_LDFLAGS_vdso.lds = -m elf_x86_64 -soname linux-vdso.so.1 --no-undefined \
59 -z max-page-size=4096
60
61$(obj)/vdso64.so.dbg: $(obj)/vdso.lds $(vobjs) FORCE
62 $(call if_changed,vdso_and_check)
63
64HOST_EXTRACFLAGS += -I$(srctree)/tools/include -I$(srctree)/include/uapi -I$(srctree)/arch/$(SUBARCH)/include/uapi
62hostprogs += vdso2c
65hostprogs-y += vdso2c
63
64quiet_cmd_vdso2c = VDSO2C $@
65 cmd_vdso2c = $(obj)/vdso2c $< $(<:%.dbg=%) $@
66
67$(obj)/vdso-image-%.c: $(obj)/vdso%.so.dbg $(obj)/vdso%.so $(obj)/vdso2c FORCE
68 $(call if_changed,vdso2c)
69
70#

--- 11 unchanged lines hidden (view full) ---

82endif
83endif
84
85$(vobjs): KBUILD_CFLAGS := $(filter-out $(GCC_PLUGINS_CFLAGS) $(RETPOLINE_CFLAGS),$(KBUILD_CFLAGS)) $(CFL)
86
87#
88# vDSO code runs in userspace and -pg doesn't help with profiling anyway.
89#
66
67quiet_cmd_vdso2c = VDSO2C $@
68 cmd_vdso2c = $(obj)/vdso2c $< $(<:%.dbg=%) $@
69
70$(obj)/vdso-image-%.c: $(obj)/vdso%.so.dbg $(obj)/vdso%.so $(obj)/vdso2c FORCE
71 $(call if_changed,vdso2c)
72
73#

--- 11 unchanged lines hidden (view full) ---

85endif
86endif
87
88$(vobjs): KBUILD_CFLAGS := $(filter-out $(GCC_PLUGINS_CFLAGS) $(RETPOLINE_CFLAGS),$(KBUILD_CFLAGS)) $(CFL)
89
90#
91# vDSO code runs in userspace and -pg doesn't help with profiling anyway.
92#
93CFLAGS_REMOVE_vdso-note.o = -pg
90CFLAGS_REMOVE_vclock_gettime.o = -pg
91CFLAGS_REMOVE_vdso32/vclock_gettime.o = -pg
92CFLAGS_REMOVE_vgetcpu.o = -pg
94CFLAGS_REMOVE_vclock_gettime.o = -pg
95CFLAGS_REMOVE_vdso32/vclock_gettime.o = -pg
96CFLAGS_REMOVE_vgetcpu.o = -pg
97CFLAGS_REMOVE_vvar.o = -pg
93
94#
95# X32 processes use x32 vDSO to access 64bit kernel data.
96#
97# Build x32 vDSO image:
98# 1. Compile x32 vDSO as 64bit.
99# 2. Convert object files to x32.
100# 3. Build x32 VDSO image with x32 objects, which contains 64bit codes

--- 112 unchanged lines hidden ---
98
99#
100# X32 processes use x32 vDSO to access 64bit kernel data.
101#
102# Build x32 vDSO image:
103# 1. Compile x32 vDSO as 64bit.
104# 2. Convert object files to x32.
105# 3. Build x32 VDSO image with x32 objects, which contains 64bit codes

--- 112 unchanged lines hidden ---