blob: c710802b8fb685a7cb5815d86387f7debb356d9e [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
Anton Blanchard18ad51d2012-07-04 20:37:11 +00003obj-vdso64 = sigtramp.o gettimeofday.o datapage.o cacheflush.o note.o getcpu.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
Daniel Axtensbf76f732016-01-20 15:00:58 -080011UBSAN_SANITIZE := n
Michael Ellermana15098c2009-08-09 19:02:51 +000012
matt mooney4108d9b2010-09-22 20:51:09 +000013ccflags-y := -shared -fno-common -fno-builtin
14ccflags-y += -nostdlib -Wl,-soname=linux-vdso64.so.1 \
Michael Ellerman787b3932015-08-07 13:05:42 +100015 $(call cc-ldoption, -Wl$(comma)--hash-style=both)
matt mooney4108d9b2010-09-22 20:51:09 +000016asflags-y := -D__VDSO64__ -s
Linus Torvalds1da177e2005-04-16 15:20:36 -070017
18obj-y += vdso64_wrapper.o
19extra-y += vdso64.lds
20CPPFLAGS_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
Roland McGrath8150caa2007-10-02 13:30:04 -070026$(obj)/vdso64.so.dbg: $(src)/vdso64.lds $(obj-vdso64)
Linus Torvalds1da177e2005-04-16 15:20:36 -070027 $(call if_changed,vdso64ld)
28
Roland McGrath8150caa2007-10-02 13:30:04 -070029# strip rule for the .so file
30$(obj)/%.so: OBJCOPYFLAGS := -S
31$(obj)/%.so: $(obj)/%.so.dbg FORCE
32 $(call if_changed,objcopy)
33
Linus Torvalds1da177e2005-04-16 15:20:36 -070034# assembly rules for the .S files
35$(obj-vdso64): %.o: %.S
36 $(call if_changed_dep,vdso64as)
37
38# actual build commands
39quiet_cmd_vdso64ld = VDSO64L $@
40 cmd_vdso64ld = $(CC) $(c_flags) -Wl,-T $^ -o $@
41quiet_cmd_vdso64as = VDSO64A $@
42 cmd_vdso64as = $(CC) $(a_flags) -c -o $@ $<
43
Roland McGrath8150caa2007-10-02 13:30:04 -070044# install commands for the unstripped file
45quiet_cmd_vdso_install = INSTALL $@
46 cmd_vdso_install = cp $(obj)/$@.dbg $(MODLIB)/vdso/$@
Linus Torvalds1da177e2005-04-16 15:20:36 -070047
Roland McGrath8150caa2007-10-02 13:30:04 -070048vdso64.so: $(obj)/vdso64.so.dbg
49 @mkdir -p $(MODLIB)/vdso
50 $(call cmd,vdso_install)
51
52vdso_install: vdso64.so