arch/riscv/kernel/vdso/Makefile

Source file repositories/reference/linux-study-clean/arch/riscv/kernel/vdso/Makefile

File Facts

System
Linux kernel
Corpus path
arch/riscv/kernel/vdso/Makefile
Extension
[no extension]
Size
3202 bytes
Lines
106
Domain
Architecture Layer
Bucket
arch/riscv
Inferred role
Architecture Layer: build/configuration rule
Status
atlas-only

Why This File Exists

CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.

Dependency Surface

Detected Declarations

Annotated Snippet

# SPDX-License-Identifier: GPL-2.0-only
# Copied from arch/tile/kernel/vdso/Makefile

# Include the generic Makefile to check the built vdso.
include $(srctree)/lib/vdso/Makefile.include
# Symbols present in the vdso
vdso-syms  = rt_sigreturn
ifdef CONFIG_64BIT
vdso-syms += vgettimeofday
endif
vdso-syms += getcpu
vdso-syms += flush_icache
vdso-syms += hwprobe
vdso-syms += sys_hwprobe

ifdef CONFIG_VDSO_GETRANDOM
vdso-syms += getrandom
endif

ifdef VDSO_CFI_BUILD
CFI_MARCH = _zicfilp_zicfiss
CFI_FULL = -fcf-protection=full
CFI_SUFFIX = -cfi
OFFSET_SUFFIX = _cfi
ccflags-y += -DVDSO_CFI=1
asflags-y += -DVDSO_CFI=1
endif

# Files to link into the vdso
obj-vdso = $(patsubst %, %.o, $(vdso-syms)) note.o

ifdef CONFIG_VDSO_GETRANDOM
obj-vdso += vgetrandom-chacha.o
endif

ccflags-y := -fno-stack-protector
ccflags-y += -DDISABLE_BRANCH_PROFILING
ccflags-y += -fno-builtin
ccflags-y += $(KBUILD_BASE_ISA)$(CFI_MARCH)
ccflags-y += $(CFI_FULL)
asflags-y += $(KBUILD_BASE_ISA)$(CFI_MARCH)
asflags-y += $(CFI_FULL)

ifneq ($(c-gettimeofday-y),)
  CFLAGS_vgettimeofday.o += -fPIC -include $(c-gettimeofday-y)
endif

ifneq ($(c-getrandom-y),)
  CFLAGS_getrandom.o += -fPIC -include $(c-getrandom-y)
endif

CFLAGS_hwprobe.o += -fPIC

# Build rules
vdso_offsets := vdso$(if $(VDSO_CFI_BUILD),$(CFI_SUFFIX),)-offsets.h
vdso_o := vdso$(if $(VDSO_CFI_BUILD),$(CFI_SUFFIX),).o
vdso_so := vdso$(if $(VDSO_CFI_BUILD),$(CFI_SUFFIX),).so
vdso_so_dbg := vdso$(if $(VDSO_CFI_BUILD),$(CFI_SUFFIX),).so.dbg
vdso_lds := vdso.lds

targets := $(obj-vdso) $(vdso_so) $(vdso_so_dbg) $(vdso_lds)

obj-vdso := $(addprefix $(obj)/, $(obj-vdso))

obj-y += vdso$(if $(VDSO_CFI_BUILD),$(CFI_SUFFIX),).o
CPPFLAGS_$(vdso_lds) += -P -C -U$(ARCH)
ifneq ($(filter vgettimeofday, $(vdso-syms)),)
CPPFLAGS_$(vdso_lds) += -DHAS_VGETTIMEOFDAY
endif

Annotation

Implementation Notes