xref: /openbmc/linux/arch/parisc/kernel/vdso64/Makefile (revision e021ae7f)
1# List of files in the vdso, has to be asm only for now
2
3obj-vdso64 = note.o sigtramp.o restart_syscall.o
4
5# Build rules
6
7targets := $(obj-vdso64) vdso64.so
8obj-vdso64 := $(addprefix $(obj)/, $(obj-vdso64))
9
10
11ccflags-y := -shared -fno-common -fno-builtin
12ccflags-y += -nostdlib -Wl,-soname=linux-vdso64.so.1 \
13		$(call ld-option, -Wl$(comma)--hash-style=sysv)
14asflags-y := -D__VDSO64__ -s
15
16KBUILD_AFLAGS += -DBUILD_VDSO
17KBUILD_CFLAGS += -DBUILD_VDSO -DDISABLE_BRANCH_PROFILING
18
19VDSO_LIBGCC := $(shell $(CC) -print-libgcc-file-name)
20
21obj-y += vdso64_wrapper.o
22extra-y += vdso64.lds
23CPPFLAGS_vdso64.lds += -P -C -U$(ARCH)
24
25$(obj)/vdso64_wrapper.o : $(obj)/vdso64.so FORCE
26
27# Force dependency (incbin is bad)
28# link rule for the .so file, .lds has to be first
29$(obj)/vdso64.so: $(src)/vdso64.lds $(obj-vdso64) $(VDSO_LIBGCC) FORCE
30	$(call if_changed,vdso64ld)
31
32# assembly rules for the .S files
33$(obj-vdso64): %.o: %.S FORCE
34	$(call if_changed_dep,vdso64as)
35
36# actual build commands
37quiet_cmd_vdso64ld = VDSO64L $@
38      cmd_vdso64ld = $(CC) $(c_flags) -Wl,-T $(filter-out FORCE, $^) -o $@
39quiet_cmd_vdso64as = VDSO64A $@
40      cmd_vdso64as = $(CC) $(a_flags) -c -o $@ $<
41
42# Generate VDSO offsets using helper script
43gen-vdsosym := $(srctree)/$(src)/gen_vdso_offsets.sh
44quiet_cmd_vdsosym = VDSOSYM $@
45	cmd_vdsosym = $(NM) $< | $(gen-vdsosym) | LC_ALL=C sort > $@
46
47include/generated/vdso64-offsets.h: $(obj)/vdso64.so FORCE
48	$(call if_changed,vdsosym)
49