linux/arch/nds32/kernel/vdso/Makefile
<<
>>
Prefs
   1# SPDX-License-Identifier: GPL-2.0-only
   2#
   3# Building a vDSO image for AArch64.
   4#
   5# Author: Will Deacon <will.deacon@arm.com>
   6# Heavily based on the vDSO Makefiles for other archs.
   7#
   8
   9obj-vdso := note.o datapage.o sigreturn.o gettimeofday.o
  10
  11# Build rules
  12targets := $(obj-vdso) vdso.so vdso.so.dbg
  13obj-vdso := $(addprefix $(obj)/, $(obj-vdso))
  14
  15ccflags-y := -shared -fno-common -fno-builtin -nostdlib -fPIC -Wl,-shared -g \
  16        -Wl,-soname=linux-vdso.so.1 -Wl,--hash-style=sysv
  17
  18# Disable gcov profiling for VDSO code
  19GCOV_PROFILE := n
  20
  21
  22obj-y += vdso.o
  23extra-y += vdso.lds
  24CPPFLAGS_vdso.lds += -P -C -U$(ARCH)
  25
  26# Force dependency
  27$(obj)/vdso.o : $(obj)/vdso.so
  28
  29# Link rule for the .so file, .lds has to be first
  30$(obj)/vdso.so.dbg: $(obj)/vdso.lds $(obj-vdso) FORCE
  31        $(call if_changed,vdsold)
  32
  33
  34# Strip rule for the .so file
  35$(obj)/%.so: OBJCOPYFLAGS := -S
  36$(obj)/%.so: $(obj)/%.so.dbg FORCE
  37        $(call if_changed,objcopy)
  38
  39# Generate VDSO offsets using helper script
  40gen-vdsosym := $(srctree)/$(src)/gen_vdso_offsets.sh
  41quiet_cmd_vdsosym = VDSOSYM $@
  42      cmd_vdsosym = $(NM) $< | $(gen-vdsosym) | LC_ALL=C sort > $@
  43
  44include/generated/vdso-offsets.h: $(obj)/vdso.so.dbg FORCE
  45        $(call if_changed,vdsosym)
  46
  47
  48
  49# Assembly rules for the .S files
  50
  51sigreturn.o : sigreturn.S
  52        $(call if_changed_dep,vdsoas)
  53
  54note.o : note.S
  55        $(call if_changed_dep,vdsoas)
  56
  57datapage.o : datapage.S
  58        $(call if_changed_dep,vdsoas)
  59
  60gettimeofday.o : gettimeofday.c FORCE
  61        $(call if_changed_dep,vdsocc)
  62
  63# Actual build commands
  64quiet_cmd_vdsold = VDSOL   $@
  65      cmd_vdsold = $(CC) $(c_flags) -Wl,-n -Wl,-T $(real-prereqs) -o $@
  66quiet_cmd_vdsoas = VDSOA   $@
  67      cmd_vdsoas = $(CC) $(a_flags) -c -o $@ $<
  68quiet_cmd_vdsocc = VDSOA   $@
  69      cmd_vdsocc = $(CC) $(c_flags) -c -o $@ $<
  70
  71# Install commands for the unstripped file
  72quiet_cmd_vdso_install = INSTALL $@
  73      cmd_vdso_install = cp $(obj)/$@.dbg $(MODLIB)/vdso/$@
  74
  75vdso.so: $(obj)/vdso.so.dbg
  76        @mkdir -p $(MODLIB)/vdso
  77        $(call cmd,vdso_install)
  78
  79vdso_install: vdso.so
  80