blob: 79da65d44a2a78a01bf11f2c0bb5b2003560ae6c [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001# List of files in the vdso, has to be asm only for now
2
Benjamin Herrenschmidt1b29f9d2005-05-01 08:58:43 -07003obj-vdso64 = sigtramp.o gettimeofday.o datapage.o cacheflush.o note.o
Linus Torvalds1da177e2005-04-16 15:20:36 -07004
5# Build rules
6
Roland McGrath8150caa2007-10-02 13:30:04 -07007targets := $(obj-vdso64) vdso64.so vdso64.so.dbg
Linus Torvalds1da177e2005-04-16 15:20:36 -07008obj-vdso64 := $(addprefix $(obj)/, $(obj-vdso64))
9
Michael Ellermana15098c2009-08-09 19:02:51 +000010GCOV_PROFILE := n
11
Roland McGrath8150caa2007-10-02 13:30:04 -070012EXTRA_CFLAGS := -shared -fno-common -fno-builtin
Roland McGrath0b0bf7a2006-07-30 03:04:06 -070013EXTRA_CFLAGS += -nostdlib -Wl,-soname=linux-vdso64.so.1 \
Sam Ravnborgf86fd302009-09-19 10:14:33 +020014 $(call cc-ldoption, -Wl$(comma)--hash-style=sysv)
Linus Torvalds1da177e2005-04-16 15:20:36 -070015EXTRA_AFLAGS := -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
Roland McGrath8150caa2007-10-02 13:30:04 -070025$(obj)/vdso64.so.dbg: $(src)/vdso64.lds $(obj-vdso64)
Linus Torvalds1da177e2005-04-16 15:20:36 -070026 $(call if_changed,vdso64ld)
27
Roland McGrath8150caa2007-10-02 13:30:04 -070028# strip rule for the .so file
29$(obj)/%.so: OBJCOPYFLAGS := -S
30$(obj)/%.so: $(obj)/%.so.dbg FORCE
31 $(call if_changed,objcopy)
32
Linus Torvalds1da177e2005-04-16 15:20:36 -070033# 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
Roland McGrath8150caa2007-10-02 13:30:04 -070043# install commands for the unstripped file
44quiet_cmd_vdso_install = INSTALL $@
45 cmd_vdso_install = cp $(obj)/$@.dbg $(MODLIB)/vdso/$@
Linus Torvalds1da177e2005-04-16 15:20:36 -070046
Roland McGrath8150caa2007-10-02 13:30:04 -070047vdso64.so: $(obj)/vdso64.so.dbg
48 @mkdir -p $(MODLIB)/vdso
49 $(call cmd,vdso_install)
50
51vdso_install: vdso64.so