Makefile 1.3 KB

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