/arch/arm64/kernel/vdso/Makefile

https://gitlab.com/pine64-android/linux-3.10 · Makefile · 63 lines · 35 code · 14 blank · 14 comment · 1 complexity · cca601c6299d3cfa6e408a25981ffabe MD5 · raw file

  1. #
  2. # Building a vDSO image for AArch64.
  3. #
  4. # Author: Will Deacon <will.deacon@arm.com>
  5. # Heavily based on the vDSO Makefiles for other archs.
  6. #
  7. obj-vdso := gettimeofday.o note.o sigreturn.o
  8. # Build rules
  9. targets := $(obj-vdso) vdso.so vdso.so.dbg
  10. obj-vdso := $(addprefix $(obj)/, $(obj-vdso))
  11. ccflags-y := -shared -fno-common -fno-builtin
  12. ccflags-y += -nostdlib -Wl,-soname=linux-vdso.so.1 \
  13. $(call cc-ldoption, -Wl$(comma)--hash-style=sysv)
  14. obj-y += vdso.o
  15. extra-y += vdso.lds vdso-offsets.h
  16. CPPFLAGS_vdso.lds += -P -C -U$(ARCH)
  17. # Force dependency (incbin is bad)
  18. $(obj)/vdso.o : $(obj)/vdso.so
  19. # Link rule for the .so file, .lds has to be first
  20. $(obj)/vdso.so.dbg: $(src)/vdso.lds $(obj-vdso)
  21. $(call if_changed,vdsold)
  22. # Strip rule for the .so file
  23. $(obj)/%.so: OBJCOPYFLAGS := -S
  24. $(obj)/%.so: $(obj)/%.so.dbg FORCE
  25. $(call if_changed,objcopy)
  26. # Generate VDSO offsets using helper script
  27. gen-vdsosym := $(srctree)/$(src)/gen_vdso_offsets.sh
  28. quiet_cmd_vdsosym = VDSOSYM $@
  29. define cmd_vdsosym
  30. $(NM) $< | $(gen-vdsosym) | LC_ALL=C sort > $@ && \
  31. cp $@ include/generated/
  32. endef
  33. $(obj)/vdso-offsets.h: $(obj)/vdso.so.dbg FORCE
  34. $(call if_changed,vdsosym)
  35. # Assembly rules for the .S files
  36. $(obj-vdso): %.o: %.S FORCE
  37. $(call if_changed_dep,vdsoas)
  38. # Actual build commands
  39. quiet_cmd_vdsold = VDSOL $@
  40. cmd_vdsold = $(CC) $(c_flags) -Wl,-n -Wl,-T $^ -o $@
  41. quiet_cmd_vdsoas = VDSOA $@
  42. cmd_vdsoas = $(CC) $(a_flags) -c -o $@ $<
  43. # Install commands for the unstripped file
  44. quiet_cmd_vdso_install = INSTALL $@
  45. cmd_vdso_install = cp $(obj)/$@.dbg $(MODLIB)/vdso/$@
  46. vdso.so: $(obj)/vdso.so.dbg
  47. @mkdir -p $(MODLIB)/vdso
  48. $(call cmd,vdso_install)
  49. vdso_install: vdso.so