• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# SPDX-License-Identifier: GPL-2.0
2
3# List of files in the vdso, has to be asm only for now
4
5obj-vdso32-$(CONFIG_PPC64) = getcpu.o
6obj-vdso32 = sigtramp.o gettimeofday.o datapage.o cacheflush.o note.o \
7		$(obj-vdso32-y)
8
9# Build rules
10
11ifeq ($(CONFIG_PPC32),y)
12CROSS32CC := $(CC)
13endif
14
15targets := $(obj-vdso32) vdso32.so vdso32.so.dbg
16obj-vdso32 := $(addprefix $(obj)/, $(obj-vdso32))
17
18GCOV_PROFILE := n
19UBSAN_SANITIZE := n
20
21ccflags-y := -shared -fno-common -fno-builtin
22ccflags-y += -nostdlib -Wl,-soname=linux-vdso32.so.1 \
23		$(call cc-ldoption, -Wl$(comma)--hash-style=both)
24asflags-y := -D__VDSO32__ -s
25
26obj-y += vdso32_wrapper.o
27extra-y += vdso32.lds
28CPPFLAGS_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
47quiet_cmd_vdso32ld = VDSO32L $@
48      cmd_vdso32ld = $(CROSS32CC) $(c_flags) -o $@ -Wl,-T$(filter %.lds,$^) $(filter %.o,$^)
49quiet_cmd_vdso32as = VDSO32A $@
50      cmd_vdso32as = $(CROSS32CC) $(a_flags) -c -o $@ $<
51
52# 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
61