^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) # SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) # Makefile for vdso32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) # Absolute relocation type $(ARCH_REL_TYPE_ABS) needs to be defined before
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) # the inclusion of generic Makefile.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) ARCH_REL_TYPE_ABS := R_ARM_JUMP_SLOT|R_ARM_GLOB_DAT|R_ARM_ABS32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) include $(srctree)/lib/vdso/Makefile
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) # Same as cc-*option, but using CC_COMPAT instead of CC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) ifeq ($(CONFIG_CC_IS_CLANG), y)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) CC_COMPAT ?= $(CC)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) CC_COMPAT += --target=arm-linux-gnueabi
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) CC_COMPAT ?= $(CROSS_COMPILE_COMPAT)gcc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) ifeq ($(CONFIG_LD_IS_LLD), y)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) LD_COMPAT ?= $(LD)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) LD_COMPAT ?= $(CROSS_COMPILE_COMPAT)ld
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) cc32-option = $(call try-run,\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) $(CC_COMPAT) $(1) -c -x c /dev/null -o "$$TMP",$(1),$(2))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) cc32-disable-warning = $(call try-run,\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) $(CC_COMPAT) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1)))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) cc32-as-instr = $(call try-run,\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) printf "%b\n" "$(1)" | $(CC_COMPAT) $(VDSO_AFLAGS) -c -x assembler -o "$$TMP" -,$(2),$(3))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) # We cannot use the global flags to compile the vDSO files, the main reason
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) # being that the 32-bit compiler may be older than the main (64-bit) compiler
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) # and therefore may not understand flags set using $(cc-option ...). Besides,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) # arch-specific options should be taken from the arm Makefile instead of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) # arm64 one.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) # As a result we set our own flags here.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) # KBUILD_CPPFLAGS and NOSTDINC_FLAGS from top-level Makefile
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) VDSO_CPPFLAGS := -DBUILD_VDSO -D__KERNEL__ -nostdinc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) VDSO_CPPFLAGS += -isystem $(shell $(CC_COMPAT) -print-file-name=include 2>/dev/null)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) VDSO_CPPFLAGS += $(LINUXINCLUDE)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) # Common C and assembly flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) # From top-level Makefile
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) VDSO_CAFLAGS := $(VDSO_CPPFLAGS)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) VDSO_CAFLAGS += $(call cc32-option,-fno-PIE)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) ifdef CONFIG_DEBUG_INFO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) VDSO_CAFLAGS += -g
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) # From arm Makefile
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) VDSO_CAFLAGS += $(call cc32-option,-fno-dwarf2-cfi-asm)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) VDSO_CAFLAGS += -mabi=aapcs-linux -mfloat-abi=soft
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) ifeq ($(CONFIG_CPU_BIG_ENDIAN), y)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) VDSO_CAFLAGS += -mbig-endian
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) VDSO_CAFLAGS += -mlittle-endian
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) # From arm vDSO Makefile
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) VDSO_CAFLAGS += -fPIC -fno-builtin -fno-stack-protector
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) VDSO_CAFLAGS += -DDISABLE_BRANCH_PROFILING
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) # Try to compile for ARMv8. If the compiler is too old and doesn't support it,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) # fall back to v7. There is no easy way to check for what architecture the code
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) # is being compiled, so define a macro specifying that (see arch/arm/Makefile).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) VDSO_CAFLAGS += $(call cc32-option,-march=armv8-a -D__LINUX_ARM_ARCH__=8,\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) -march=armv7-a -D__LINUX_ARM_ARCH__=7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) VDSO_CFLAGS := $(VDSO_CAFLAGS)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) VDSO_CFLAGS += -DENABLE_COMPAT_VDSO=1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) # KBUILD_CFLAGS from top-level Makefile
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) VDSO_CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) -fno-strict-aliasing -fno-common \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) -Werror-implicit-function-declaration \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) -Wno-format-security \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) -std=gnu89
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) VDSO_CFLAGS += -O2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) # Some useful compiler-dependent flags from top-level Makefile
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) VDSO_CFLAGS += $(call cc32-option,-Wdeclaration-after-statement,)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) VDSO_CFLAGS += $(call cc32-option,-Wno-pointer-sign)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) VDSO_CFLAGS += -fno-strict-overflow
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) VDSO_CFLAGS += $(call cc32-option,-Werror=strict-prototypes)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) VDSO_CFLAGS += -Werror=date-time
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) VDSO_CFLAGS += $(call cc32-option,-Werror=incompatible-pointer-types)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) # The 32-bit compiler does not provide 128-bit integers, which are used in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) # some headers that are indirectly included from the vDSO code.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) # This hack makes the compiler happy and should trigger a warning/error if
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) # variables of such type are referenced.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) VDSO_CFLAGS += -D__uint128_t='void*'
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) # Silence some warnings coming from headers that operate on long's
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) # (on GCC 4.8 or older, there is unfortunately no way to silence this warning)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) VDSO_CFLAGS += $(call cc32-disable-warning,shift-count-overflow)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) VDSO_CFLAGS += -Wno-int-to-pointer-cast
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) # Compile as THUMB2 or ARM. Unwinding via frame-pointers in THUMB2 is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) # unreliable.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) ifeq ($(CONFIG_THUMB2_COMPAT_VDSO), y)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) VDSO_CFLAGS += -mthumb -fomit-frame-pointer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) VDSO_CFLAGS += -marm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) VDSO_AFLAGS := $(VDSO_CAFLAGS)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) VDSO_AFLAGS += -D__ASSEMBLY__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) # Check for binutils support for dmb ishld
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) dmbinstr := $(call cc32-as-instr,dmb ishld,-DCONFIG_AS_DMB_ISHLD=1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) VDSO_CFLAGS += $(dmbinstr)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) VDSO_AFLAGS += $(dmbinstr)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) # From arm vDSO Makefile
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) VDSO_LDFLAGS += -Bsymbolic --no-undefined -soname=linux-vdso.so.1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) VDSO_LDFLAGS += -z max-page-size=4096 -z common-page-size=4096
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) VDSO_LDFLAGS += -nostdlib -shared --hash-style=sysv --build-id=sha1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) # Borrow vdsomunge.c from the arm vDSO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) # We have to use a relative path because scripts/Makefile.host prefixes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) # $(hostprogs) with $(obj)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) munge := ../../../arm/vdso/vdsomunge
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) hostprogs := $(munge)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) c-obj-vdso := note.o
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) c-obj-vdso-gettimeofday := vgettimeofday.o
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) ifneq ($(c-gettimeofday-y),)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) VDSO_CFLAGS_gettimeofday_o += -include $(c-gettimeofday-y)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) VDSO_CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE) -Os
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) # Build rules
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) targets := $(c-obj-vdso) $(c-obj-vdso-gettimeofday) $(asm-obj-vdso) vdso.so vdso.so.dbg vdso.so.raw
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) c-obj-vdso := $(addprefix $(obj)/, $(c-obj-vdso))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) c-obj-vdso-gettimeofday := $(addprefix $(obj)/, $(c-obj-vdso-gettimeofday))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) asm-obj-vdso := $(addprefix $(obj)/, $(asm-obj-vdso))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) obj-vdso := $(c-obj-vdso) $(c-obj-vdso-gettimeofday) $(asm-obj-vdso)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) obj-y += vdso.o
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) targets += vdso.lds
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) CPPFLAGS_vdso.lds += -P -C -U$(ARCH)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) # Force dependency (vdso.s includes vdso.so through incbin)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) $(obj)/vdso.o: $(obj)/vdso.so
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) include/generated/vdso32-offsets.h: $(obj)/vdso.so.dbg FORCE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) $(call if_changed,vdsosym)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) # Strip rule for vdso.so
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) $(obj)/vdso.so: OBJCOPYFLAGS := -S
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) $(obj)/vdso.so: $(obj)/vdso.so.dbg FORCE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) $(call if_changed,objcopy)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) $(obj)/vdso.so.dbg: $(obj)/vdso.so.raw $(obj)/$(munge) FORCE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) $(call if_changed,vdsomunge)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) # Link rule for the .so file, .lds has to be first
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) $(obj)/vdso.so.raw: $(src)/vdso.lds $(obj-vdso) FORCE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) $(call if_changed,vdsold_and_vdso_check)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) # Compilation rules for the vDSO sources
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) $(c-obj-vdso): %.o: %.c FORCE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) $(call if_changed_dep,vdsocc)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) $(c-obj-vdso-gettimeofday): %.o: %.c FORCE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) $(call if_changed_dep,vdsocc_gettimeofday)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) $(asm-obj-vdso): %.o: %.S FORCE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) $(call if_changed_dep,vdsoas)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) # Actual build commands
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) quiet_cmd_vdsold_and_vdso_check = LD32 $@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) cmd_vdsold_and_vdso_check = $(cmd_vdsold); $(cmd_vdso_check)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) quiet_cmd_vdsold = LD32 $@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) cmd_vdsold = $(LD_COMPAT) $(VDSO_LDFLAGS) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) -T $(filter %.lds,$^) $(filter %.o,$^) -o $@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) quiet_cmd_vdsocc = CC32 $@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) cmd_vdsocc = $(CC_COMPAT) -Wp,-MD,$(depfile) $(VDSO_CFLAGS) -c -o $@ $<
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) quiet_cmd_vdsocc_gettimeofday = CC32 $@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) cmd_vdsocc_gettimeofday = $(CC_COMPAT) -Wp,-MD,$(depfile) $(VDSO_CFLAGS) $(VDSO_CFLAGS_gettimeofday_o) -c -o $@ $<
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) quiet_cmd_vdsoas = AS32 $@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) cmd_vdsoas = $(CC_COMPAT) -Wp,-MD,$(depfile) $(VDSO_AFLAGS) -c -o $@ $<
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) quiet_cmd_vdsomunge = MUNGE $@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) cmd_vdsomunge = $(obj)/$(munge) $< $@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) # Generate vDSO offsets using helper script (borrowed from the 64-bit vDSO)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) gen-vdsosym := $(srctree)/$(src)/../vdso/gen_vdso_offsets.sh
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) quiet_cmd_vdsosym = VDSOSYM $@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) # The AArch64 nm should be able to read an AArch32 binary
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) cmd_vdsosym = $(NM) $< | $(gen-vdsosym) | LC_ALL=C sort > $@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) # Install commands for the unstripped file
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) quiet_cmd_vdso_install = INSTALL32 $@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) cmd_vdso_install = cp $(obj)/$@.dbg $(MODLIB)/vdso/vdso32.so
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) vdso.so: $(obj)/vdso.so.dbg
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) @mkdir -p $(MODLIB)/vdso
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) $(call cmd,vdso_install)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) vdso_install: vdso.so