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