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