1 # SPDX-License-Identifier: GPL-2.0-only 2 # 3 # Makefile for compat_vdso 4 # 5 6 # Symbols present in the compat_vdso 7 compat_vdso-syms = rt_sigreturn 8 compat_vdso-syms += getcpu 9 compat_vdso-syms += flush_icache 10 11 COMPAT_CC := $(CC) 12 COMPAT_LD := $(LD) 13 14 # binutils 2.35 does not support the zifencei 15 # spec 20191213, G stands for IMAFD_ZICSR_ZIFE 16 ifdef CONFIG_TOOLCHAIN_NEEDS_EXPLICIT_ZICSR_ZI 17 COMPAT_CC_FLAGS := -march=rv32g -mabi= 18 else 19 COMPAT_CC_FLAGS := -march=rv32imafd -m 20 endif 21 COMPAT_LD_FLAGS := -melf32lriscv 22 23 # Disable attributes, as they're useless and b 24 COMPAT_CC_FLAGS += $(call cc-option,-mno-riscv 25 COMPAT_CC_FLAGS += $(call as-option,-Wa$(comma 26 27 # Files to link into the compat_vdso 28 obj-compat_vdso = $(patsubst %, %.o, $(compat_ 29 30 # Build rules 31 targets := $(obj-compat_vdso) compat_vdso.so c 32 obj-compat_vdso := $(addprefix $(obj)/, $(obj- 33 34 obj-y += compat_vdso.o 35 CPPFLAGS_compat_vdso.lds += -P -C -DCOMPAT_VDS 36 37 # Force dependency 38 $(obj)/compat_vdso.o: $(obj)/compat_vdso.so 39 40 # link rule for the .so file, .lds has to be f 41 $(obj)/compat_vdso.so.dbg: $(obj)/compat_vdso. 42 $(call if_changed,compat_vdsold) 43 LDFLAGS_compat_vdso.so.dbg = -shared -S -sonam 44 --build-id=sha1 --hash-style=both --eh 45 46 $(obj-compat_vdso): %.o: %.S FORCE 47 $(call if_changed_dep,compat_vdsoas) 48 49 # strip rule for the .so file 50 $(obj)/%.so: OBJCOPYFLAGS := -S 51 $(obj)/%.so: $(obj)/%.so.dbg FORCE 52 $(call if_changed,objcopy) 53 54 # Generate VDSO offsets using helper script 55 gen-compat_vdsosym := $(src)/gen_compat_vdso_o 56 quiet_cmd_compat_vdsosym = VDSOSYM $@ 57 cmd_compat_vdsosym = $(NM) $< | $(gen- 58 59 include/generated/compat_vdso-offsets.h: $(obj 60 $(call if_changed,compat_vdsosym) 61 62 # actual build commands 63 # The DSO images are built using a special lin 64 # Make sure only to export the intended __comp 65 quiet_cmd_compat_vdsold = VDSOLD $@ 66 cmd_compat_vdsold = $(COMPAT_LD) $(ld_fl 67 $(OBJCOPY) $(patsubst %, -G 68 rm $@.tmp 69 70 # actual build commands 71 quiet_cmd_compat_vdsoas = VDSOAS $@ 72 cmd_compat_vdsoas = $(COMPAT_CC) $(a_fla
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.