Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | |
| 2 | # List of files in the vdso, has to be asm only for now |
| 3 | |
Anton Blanchard | 18ad51d | 2012-07-04 20:37:11 +0000 | [diff] [blame] | 4 | obj-vdso32-$(CONFIG_PPC64) = getcpu.o |
| 5 | obj-vdso32 = sigtramp.o gettimeofday.o datapage.o cacheflush.o note.o \ |
| 6 | $(obj-vdso32-y) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 7 | |
| 8 | # Build rules |
| 9 | |
Benjamin Herrenschmidt | a7f290d | 2005-11-11 21:15:21 +1100 | [diff] [blame] | 10 | ifeq ($(CONFIG_PPC32),y) |
| 11 | CROSS32CC := $(CC) |
| 12 | endif |
| 13 | |
Roland McGrath | 8150caa | 2007-10-02 13:30:04 -0700 | [diff] [blame] | 14 | targets := $(obj-vdso32) vdso32.so vdso32.so.dbg |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 | obj-vdso32 := $(addprefix $(obj)/, $(obj-vdso32)) |
| 16 | |
Michael Ellerman | a15098c | 2009-08-09 19:02:51 +0000 | [diff] [blame] | 17 | GCOV_PROFILE := n |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 18 | |
matt mooney | 4108d9b | 2010-09-22 20:51:09 +0000 | [diff] [blame] | 19 | ccflags-y := -shared -fno-common -fno-builtin |
| 20 | ccflags-y += -nostdlib -Wl,-soname=linux-vdso32.so.1 \ |
Sam Ravnborg | f86fd30 | 2009-09-19 10:14:33 +0200 | [diff] [blame] | 21 | $(call cc-ldoption, -Wl$(comma)--hash-style=sysv) |
matt mooney | 4108d9b | 2010-09-22 20:51:09 +0000 | [diff] [blame] | 22 | asflags-y := -D__VDSO32__ -s |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 23 | |
| 24 | obj-y += vdso32_wrapper.o |
| 25 | extra-y += vdso32.lds |
Paul Mackerras | 271c3f3 | 2005-11-11 23:04:40 +1100 | [diff] [blame] | 26 | CPPFLAGS_vdso32.lds += -P -C -Upowerpc |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 27 | |
| 28 | # Force dependency (incbin is bad) |
| 29 | $(obj)/vdso32_wrapper.o : $(obj)/vdso32.so |
| 30 | |
| 31 | # link rule for the .so file, .lds has to be first |
Roland McGrath | 8150caa | 2007-10-02 13:30:04 -0700 | [diff] [blame] | 32 | $(obj)/vdso32.so.dbg: $(src)/vdso32.lds $(obj-vdso32) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 33 | $(call if_changed,vdso32ld) |
| 34 | |
Roland McGrath | 8150caa | 2007-10-02 13:30:04 -0700 | [diff] [blame] | 35 | # strip rule for the .so file |
| 36 | $(obj)/%.so: OBJCOPYFLAGS := -S |
| 37 | $(obj)/%.so: $(obj)/%.so.dbg FORCE |
| 38 | $(call if_changed,objcopy) |
| 39 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 40 | # assembly rules for the .S files |
| 41 | $(obj-vdso32): %.o: %.S |
| 42 | $(call if_changed_dep,vdso32as) |
| 43 | |
| 44 | # actual build commands |
| 45 | quiet_cmd_vdso32ld = VDSO32L $@ |
| 46 | cmd_vdso32ld = $(CROSS32CC) $(c_flags) -Wl,-T $^ -o $@ |
| 47 | quiet_cmd_vdso32as = VDSO32A $@ |
| 48 | cmd_vdso32as = $(CROSS32CC) $(a_flags) -c -o $@ $< |
| 49 | |
Roland McGrath | 8150caa | 2007-10-02 13:30:04 -0700 | [diff] [blame] | 50 | # install commands for the unstripped file |
| 51 | quiet_cmd_vdso_install = INSTALL $@ |
| 52 | cmd_vdso_install = cp $(obj)/$@.dbg $(MODLIB)/vdso/$@ |
| 53 | |
| 54 | vdso32.so: $(obj)/vdso32.so.dbg |
| 55 | @mkdir -p $(MODLIB)/vdso |
| 56 | $(call cmd,vdso_install) |
| 57 | |
| 58 | vdso_install: vdso32.so |