GNU Linux-libre 4.14.303-gnu1
[releases.git] / arch / powerpc / kernel / vdso32 / Makefile
1 # SPDX-License-Identifier: GPL-2.0
2
3 # List of files in the vdso, has to be asm only for now
4
5 obj-vdso32-$(CONFIG_PPC64) = getcpu.o
6 obj-vdso32 = sigtramp.o gettimeofday.o datapage.o cacheflush.o note.o \
7                 $(obj-vdso32-y)
8
9 # Build rules
10
11 ifeq ($(CONFIG_PPC32),y)
12 CROSS32CC := $(CC)
13 endif
14
15 targets := $(obj-vdso32) vdso32.so vdso32.so.dbg
16 obj-vdso32 := $(addprefix $(obj)/, $(obj-vdso32))
17
18 GCOV_PROFILE := n
19 UBSAN_SANITIZE := n
20
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
25
26 obj-y += vdso32_wrapper.o
27 extra-y += vdso32.lds
28 CPPFLAGS_vdso32.lds += -P -C -Upowerpc
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
34 $(obj)/vdso32.so.dbg: $(src)/vdso32.lds $(obj-vdso32) FORCE
35         $(call if_changed,vdso32ld)
36
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
42 # assembly rules for the .S files
43 $(obj-vdso32): %.o: %.S FORCE
44         $(call if_changed_dep,vdso32as)
45
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 $@ $<
51
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