Skip to contentSkip to conversation

parisc: vdso: remove dead code in vdso32/Makefile

PATCH In review Masahiro Yamada 2 participants 5 messages Mar 30, 2024 – Apr 16, 2024 PA-RISC architecture

lore
Share & tools
lore
#0 lore raw

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.

---

 arch/parisc/kernel/vdso32/Makefile | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
arch/parisc/kernel/vdso32/Makefile +1 -6
index 4459a48d2303..e45d46bf46a2 100644
@@ -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
Signature · 1 line
2.40.1
#1 lore raw

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'.

---

 arch/parisc/kernel/vdso32/Makefile | 4 ++--
 arch/parisc/kernel/vdso64/Makefile | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
arch/parisc/kernel/vdso32/Makefile +2 -2
index e45d46bf46a2..f15367f77d49 100644
@@ -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
arch/parisc/kernel/vdso64/Makefile +2 -2
index f3d6045793f4..25eb9a95422c 100644
@@ -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
Signature · 1 line
2.40.1
maintainer Acked-by on v1 2/2
#2 lore raw

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

Quoted 7 lines · Masahiro Yamada

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'.

Helge

Quoted 48 lines

---

  arch/parisc/kernel/vdso32/Makefile | 4 ++--
  arch/parisc/kernel/vdso64/Makefile | 4 ++--
  2 files changed, 4 insertions(+), 4 deletions(-)
arch/parisc/kernel/vdso32/Makefile +2 -2
index e45d46bf46a2..f15367f77d49 100644
@@ -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
arch/parisc/kernel/vdso64/Makefile +2 -2
index f3d6045793f4..25eb9a95422c 100644
@@ -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
maintainer Acked-by on v1 1/2
#3 lore raw
In reply to Masahiro Yamada
Quoted 8 lines · Masahiro Yamada

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.

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

Quoted 34 lines

---

  arch/parisc/kernel/vdso32/Makefile | 7 +------
  1 file changed, 1 insertion(+), 6 deletions(-)
arch/parisc/kernel/vdso32/Makefile +1 -6
index 4459a48d2303..e45d46bf46a2 100644
@@ -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
#4 lore raw
Quoted 11 lines · Helge Deller
Quoted 8 lines · Masahiro Yamada

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.

Quoted 8 lines

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)

Signature · 2 lines
Best Regards
Masahiro Yamada