blob: b8c434d1d45917aa3900d9fc89156d2f44781a36 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001# SPDX-License-Identifier: GPL-2.0
Linus Torvalds1da177e2005-04-16 15:20:36 -07002
3# List of files in the vdso, has to be asm only for now
4
Anton Blanchard18ad51d2012-07-04 20:37:11 +00005obj-vdso32-$(CONFIG_PPC64) = getcpu.o
6obj-vdso32 = sigtramp.o gettimeofday.o datapage.o cacheflush.o note.o \
7 $(obj-vdso32-y)
Linus Torvalds1da177e2005-04-16 15:20:36 -07008
9# Build rules
10
Benjamin Herrenschmidta7f290d2005-11-11 21:15:21 +110011ifeq ($(CONFIG_PPC32),y)
12CROSS32CC := $(CC)
13endif
14
Roland McGrath8150caa2007-10-02 13:30:04 -070015targets := $(obj-vdso32) vdso32.so vdso32.so.dbg
Linus Torvalds1da177e2005-04-16 15:20:36 -070016obj-vdso32 := $(addprefix $(obj)/, $(obj-vdso32))
17
Michael Ellermana15098c2009-08-09 19:02:51 +000018GCOV_PROFILE := n
Daniel Axtensbf76f732016-01-20 15:00:58 -080019UBSAN_SANITIZE := n
Linus Torvalds1da177e2005-04-16 15:20:36 -070020
matt mooney4108d9b2010-09-22 20:51:09 +000021ccflags-y := -shared -fno-common -fno-builtin
22ccflags-y += -nostdlib -Wl,-soname=linux-vdso32.so.1 \
Michael Ellerman787b3932015-08-07 13:05:42 +100023 $(call cc-ldoption, -Wl$(comma)--hash-style=both)
matt mooney4108d9b2010-09-22 20:51:09 +000024asflags-y := -D__VDSO32__ -s
Linus Torvalds1da177e2005-04-16 15:20:36 -070025
26obj-y += vdso32_wrapper.o
27extra-y += vdso32.lds
Paul Mackerras271c3f32005-11-11 23:04:40 +110028CPPFLAGS_vdso32.lds += -P -C -Upowerpc
Linus Torvalds1da177e2005-04-16 15:20:36 -070029
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 Pigginb9a4a0d2016-08-09 22:17:29 +100034$(obj)/vdso32.so.dbg: $(src)/vdso32.lds $(obj-vdso32) FORCE
Linus Torvalds1da177e2005-04-16 15:20:36 -070035 $(call if_changed,vdso32ld)
36
Roland McGrath8150caa2007-10-02 13:30:04 -070037# 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 Torvalds1da177e2005-04-16 15:20:36 -070042# assembly rules for the .S files
Nicholas Pigginb9a4a0d2016-08-09 22:17:29 +100043$(obj-vdso32): %.o: %.S FORCE
Linus Torvalds1da177e2005-04-16 15:20:36 -070044 $(call if_changed_dep,vdso32as)
45
46# actual build commands
47quiet_cmd_vdso32ld = VDSO32L $@
Nicholas Pigginb9a4a0d2016-08-09 22:17:29 +100048 cmd_vdso32ld = $(CROSS32CC) $(c_flags) -o $@ -Wl,-T$(filter %.lds,$^) $(filter %.o,$^)
Linus Torvalds1da177e2005-04-16 15:20:36 -070049quiet_cmd_vdso32as = VDSO32A $@
50 cmd_vdso32as = $(CROSS32CC) $(a_flags) -c -o $@ $<
51
Roland McGrath8150caa2007-10-02 13:30:04 -070052# install commands for the unstripped file
53quiet_cmd_vdso_install = INSTALL $@
54 cmd_vdso_install = cp $(obj)/$@.dbg $(MODLIB)/vdso/$@
55
56vdso32.so: $(obj)/vdso32.so.dbg
57 @mkdir -p $(MODLIB)/vdso
58 $(call cmd,vdso_install)
59
60vdso_install: vdso32.so