1 # Include the generic Makefile to check the built vdso. 2 include $(srctree)/lib/vdso/Makefile 3 4 KCOV_INSTRUMENT := n 5 6 # Disable gcov profiling, ubsan and kasan for VDSO code 7 GCOV_PROFILE := n 8 UBSAN_SANITIZE := n 9 KASAN_SANITIZE := n 10 KCSAN_SANITIZE := n 11 12 obj-vdso64 = note.o sigtramp.o restart_syscall.o 13 obj-cvdso64 = vdso64_generic.o 14 15 # Build rules 16 17 targets := $(obj-vdso64) $(obj-cvdso64) vdso64.so 18 obj-vdso64 := $(addprefix $(obj)/, $(obj-vdso64)) 19 obj-cvdso64 := $(addprefix $(obj)/, $(obj-cvdso64)) 20 21 VDSO_CFLAGS_REMOVE := -pg $(CC_FLAGS_FTRACE) 22 CFLAGS_REMOVE_vdso64_generic.o = $(VDSO_CFLAGS_REMOVE) 23 24 ccflags-y := -shared -fno-common -fno-builtin 25 ccflags-y += -nostdlib -Wl,-soname=linux-vdso64.so.1 \ 26 $(call ld-option, -Wl$(comma)--hash-style=sysv) 27 asflags-y := -D__VDSO64__ -s 28 29 KBUILD_AFLAGS += -DBUILD_VDSO 30 KBUILD_CFLAGS += -DBUILD_VDSO -DDISABLE_BRANCH_PROFILING 31 32 VDSO_LIBGCC := $(shell $(CC) -print-libgcc-file-name) 33 34 obj-y += vdso64_wrapper.o 35 extra-y += vdso64.lds 36 CPPFLAGS_vdso64.lds += -P -C -U$(ARCH) 37 38 $(obj)/vdso64_wrapper.o : $(obj)/vdso64.so FORCE 39 40 # Force dependency (incbin is bad) 41 # link rule for the .so file, .lds has to be first 42 $(obj)/vdso64.so: $(obj)/vdso64.lds $(obj-vdso64) $(obj-cvdso64) $(VDSO_LIBGCC) FORCE 43 $(call if_changed,vdso64ld) 44 45 # assembly rules for the .S files 46 $(obj-vdso64): %.o: %.S FORCE 47 $(call if_changed_dep,vdso64as) 48 $(obj-cvdso64): %.o: %.c FORCE 49 $(call if_changed_dep,vdso64cc) 50 51 # actual build commands 52 quiet_cmd_vdso64ld = VDSO64L $@ 53 cmd_vdso64ld = $(CC) $(c_flags) -Wl,-T $(filter-out FORCE, $^) -o $@ 54 quiet_cmd_vdso64as = VDSO64A $@ 55 cmd_vdso64as = $(CC) $(a_flags) -c -o $@ $< 56 quiet_cmd_vdso64cc = VDSO64C $@ 57 cmd_vdso64cc = $(CC) $(c_flags) -c -o $@ $< 58 59 # Generate VDSO offsets using helper script 60 gen-vdsosym := $(src)/gen_vdso_offsets.sh 61 quiet_cmd_vdsosym = VDSOSYM $@ 62 cmd_vdsosym = $(NM) $< | $(gen-vdsosym) | LC_ALL=C sort > $@ 63 64 include/generated/vdso64-offsets.h: $(obj)/vdso64.so FORCE 65 $(call if_changed,vdsosym)
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.