Makefile 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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
  3. # Build rules
  4. targets := $(obj-vdso64) vdso64.so vdso64.so.dbg
  5. obj-vdso64 := $(addprefix $(obj)/, $(obj-vdso64))
  6. GCOV_PROFILE := n
  7. EXTRA_CFLAGS := -shared -fno-common -fno-builtin
  8. EXTRA_CFLAGS += -nostdlib -Wl,-soname=linux-vdso64.so.1 \
  9. $(call cc-ldoption, -Wl$(comma)--hash-style=sysv)
  10. EXTRA_AFLAGS := -D__VDSO64__ -s
  11. obj-y += vdso64_wrapper.o
  12. extra-y += vdso64.lds
  13. CPPFLAGS_vdso64.lds += -P -C -U$(ARCH)
  14. # Force dependency (incbin is bad)
  15. $(obj)/vdso64_wrapper.o : $(obj)/vdso64.so
  16. # link rule for the .so file, .lds has to be first
  17. $(obj)/vdso64.so.dbg: $(src)/vdso64.lds $(obj-vdso64)
  18. $(call if_changed,vdso64ld)
  19. # strip rule for the .so file
  20. $(obj)/%.so: OBJCOPYFLAGS := -S
  21. $(obj)/%.so: $(obj)/%.so.dbg FORCE
  22. $(call if_changed,objcopy)
  23. # assembly rules for the .S files
  24. $(obj-vdso64): %.o: %.S
  25. $(call if_changed_dep,vdso64as)
  26. # actual build commands
  27. quiet_cmd_vdso64ld = VDSO64L $@
  28. cmd_vdso64ld = $(CC) $(c_flags) -Wl,-T $^ -o $@
  29. quiet_cmd_vdso64as = VDSO64A $@
  30. cmd_vdso64as = $(CC) $(a_flags) -c -o $@ $<
  31. # install commands for the unstripped file
  32. quiet_cmd_vdso_install = INSTALL $@
  33. cmd_vdso_install = cp $(obj)/$@.dbg $(MODLIB)/vdso/$@
  34. vdso64.so: $(obj)/vdso64.so.dbg
  35. @mkdir -p $(MODLIB)/vdso
  36. $(call cmd,vdso_install)
  37. vdso_install: vdso64.so