public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] riscv: vdso_cfi build cleanup improvements
@ 2026-03-20  2:18 cp0613
  2026-03-20  2:18 ` [PATCH 1/2] riscv: vdso_cfi: Add clean rule for copied sources cp0613
  2026-03-20  2:18 ` [PATCH 2/2] riscv: vdso_cfi: Add .gitignore for build artifacts cp0613
  0 siblings, 2 replies; 3+ messages in thread
From: cp0613 @ 2026-03-20  2:18 UTC (permalink / raw)
  To: pjw, alex, debug, guoren; +Cc: linux-riscv, linux-kernel, Chen Pei

From: Chen Pei <cp0613@linux.alibaba.com>

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

-- 
2.50.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] riscv: vdso_cfi: Add clean rule for copied sources
  2026-03-20  2:18 [PATCH 0/2] riscv: vdso_cfi build cleanup improvements cp0613
@ 2026-03-20  2:18 ` cp0613
  2026-03-20  2:18 ` [PATCH 2/2] riscv: vdso_cfi: Add .gitignore for build artifacts cp0613
  1 sibling, 0 replies; 3+ messages in thread
From: cp0613 @ 2026-03-20  2:18 UTC (permalink / raw)
  To: pjw, alex, debug, guoren; +Cc: linux-riscv, linux-kernel, Chen Pei

From: Chen Pei <cp0613@linux.alibaba.com>

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.

Signed-off-by: Chen Pei <cp0613@linux.alibaba.com>
---
 arch/riscv/kernel/vdso_cfi/Makefile | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/riscv/kernel/vdso_cfi/Makefile b/arch/riscv/kernel/vdso_cfi/Makefile
index 8ebd190782b0..10292498b765 100644
--- a/arch/riscv/kernel/vdso_cfi/Makefile
+++ b/arch/riscv/kernel/vdso_cfi/Makefile
@@ -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))
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] riscv: vdso_cfi: Add .gitignore for build artifacts
  2026-03-20  2:18 [PATCH 0/2] riscv: vdso_cfi build cleanup improvements cp0613
  2026-03-20  2:18 ` [PATCH 1/2] riscv: vdso_cfi: Add clean rule for copied sources cp0613
@ 2026-03-20  2:18 ` cp0613
  1 sibling, 0 replies; 3+ messages in thread
From: cp0613 @ 2026-03-20  2:18 UTC (permalink / raw)
  To: pjw, alex, debug, guoren; +Cc: linux-riscv, linux-kernel, Chen Pei

From: Chen Pei <cp0613@linux.alibaba.com>

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.

Signed-off-by: Chen Pei <cp0613@linux.alibaba.com>
---
 arch/riscv/kernel/vdso_cfi/.gitignore | 8 ++++++++
 1 file changed, 8 insertions(+)
 create mode 100644 arch/riscv/kernel/vdso_cfi/.gitignore

diff --git a/arch/riscv/kernel/vdso_cfi/.gitignore b/arch/riscv/kernel/vdso_cfi/.gitignore
new file mode 100644
index 000000000000..220b6ebece4f
--- /dev/null
+++ b/arch/riscv/kernel/vdso_cfi/.gitignore
@@ -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
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-03-20  2:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-20  2:18 [PATCH 0/2] riscv: vdso_cfi build cleanup improvements cp0613
2026-03-20  2:18 ` [PATCH 1/2] riscv: vdso_cfi: Add clean rule for copied sources cp0613
2026-03-20  2:18 ` [PATCH 2/2] riscv: vdso_cfi: Add .gitignore for build artifacts cp0613

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox