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