2024-03-30 10:09:18

by Masahiro Yamada

[permalink] [raw]
Subject: [PATCH 1/2] parisc: vdso: remove dead code in vdso32/Makefile

This commit removes the unused build rule because 'obj-cvdso32' is
not defined.

If you add a C file into arch/parisc/kernel/vdso32/ in the future,
you can revert this change. The kernel does not keep code that
may or may not be used.

Signed-off-by: Masahiro Yamada <[email protected]>
---

arch/parisc/kernel/vdso32/Makefile | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/arch/parisc/kernel/vdso32/Makefile b/arch/parisc/kernel/vdso32/Makefile
index 4459a48d2303..e45d46bf46a2 100644
--- a/arch/parisc/kernel/vdso32/Makefile
+++ b/arch/parisc/kernel/vdso32/Makefile
@@ -26,23 +26,18 @@ $(obj)/vdso32_wrapper.o : $(obj)/vdso32.so FORCE

# Force dependency (incbin is bad)
# link rule for the .so file, .lds has to be first
-$(obj)/vdso32.so: $(src)/vdso32.lds $(obj-vdso32) $(obj-cvdso32) $(VDSO_LIBGCC) FORCE
+$(obj)/vdso32.so: $(src)/vdso32.lds $(obj-vdso32) $(VDSO_LIBGCC) FORCE
$(call if_changed,vdso32ld)

# assembly rules for the .S files
$(obj-vdso32): %.o: %.S FORCE
$(call if_changed_dep,vdso32as)

-$(obj-cvdso32): %.o: %.c FORCE
- $(call if_changed_dep,vdso32cc)
-
# actual build commands
quiet_cmd_vdso32ld = VDSO32L $@
cmd_vdso32ld = $(CROSS32CC) $(c_flags) -Wl,-T $(filter-out FORCE, $^) -o $@
quiet_cmd_vdso32as = VDSO32A $@
cmd_vdso32as = $(CROSS32CC) $(a_flags) -c -o $@ $<
-quiet_cmd_vdso32cc = VDSO32C $@
- cmd_vdso32cc = $(CROSS32CC) $(c_flags) -c -fPIC -mno-fast-indirect-calls -o $@ $<

# Generate VDSO offsets using helper script
gen-vdsosym := $(srctree)/$(src)/gen_vdso_offsets.sh
--
2.40.1



2024-03-30 10:09:25

by Masahiro Yamada

[permalink] [raw]
Subject: [PATCH 2/2] parisc: fix vdso Makefiles slightly

vdso32.lds and vdso64.lds are generated files. Prefix them with $(obj)/
instead of $(src)/.

They are generated as prerequisites of others. Add them to 'targets'
instead of 'extra-y'.

Signed-off-by: Masahiro Yamada <[email protected]>
---

arch/parisc/kernel/vdso32/Makefile | 4 ++--
arch/parisc/kernel/vdso64/Makefile | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/parisc/kernel/vdso32/Makefile b/arch/parisc/kernel/vdso32/Makefile
index e45d46bf46a2..f15367f77d49 100644
--- a/arch/parisc/kernel/vdso32/Makefile
+++ b/arch/parisc/kernel/vdso32/Makefile
@@ -19,14 +19,14 @@ KBUILD_CFLAGS += -DBUILD_VDSO -DDISABLE_BRANCH_PROFILING
VDSO_LIBGCC := $(shell $(CROSS32CC) -print-libgcc-file-name)

obj-y += vdso32_wrapper.o
-extra-y += vdso32.lds
+targets += vdso32.lds
CPPFLAGS_vdso32.lds += -P -C # -U$(ARCH)

$(obj)/vdso32_wrapper.o : $(obj)/vdso32.so FORCE

# Force dependency (incbin is bad)
# link rule for the .so file, .lds has to be first
-$(obj)/vdso32.so: $(src)/vdso32.lds $(obj-vdso32) $(VDSO_LIBGCC) FORCE
+$(obj)/vdso32.so: $(obj)/vdso32.lds $(obj-vdso32) $(VDSO_LIBGCC) FORCE
$(call if_changed,vdso32ld)

# assembly rules for the .S files
diff --git a/arch/parisc/kernel/vdso64/Makefile b/arch/parisc/kernel/vdso64/Makefile
index f3d6045793f4..25eb9a95422c 100644
--- a/arch/parisc/kernel/vdso64/Makefile
+++ b/arch/parisc/kernel/vdso64/Makefile
@@ -19,14 +19,14 @@ KBUILD_CFLAGS += -DBUILD_VDSO -DDISABLE_BRANCH_PROFILING
VDSO_LIBGCC := $(shell $(CC) -print-libgcc-file-name)

obj-y += vdso64_wrapper.o
-extra-y += vdso64.lds
+targets += vdso64.lds
CPPFLAGS_vdso64.lds += -P -C -U$(ARCH)

$(obj)/vdso64_wrapper.o : $(obj)/vdso64.so FORCE

# Force dependency (incbin is bad)
# link rule for the .so file, .lds has to be first
-$(obj)/vdso64.so: $(src)/vdso64.lds $(obj-vdso64) $(VDSO_LIBGCC) FORCE
+$(obj)/vdso64.so: $(obj)/vdso64.lds $(obj-vdso64) $(VDSO_LIBGCC) FORCE
$(call if_changed,vdso64ld)

# assembly rules for the .S files
--
2.40.1


2024-03-30 22:47:22

by Helge Deller

[permalink] [raw]
Subject: Re: [PATCH 1/2] parisc: vdso: remove dead code in vdso32/Makefile

On 3/30/24 11:08, Masahiro Yamada wrote:
> This commit removes the unused build rule because 'obj-cvdso32' is
> not defined.
>
> If you add a C file into arch/parisc/kernel/vdso32/ in the future,
> you can revert this change. The kernel does not keep code that
> may or may not be used.
>
> Signed-off-by: Masahiro Yamada <[email protected]>

Acked-by: Helge Deller <[email protected]>

Thank you for those cleanups, Masahiro!

Shall I take your patches via parisc git tree, or will you take
them via your git trees?

Helge


> ---
>
> arch/parisc/kernel/vdso32/Makefile | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/arch/parisc/kernel/vdso32/Makefile b/arch/parisc/kernel/vdso32/Makefile
> index 4459a48d2303..e45d46bf46a2 100644
> --- a/arch/parisc/kernel/vdso32/Makefile
> +++ b/arch/parisc/kernel/vdso32/Makefile
> @@ -26,23 +26,18 @@ $(obj)/vdso32_wrapper.o : $(obj)/vdso32.so FORCE
>
> # Force dependency (incbin is bad)
> # link rule for the .so file, .lds has to be first
> -$(obj)/vdso32.so: $(src)/vdso32.lds $(obj-vdso32) $(obj-cvdso32) $(VDSO_LIBGCC) FORCE
> +$(obj)/vdso32.so: $(src)/vdso32.lds $(obj-vdso32) $(VDSO_LIBGCC) FORCE
> $(call if_changed,vdso32ld)
>
> # assembly rules for the .S files
> $(obj-vdso32): %.o: %.S FORCE
> $(call if_changed_dep,vdso32as)
>
> -$(obj-cvdso32): %.o: %.c FORCE
> - $(call if_changed_dep,vdso32cc)
> -
> # actual build commands
> quiet_cmd_vdso32ld = VDSO32L $@
> cmd_vdso32ld = $(CROSS32CC) $(c_flags) -Wl,-T $(filter-out FORCE, $^) -o $@
> quiet_cmd_vdso32as = VDSO32A $@
> cmd_vdso32as = $(CROSS32CC) $(a_flags) -c -o $@ $<
> -quiet_cmd_vdso32cc = VDSO32C $@
> - cmd_vdso32cc = $(CROSS32CC) $(c_flags) -c -fPIC -mno-fast-indirect-calls -o $@ $<
>
> # Generate VDSO offsets using helper script
> gen-vdsosym := $(srctree)/$(src)/gen_vdso_offsets.sh


2024-03-30 22:48:54

by Helge Deller

[permalink] [raw]
Subject: Re: [PATCH 2/2] parisc: fix vdso Makefiles slightly

On 3/30/24 11:08, Masahiro Yamada wrote:
> vdso32.lds and vdso64.lds are generated files. Prefix them with $(obj)/
> instead of $(src)/.
>
> They are generated as prerequisites of others. Add them to 'targets'
> instead of 'extra-y'.
>
> Signed-off-by: Masahiro Yamada <[email protected]>

Acked-by: Helge Deller <[email protected]>

Helge

> ---
>
> arch/parisc/kernel/vdso32/Makefile | 4 ++--
> arch/parisc/kernel/vdso64/Makefile | 4 ++--
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/parisc/kernel/vdso32/Makefile b/arch/parisc/kernel/vdso32/Makefile
> index e45d46bf46a2..f15367f77d49 100644
> --- a/arch/parisc/kernel/vdso32/Makefile
> +++ b/arch/parisc/kernel/vdso32/Makefile
> @@ -19,14 +19,14 @@ KBUILD_CFLAGS += -DBUILD_VDSO -DDISABLE_BRANCH_PROFILING
> VDSO_LIBGCC := $(shell $(CROSS32CC) -print-libgcc-file-name)
>
> obj-y += vdso32_wrapper.o
> -extra-y += vdso32.lds
> +targets += vdso32.lds
> CPPFLAGS_vdso32.lds += -P -C # -U$(ARCH)
>
> $(obj)/vdso32_wrapper.o : $(obj)/vdso32.so FORCE
>
> # Force dependency (incbin is bad)
> # link rule for the .so file, .lds has to be first
> -$(obj)/vdso32.so: $(src)/vdso32.lds $(obj-vdso32) $(VDSO_LIBGCC) FORCE
> +$(obj)/vdso32.so: $(obj)/vdso32.lds $(obj-vdso32) $(VDSO_LIBGCC) FORCE
> $(call if_changed,vdso32ld)
>
> # assembly rules for the .S files
> diff --git a/arch/parisc/kernel/vdso64/Makefile b/arch/parisc/kernel/vdso64/Makefile
> index f3d6045793f4..25eb9a95422c 100644
> --- a/arch/parisc/kernel/vdso64/Makefile
> +++ b/arch/parisc/kernel/vdso64/Makefile
> @@ -19,14 +19,14 @@ KBUILD_CFLAGS += -DBUILD_VDSO -DDISABLE_BRANCH_PROFILING
> VDSO_LIBGCC := $(shell $(CC) -print-libgcc-file-name)
>
> obj-y += vdso64_wrapper.o
> -extra-y += vdso64.lds
> +targets += vdso64.lds
> CPPFLAGS_vdso64.lds += -P -C -U$(ARCH)
>
> $(obj)/vdso64_wrapper.o : $(obj)/vdso64.so FORCE
>
> # Force dependency (incbin is bad)
> # link rule for the .so file, .lds has to be first
> -$(obj)/vdso64.so: $(src)/vdso64.lds $(obj-vdso64) $(VDSO_LIBGCC) FORCE
> +$(obj)/vdso64.so: $(obj)/vdso64.lds $(obj-vdso64) $(VDSO_LIBGCC) FORCE
> $(call if_changed,vdso64ld)
>
> # assembly rules for the .S files


2024-04-16 02:27:24

by Masahiro Yamada

[permalink] [raw]
Subject: Re: [PATCH 1/2] parisc: vdso: remove dead code in vdso32/Makefile

On Sun, Mar 31, 2024 at 7:46 AM Helge Deller <[email protected]> wrote:
>
> On 3/30/24 11:08, Masahiro Yamada wrote:
> > This commit removes the unused build rule because 'obj-cvdso32' is
> > not defined.
> >
> > If you add a C file into arch/parisc/kernel/vdso32/ in the future,
> > you can revert this change. The kernel does not keep code that
> > may or may not be used.
> >
> > Signed-off-by: Masahiro Yamada <[email protected]>
>
> Acked-by: Helge Deller <[email protected]>
>
> Thank you for those cleanups, Masahiro!
>
> Shall I take your patches via parisc git tree, or will you take
> them via your git trees?
>
> Helge


Thanks, I applied this to my tree now.

(I need this as a prerequisite for my Kbuild work)



--
Best Regards
Masahiro Yamada