Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[cris-mirror.git] / arch / powerpc / kernel / vdso32 / Makefile
blobb8c434d1d45917aa3900d9fc89156d2f44781a36
1 # SPDX-License-Identifier: GPL-2.0
3 # List of files in the vdso, has to be asm only for now
5 obj-vdso32-$(CONFIG_PPC64) = getcpu.o
6 obj-vdso32 = sigtramp.o gettimeofday.o datapage.o cacheflush.o note.o \
7 $(obj-vdso32-y)
9 # Build rules
11 ifeq ($(CONFIG_PPC32),y)
12 CROSS32CC := $(CC)
13 endif
15 targets := $(obj-vdso32) vdso32.so vdso32.so.dbg
16 obj-vdso32 := $(addprefix $(obj)/, $(obj-vdso32))
18 GCOV_PROFILE := n
19 UBSAN_SANITIZE := n
21 ccflags-y := -shared -fno-common -fno-builtin
22 ccflags-y += -nostdlib -Wl,-soname=linux-vdso32.so.1 \
23 $(call cc-ldoption, -Wl$(comma)--hash-style=both)
24 asflags-y := -D__VDSO32__ -s
26 obj-y += vdso32_wrapper.o
27 extra-y += vdso32.lds
28 CPPFLAGS_vdso32.lds += -P -C -Upowerpc
30 # Force dependency (incbin is bad)
31 $(obj)/vdso32_wrapper.o : $(obj)/vdso32.so
33 # link rule for the .so file, .lds has to be first
34 $(obj)/vdso32.so.dbg: $(src)/vdso32.lds $(obj-vdso32) FORCE
35 $(call if_changed,vdso32ld)
37 # strip rule for the .so file
38 $(obj)/%.so: OBJCOPYFLAGS := -S
39 $(obj)/%.so: $(obj)/%.so.dbg FORCE
40 $(call if_changed,objcopy)
42 # assembly rules for the .S files
43 $(obj-vdso32): %.o: %.S FORCE
44 $(call if_changed_dep,vdso32as)
46 # actual build commands
47 quiet_cmd_vdso32ld = VDSO32L $@
48 cmd_vdso32ld = $(CROSS32CC) $(c_flags) -o $@ -Wl,-T$(filter %.lds,$^) $(filter %.o,$^)
49 quiet_cmd_vdso32as = VDSO32A $@
50 cmd_vdso32as = $(CROSS32CC) $(a_flags) -c -o $@ $<
52 # install commands for the unstripped file
53 quiet_cmd_vdso_install = INSTALL $@
54 cmd_vdso_install = cp $(obj)/$@.dbg $(MODLIB)/vdso/$@
56 vdso32.so: $(obj)/vdso32.so.dbg
57 @mkdir -p $(MODLIB)/vdso
58 $(call cmd,vdso_install)
60 vdso_install: vdso32.so