Makefile 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # SPDX-License-Identifier: GPL-2.0
  2. # List of files in the vdso, has to be asm only for now
  3. obj-vdso64 = sigtramp.o gettimeofday.o datapage.o cacheflush.o note.o getcpu.o
  4. # Build rules
  5. targets := $(obj-vdso64) vdso64.so vdso64.so.dbg
  6. obj-vdso64 := $(addprefix $(obj)/, $(obj-vdso64))
  7. GCOV_PROFILE := n
  8. UBSAN_SANITIZE := n
  9. ccflags-y := -shared -fno-common -fno-builtin
  10. ccflags-y += -nostdlib -Wl,-soname=linux-vdso64.so.1 \
  11. $(call cc-ldoption, -Wl$(comma)--hash-style=both)
  12. asflags-y := -D__VDSO64__ -s
  13. obj-y += vdso64_wrapper.o
  14. extra-y += vdso64.lds
  15. CPPFLAGS_vdso64.lds += -P -C -U$(ARCH)
  16. # Force dependency (incbin is bad)
  17. $(obj)/vdso64_wrapper.o : $(obj)/vdso64.so
  18. # link rule for the .so file, .lds has to be first
  19. $(obj)/vdso64.so.dbg: $(src)/vdso64.lds $(obj-vdso64) FORCE
  20. $(call if_changed,vdso64ld)
  21. # strip rule for the .so file
  22. $(obj)/%.so: OBJCOPYFLAGS := -S
  23. $(obj)/%.so: $(obj)/%.so.dbg FORCE
  24. $(call if_changed,objcopy)
  25. # actual build commands
  26. quiet_cmd_vdso64ld = VDSO64L $@
  27. cmd_vdso64ld = $(CC) $(c_flags) -o $@ -Wl,-T$(filter %.lds,$^) $(filter %.o,$^)
  28. # install commands for the unstripped file
  29. quiet_cmd_vdso_install = INSTALL $@
  30. cmd_vdso_install = cp $(obj)/$@.dbg $(MODLIB)/vdso/$@
  31. vdso64.so: $(obj)/vdso64.so.dbg
  32. @mkdir -p $(MODLIB)/vdso
  33. $(call cmd,vdso_install)
  34. vdso_install: vdso64.so