Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | # List of files in the vdso, has to be asm only for now |
| 2 | |
Anton Blanchard | 18ad51d | 2012-07-04 20:37:11 +0000 | [diff] [blame] | 3 | obj-vdso64 = sigtramp.o gettimeofday.o datapage.o cacheflush.o note.o getcpu.o |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 4 | |
| 5 | # Build rules |
| 6 | |
Roland McGrath | 8150caa | 2007-10-02 13:30:04 -0700 | [diff] [blame] | 7 | targets := $(obj-vdso64) vdso64.so vdso64.so.dbg |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8 | obj-vdso64 := $(addprefix $(obj)/, $(obj-vdso64)) |
| 9 | |
Michael Ellerman | a15098c | 2009-08-09 19:02:51 +0000 | [diff] [blame] | 10 | GCOV_PROFILE := n |
Daniel Axtens | bf76f73 | 2016-01-20 15:00:58 -0800 | [diff] [blame] | 11 | UBSAN_SANITIZE := n |
Michael Ellerman | a15098c | 2009-08-09 19:02:51 +0000 | [diff] [blame] | 12 | |
matt mooney | 4108d9b | 2010-09-22 20:51:09 +0000 | [diff] [blame] | 13 | ccflags-y := -shared -fno-common -fno-builtin |
| 14 | ccflags-y += -nostdlib -Wl,-soname=linux-vdso64.so.1 \ |
Michael Ellerman | 787b393 | 2015-08-07 13:05:42 +1000 | [diff] [blame] | 15 | $(call cc-ldoption, -Wl$(comma)--hash-style=both) |
matt mooney | 4108d9b | 2010-09-22 20:51:09 +0000 | [diff] [blame] | 16 | asflags-y := -D__VDSO64__ -s |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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 |
Roland McGrath | 8150caa | 2007-10-02 13:30:04 -0700 | [diff] [blame] | 26 | $(obj)/vdso64.so.dbg: $(src)/vdso64.lds $(obj-vdso64) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 27 | $(call if_changed,vdso64ld) |
| 28 | |
Roland McGrath | 8150caa | 2007-10-02 13:30:04 -0700 | [diff] [blame] | 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 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 34 | # assembly rules for the .S files |
| 35 | $(obj-vdso64): %.o: %.S |
| 36 | $(call if_changed_dep,vdso64as) |
| 37 | |
| 38 | # actual build commands |
| 39 | quiet_cmd_vdso64ld = VDSO64L $@ |
| 40 | cmd_vdso64ld = $(CC) $(c_flags) -Wl,-T $^ -o $@ |
| 41 | quiet_cmd_vdso64as = VDSO64A $@ |
| 42 | cmd_vdso64as = $(CC) $(a_flags) -c -o $@ $< |
| 43 | |
Roland McGrath | 8150caa | 2007-10-02 13:30:04 -0700 | [diff] [blame] | 44 | # install commands for the unstripped file |
| 45 | quiet_cmd_vdso_install = INSTALL $@ |
| 46 | cmd_vdso_install = cp $(obj)/$@.dbg $(MODLIB)/vdso/$@ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 47 | |
Roland McGrath | 8150caa | 2007-10-02 13:30:04 -0700 | [diff] [blame] | 48 | vdso64.so: $(obj)/vdso64.so.dbg |
| 49 | @mkdir -p $(MODLIB)/vdso |
| 50 | $(call cmd,vdso_install) |
| 51 | |
| 52 | vdso_install: vdso64.so |