Makefile 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. # List of files in the vdso, has to be asm only for now
  2. obj-vdso32-$(CONFIG_PPC64) = getcpu.o
  3. obj-vdso32 = sigtramp.o gettimeofday.o datapage.o cacheflush.o note.o \
  4. $(obj-vdso32-y)
  5. # Build rules
  6. ifeq ($(CONFIG_PPC32),y)
  7. CROSS32CC := $(CC)
  8. endif
  9. targets := $(obj-vdso32) vdso32.so vdso32.so.dbg
  10. obj-vdso32 := $(addprefix $(obj)/, $(obj-vdso32))
  11. GCOV_PROFILE := n
  12. UBSAN_SANITIZE := n
  13. ccflags-y := -shared -fno-common -fno-builtin
  14. ccflags-y += -nostdlib -Wl,-soname=linux-vdso32.so.1 \
  15. $(call cc-ldoption, -Wl$(comma)--hash-style=both)
  16. asflags-y := -D__VDSO32__ -s
  17. obj-y += vdso32_wrapper.o
  18. extra-y += vdso32.lds
  19. CPPFLAGS_vdso32.lds += -P -C -Upowerpc
  20. # Force dependency (incbin is bad)
  21. $(obj)/vdso32_wrapper.o : $(obj)/vdso32.so
  22. # link rule for the .so file, .lds has to be first
  23. $(obj)/vdso32.so.dbg: $(src)/vdso32.lds $(obj-vdso32) FORCE
  24. $(call if_changed,vdso32ld)
  25. # strip rule for the .so file
  26. $(obj)/%.so: OBJCOPYFLAGS := -S
  27. $(obj)/%.so: $(obj)/%.so.dbg FORCE
  28. $(call if_changed,objcopy)
  29. # assembly rules for the .S files
  30. $(obj-vdso32): %.o: %.S FORCE
  31. $(call if_changed_dep,vdso32as)
  32. # actual build commands
  33. quiet_cmd_vdso32ld = VDSO32L $@
  34. cmd_vdso32ld = $(CROSS32CC) $(c_flags) -o $@ -Wl,-T$(filter %.lds,$^) $(filter %.o,$^)
  35. quiet_cmd_vdso32as = VDSO32A $@
  36. cmd_vdso32as = $(CROSS32CC) $(a_flags) -c -o $@ $<
  37. # install commands for the unstripped file
  38. quiet_cmd_vdso_install = INSTALL $@
  39. cmd_vdso_install = cp $(obj)/$@.dbg $(MODLIB)/vdso/$@
  40. vdso32.so: $(obj)/vdso32.so.dbg
  41. @mkdir -p $(MODLIB)/vdso
  42. $(call cmd,vdso_install)
  43. vdso_install: vdso32.so