Merge tag 'sched-urgent-2020-12-27' of git://git.kernel.org/pub/scm/linux/kernel...
[linux/fpc-iii.git] / arch / powerpc / kernel / vdso32 / Makefile
blob9cb6f524854b9d6f480e32f3cf346fe7d7a57071
1 # SPDX-License-Identifier: GPL-2.0
3 # List of files in the vdso, has to be asm only for now
5 ARCH_REL_TYPE_ABS := R_PPC_JUMP_SLOT|R_PPC_GLOB_DAT|R_PPC_ADDR32|R_PPC_ADDR24|R_PPC_ADDR16|R_PPC_ADDR16_LO|R_PPC_ADDR16_HI|R_PPC_ADDR16_HA|R_PPC_ADDR14|R_PPC_ADDR14_BRTAKEN|R_PPC_ADDR14_BRNTAKEN|R_PPC_REL24
6 include $(srctree)/lib/vdso/Makefile
8 obj-vdso32 = sigtramp.o gettimeofday.o datapage.o cacheflush.o note.o getcpu.o
10 ifneq ($(c-gettimeofday-y),)
11 CFLAGS_vgettimeofday.o += -include $(c-gettimeofday-y)
12 CFLAGS_vgettimeofday.o += $(DISABLE_LATENT_ENTROPY_PLUGIN)
13 CFLAGS_vgettimeofday.o += $(call cc-option, -fno-stack-protector)
14 CFLAGS_vgettimeofday.o += -DDISABLE_BRANCH_PROFILING
15 CFLAGS_vgettimeofday.o += -ffreestanding -fasynchronous-unwind-tables
16 CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE)
17 endif
19 # Build rules
21 ifdef CROSS32_COMPILE
22 VDSOCC := $(CROSS32_COMPILE)gcc
23 else
24 VDSOCC := $(CC)
25 endif
27 CC32FLAGS :=
28 ifdef CONFIG_PPC64
29 CC32FLAGS += -m32
30 KBUILD_CFLAGS := $(filter-out -mcmodel=medium -mabi=elfv1 -mabi=elfv2 -mcall-aixdesc,$(KBUILD_CFLAGS))
31 endif
33 targets := $(obj-vdso32) vdso32.so.dbg
34 obj-vdso32 := $(addprefix $(obj)/, $(obj-vdso32))
36 GCOV_PROFILE := n
37 KCOV_INSTRUMENT := n
38 UBSAN_SANITIZE := n
39 KASAN_SANITIZE := n
41 ccflags-y := -shared -fno-common -fno-builtin -nostdlib \
42 -Wl,-soname=linux-vdso32.so.1 -Wl,--hash-style=both
43 asflags-y := -D__VDSO32__ -s
45 obj-y += vdso32_wrapper.o
46 targets += vdso32.lds
47 CPPFLAGS_vdso32.lds += -P -C -Upowerpc
49 # Force dependency (incbin is bad)
50 $(obj)/vdso32_wrapper.o : $(obj)/vdso32.so.dbg
52 # link rule for the .so file, .lds has to be first
53 $(obj)/vdso32.so.dbg: $(src)/vdso32.lds $(obj-vdso32) $(obj)/vgettimeofday.o FORCE
54 $(call if_changed,vdso32ld_and_check)
56 # assembly rules for the .S files
57 $(obj-vdso32): %.o: %.S FORCE
58 $(call if_changed_dep,vdso32as)
59 $(obj)/vgettimeofday.o: %.o: %.c FORCE
60 $(call if_changed_dep,vdso32cc)
62 # Generate VDSO offsets using helper script
63 gen-vdsosym := $(srctree)/$(src)/gen_vdso_offsets.sh
64 quiet_cmd_vdsosym = VDSOSYM $@
65 cmd_vdsosym = $(NM) $< | $(gen-vdsosym) | LC_ALL=C sort > $@
67 include/generated/vdso32-offsets.h: $(obj)/vdso32.so.dbg FORCE
68 $(call if_changed,vdsosym)
70 # actual build commands
71 quiet_cmd_vdso32ld_and_check = VDSO32L $@
72 cmd_vdso32ld_and_check = $(VDSOCC) $(c_flags) $(CC32FLAGS) -o $@ -Wl,-T$(filter %.lds,$^) $(filter %.o,$^) ; $(cmd_vdso_check)
73 quiet_cmd_vdso32as = VDSO32A $@
74 cmd_vdso32as = $(VDSOCC) $(a_flags) $(CC32FLAGS) -c -o $@ $<
75 quiet_cmd_vdso32cc = VDSO32C $@
76 cmd_vdso32cc = $(VDSOCC) $(c_flags) $(CC32FLAGS) -c -o $@ $<