~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/riscv/kernel/compat_vdso/Makefile

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  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 extension, but in the ISA
 15 # spec 20191213, G stands for IMAFD_ZICSR_ZIFENCEI.
 16 ifdef CONFIG_TOOLCHAIN_NEEDS_EXPLICIT_ZICSR_ZIFENCEI
 17         COMPAT_CC_FLAGS := -march=rv32g -mabi=ilp32
 18 else
 19         COMPAT_CC_FLAGS := -march=rv32imafd -mabi=ilp32
 20 endif
 21 COMPAT_LD_FLAGS := -melf32lriscv
 22 
 23 # Disable attributes, as they're useless and break the build.
 24 COMPAT_CC_FLAGS += $(call cc-option,-mno-riscv-attribute)
 25 COMPAT_CC_FLAGS += $(call as-option,-Wa$(comma)-mno-arch-attr)
 26 
 27 # Files to link into the compat_vdso
 28 obj-compat_vdso = $(patsubst %, %.o, $(compat_vdso-syms)) note.o
 29 
 30 # Build rules
 31 targets := $(obj-compat_vdso) compat_vdso.so compat_vdso.so.dbg compat_vdso.lds
 32 obj-compat_vdso := $(addprefix $(obj)/, $(obj-compat_vdso))
 33 
 34 obj-y += compat_vdso.o
 35 CPPFLAGS_compat_vdso.lds += -P -C -DCOMPAT_VDSO -U$(ARCH)
 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 first
 41 $(obj)/compat_vdso.so.dbg: $(obj)/compat_vdso.lds $(obj-compat_vdso) FORCE
 42         $(call if_changed,compat_vdsold)
 43 LDFLAGS_compat_vdso.so.dbg = -shared -S -soname=linux-compat_vdso.so.1 \
 44         --build-id=sha1 --hash-style=both --eh-frame-hdr
 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_offsets.sh
 56 quiet_cmd_compat_vdsosym = VDSOSYM $@
 57         cmd_compat_vdsosym = $(NM) $< | $(gen-compat_vdsosym) | LC_ALL=C sort > $@
 58 
 59 include/generated/compat_vdso-offsets.h: $(obj)/compat_vdso.so.dbg FORCE
 60         $(call if_changed,compat_vdsosym)
 61 
 62 # actual build commands
 63 # The DSO images are built using a special linker script
 64 # Make sure only to export the intended __compat_vdso_xxx symbol offsets.
 65 quiet_cmd_compat_vdsold = VDSOLD  $@
 66       cmd_compat_vdsold = $(COMPAT_LD) $(ld_flags) $(COMPAT_LD_FLAGS) -T $(filter-out FORCE,$^) -o $@.tmp && \
 67                    $(OBJCOPY) $(patsubst %, -G __compat_vdso_%, $(compat_vdso-syms)) $@.tmp $@ && \
 68                    rm $@.tmp
 69 
 70 # actual build commands
 71 quiet_cmd_compat_vdsoas = VDSOAS  $@
 72       cmd_compat_vdsoas = $(COMPAT_CC) $(a_flags) $(COMPAT_CC_FLAGS) -c -o $@ $<

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php