riscv: vdso_cfi build cleanup improvements
cover riscv: vdso_cfi build cleanup improvements
From: Chen Pei <[email protected]>
This patch series addresses two issues with the RISC-V VDSO CFI build:
1. Build artifacts were not cleaned properly during 'make clean'
2. Copied source files were being tracked by git
The first patch adds the clean-files variable to ensure that temporary source files copied from the main vdso directory are removed during make clean.
The second patch adds a .gitignore file to prevent git from tracking build artifacts and copied source files in the vdso_cfi build directory.
These changes improve the build system hygiene and maintain clean working directories for developers working with CFI support.
Chen Pei (2):
riscv: vdso_cfi: Add clean rule for copied sources
riscv: vdso_cfi: Add .gitignore for build artifacts
arch/riscv/kernel/vdso_cfi/.gitignore | 8 ++++++++ arch/riscv/kernel/vdso_cfi/Makefile | 3 +++ 2 files changed, 11 insertions(+) create mode 100644 arch/riscv/kernel/vdso_cfi/.gitignore
Signature · 1 line
2.50.1
PATCH 1/2 riscv: vdso_cfi: Add clean rule for copied sources
From: Chen Pei <[email protected]>
When building VDSO with CFI support, source files are copied from the main VDSO directory to the CFI build directory as part of the build process. However, these copied source files were not removed during 'make clean', leaving temporary files in the build directory.
Add the clean-files variable to ensure that these copied .c and .S files are properly cleaned up. The notdir() function is used to strip the path prefix, as clean-files expects relative file names without directory components.
This ensures the build directory is left in a clean state after make clean.
--- arch/riscv/kernel/vdso_cfi/Makefile | 3 +++ 1 file changed, 3 insertions(+)
arch/riscv/kernel/vdso_cfi/Makefile +3 -0
@@ -23,3 +23,6 @@ $(vdso_c_objects): $(obj)/%.c: $(src)/%.c # Include the main VDSO Makefile which contains all the build rules and sources # The VDSO_CFI_BUILD variable will be passed to it to enable CFI compilation include $(src)/Makefile + +# Clean rules - remove the copied source files +clean-files += $(notdir $(vdso_c_sources)) $(notdir $(vdso_S_sources))
Signature · 1 line
2.50.1
PATCH 2/2 riscv: vdso_cfi: Add .gitignore for build artifacts
In reply to [email protected]From: Chen Pei <[email protected]>
The vdso_cfi build process copies source files (*.c, *.S) from the main vdso directory to the build directory. Without a .gitignore file, these copied files appear as untracked files in git status, cluttering the working directory.
Add a .gitignore file to exclude:
- Copied source files (*.c, *.S)
- Temporary build files (vdso.lds, *.tmp, vdso-syms.S)
- While preserving vdso-cfi.S which is the original entry point
This follows the same pattern used in the main vdso directory and keeps the working directory clean.
--- arch/riscv/kernel/vdso_cfi/.gitignore | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 arch/riscv/kernel/vdso_cfi/.gitignore
arch/riscv/kernel/vdso_cfi/.gitignore new file +8 -0
@@ -0,0 +1,8 @@ +# SPDX-License-Identifier: GPL-2.0-only +# Copied source files from the main vdso directory +*.c +*.S +!vdso-cfi.S +vdso.lds +*.tmp +vdso-syms.S
Signature · 1 line
2.50.1
Paul Walmsley
maintainerQuoted 11 lines · On Fri, 20 Mar 2026, [email protected] wrote:
From: Chen Pei <[email protected]>
This patch series addresses two issues with the RISC-V VDSO CFI build:
1. Build artifacts were not cleaned properly during 'make clean'
2. Copied source files were being tracked by gitThe first patch adds the clean-files variable to ensure that temporary source files copied from the main vdso directory are removed during make clean.
Quoted 5 lines
The second patch adds a .gitignore file to prevent git from tracking build artifacts and copied source files in the
vdso_cfibuild directory.These changes improve the build system hygiene and maintain clean working directories for developers working with CFI support.
Thanks, queued for v7.1.
- Paul