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