All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] riscv: vdso: fix and clean-up Makefile
@ 2021-04-02 13:29 ` Jisheng Zhang
  0 siblings, 0 replies; 4+ messages in thread
From: Jisheng Zhang @ 2021-04-02 13:29 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou
  Cc: linux-riscv, linux-kernel, Masahiro Yamada

From: Jisheng Zhang <jszhang@kernel.org>

Running "make" on an already compiled kernel tree will rebuild the
kernel even without any modifications:

  CALL    linux/scripts/checksyscalls.sh
  CALL    linux/scripts/atomic/check-atomics.sh
  CHK     include/generated/compile.h
  SO2S    arch/riscv/kernel/vdso/vdso-syms.S
  AS      arch/riscv/kernel/vdso/vdso-syms.o
  AR      arch/riscv/kernel/vdso/built-in.a
  AR      arch/riscv/kernel/built-in.a
  AR      arch/riscv/built-in.a
  GEN     .version
  CHK     include/generated/compile.h
  UPD     include/generated/compile.h
  CC      init/version.o
  AR      init/built-in.a
  LD      vmlinux.o

The reason is "Any target that utilizes if_changed must be listed in
$(targets), otherwise the command line check will fail, and the target
will always be built" as explained by Documentation/kbuild/makefiles.rst

Fix this build bug by adding vdso-syms.S to $(targets)

At the same time, there are two trivial clean up modifications:

- the vdso-dummy.o is not needed any more after so remove it.

- vdso.lds is a generated file, so it should be prefixed with
  $(obj)/ instead of $(src)/

Fixes: c2c81bb2f691 ("RISC-V: Fix the VDSO symbol generaton for binutils-2.35+")
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
 arch/riscv/kernel/vdso/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/riscv/kernel/vdso/Makefile b/arch/riscv/kernel/vdso/Makefile
index 71a315e73cbe..7b9f505ba82f 100644
--- a/arch/riscv/kernel/vdso/Makefile
+++ b/arch/riscv/kernel/vdso/Makefile
@@ -23,7 +23,7 @@ ifneq ($(c-gettimeofday-y),)
 endif
 
 # Build rules
-targets := $(obj-vdso) vdso.so vdso.so.dbg vdso.lds vdso-dummy.o
+targets := $(obj-vdso) vdso.so vdso.so.dbg vdso.lds vdso-syms.S
 obj-vdso := $(addprefix $(obj)/, $(obj-vdso))
 
 obj-y += vdso.o vdso-syms.o
@@ -42,7 +42,7 @@ $(obj)/vdso.o: $(obj)/vdso.so
 
 # link rule for the .so file, .lds has to be first
 SYSCFLAGS_vdso.so.dbg = $(c_flags)
-$(obj)/vdso.so.dbg: $(src)/vdso.lds $(obj-vdso) FORCE
+$(obj)/vdso.so.dbg: $(obj)/vdso.lds $(obj-vdso) FORCE
 	$(call if_changed,vdsold)
 SYSCFLAGS_vdso.so.dbg = -shared -s -Wl,-soname=linux-vdso.so.1 \
 	-Wl,--build-id=sha1 -Wl,--hash-style=both
-- 
2.31.0



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

* [PATCH] riscv: vdso: fix and clean-up Makefile
@ 2021-04-02 13:29 ` Jisheng Zhang
  0 siblings, 0 replies; 4+ messages in thread
From: Jisheng Zhang @ 2021-04-02 13:29 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou
  Cc: linux-riscv, linux-kernel, Masahiro Yamada

From: Jisheng Zhang <jszhang@kernel.org>

Running "make" on an already compiled kernel tree will rebuild the
kernel even without any modifications:

  CALL    linux/scripts/checksyscalls.sh
  CALL    linux/scripts/atomic/check-atomics.sh
  CHK     include/generated/compile.h
  SO2S    arch/riscv/kernel/vdso/vdso-syms.S
  AS      arch/riscv/kernel/vdso/vdso-syms.o
  AR      arch/riscv/kernel/vdso/built-in.a
  AR      arch/riscv/kernel/built-in.a
  AR      arch/riscv/built-in.a
  GEN     .version
  CHK     include/generated/compile.h
  UPD     include/generated/compile.h
  CC      init/version.o
  AR      init/built-in.a
  LD      vmlinux.o

The reason is "Any target that utilizes if_changed must be listed in
$(targets), otherwise the command line check will fail, and the target
will always be built" as explained by Documentation/kbuild/makefiles.rst

Fix this build bug by adding vdso-syms.S to $(targets)

At the same time, there are two trivial clean up modifications:

- the vdso-dummy.o is not needed any more after so remove it.

- vdso.lds is a generated file, so it should be prefixed with
  $(obj)/ instead of $(src)/

Fixes: c2c81bb2f691 ("RISC-V: Fix the VDSO symbol generaton for binutils-2.35+")
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
 arch/riscv/kernel/vdso/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/riscv/kernel/vdso/Makefile b/arch/riscv/kernel/vdso/Makefile
index 71a315e73cbe..7b9f505ba82f 100644
--- a/arch/riscv/kernel/vdso/Makefile
+++ b/arch/riscv/kernel/vdso/Makefile
@@ -23,7 +23,7 @@ ifneq ($(c-gettimeofday-y),)
 endif
 
 # Build rules
-targets := $(obj-vdso) vdso.so vdso.so.dbg vdso.lds vdso-dummy.o
+targets := $(obj-vdso) vdso.so vdso.so.dbg vdso.lds vdso-syms.S
 obj-vdso := $(addprefix $(obj)/, $(obj-vdso))
 
 obj-y += vdso.o vdso-syms.o
@@ -42,7 +42,7 @@ $(obj)/vdso.o: $(obj)/vdso.so
 
 # link rule for the .so file, .lds has to be first
 SYSCFLAGS_vdso.so.dbg = $(c_flags)
-$(obj)/vdso.so.dbg: $(src)/vdso.lds $(obj-vdso) FORCE
+$(obj)/vdso.so.dbg: $(obj)/vdso.lds $(obj-vdso) FORCE
 	$(call if_changed,vdsold)
 SYSCFLAGS_vdso.so.dbg = -shared -s -Wl,-soname=linux-vdso.so.1 \
 	-Wl,--build-id=sha1 -Wl,--hash-style=both
-- 
2.31.0



_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [PATCH] riscv: vdso: fix and clean-up Makefile
  2021-04-02 13:29 ` Jisheng Zhang
@ 2021-04-23  3:00   ` Palmer Dabbelt
  -1 siblings, 0 replies; 4+ messages in thread
From: Palmer Dabbelt @ 2021-04-23  3:00 UTC (permalink / raw)
  To: jszhang3; +Cc: Paul Walmsley, aou, linux-riscv, linux-kernel, masahiroy

On Fri, 02 Apr 2021 06:29:08 PDT (-0700), jszhang3@mail.ustc.edu.cn wrote:
> From: Jisheng Zhang <jszhang@kernel.org>
>
> Running "make" on an already compiled kernel tree will rebuild the
> kernel even without any modifications:
>
>   CALL    linux/scripts/checksyscalls.sh
>   CALL    linux/scripts/atomic/check-atomics.sh
>   CHK     include/generated/compile.h
>   SO2S    arch/riscv/kernel/vdso/vdso-syms.S
>   AS      arch/riscv/kernel/vdso/vdso-syms.o
>   AR      arch/riscv/kernel/vdso/built-in.a
>   AR      arch/riscv/kernel/built-in.a
>   AR      arch/riscv/built-in.a
>   GEN     .version
>   CHK     include/generated/compile.h
>   UPD     include/generated/compile.h
>   CC      init/version.o
>   AR      init/built-in.a
>   LD      vmlinux.o
>
> The reason is "Any target that utilizes if_changed must be listed in
> $(targets), otherwise the command line check will fail, and the target
> will always be built" as explained by Documentation/kbuild/makefiles.rst
>
> Fix this build bug by adding vdso-syms.S to $(targets)
>
> At the same time, there are two trivial clean up modifications:
>
> - the vdso-dummy.o is not needed any more after so remove it.
>
> - vdso.lds is a generated file, so it should be prefixed with
>   $(obj)/ instead of $(src)/
>
> Fixes: c2c81bb2f691 ("RISC-V: Fix the VDSO symbol generaton for binutils-2.35+")
> Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
> ---
>  arch/riscv/kernel/vdso/Makefile | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/riscv/kernel/vdso/Makefile b/arch/riscv/kernel/vdso/Makefile
> index 71a315e73cbe..7b9f505ba82f 100644
> --- a/arch/riscv/kernel/vdso/Makefile
> +++ b/arch/riscv/kernel/vdso/Makefile
> @@ -23,7 +23,7 @@ ifneq ($(c-gettimeofday-y),)
>  endif
>
>  # Build rules
> -targets := $(obj-vdso) vdso.so vdso.so.dbg vdso.lds vdso-dummy.o
> +targets := $(obj-vdso) vdso.so vdso.so.dbg vdso.lds vdso-syms.S
>  obj-vdso := $(addprefix $(obj)/, $(obj-vdso))
>
>  obj-y += vdso.o vdso-syms.o
> @@ -42,7 +42,7 @@ $(obj)/vdso.o: $(obj)/vdso.so
>
>  # link rule for the .so file, .lds has to be first
>  SYSCFLAGS_vdso.so.dbg = $(c_flags)
> -$(obj)/vdso.so.dbg: $(src)/vdso.lds $(obj-vdso) FORCE
> +$(obj)/vdso.so.dbg: $(obj)/vdso.lds $(obj-vdso) FORCE
>  	$(call if_changed,vdsold)
>  SYSCFLAGS_vdso.so.dbg = -shared -s -Wl,-soname=linux-vdso.so.1 \
>  	-Wl,--build-id=sha1 -Wl,--hash-style=both

Thanks, this is on for-next.

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

* Re: [PATCH] riscv: vdso: fix and clean-up Makefile
@ 2021-04-23  3:00   ` Palmer Dabbelt
  0 siblings, 0 replies; 4+ messages in thread
From: Palmer Dabbelt @ 2021-04-23  3:00 UTC (permalink / raw)
  To: jszhang3; +Cc: Paul Walmsley, aou, linux-riscv, linux-kernel, masahiroy

On Fri, 02 Apr 2021 06:29:08 PDT (-0700), jszhang3@mail.ustc.edu.cn wrote:
> From: Jisheng Zhang <jszhang@kernel.org>
>
> Running "make" on an already compiled kernel tree will rebuild the
> kernel even without any modifications:
>
>   CALL    linux/scripts/checksyscalls.sh
>   CALL    linux/scripts/atomic/check-atomics.sh
>   CHK     include/generated/compile.h
>   SO2S    arch/riscv/kernel/vdso/vdso-syms.S
>   AS      arch/riscv/kernel/vdso/vdso-syms.o
>   AR      arch/riscv/kernel/vdso/built-in.a
>   AR      arch/riscv/kernel/built-in.a
>   AR      arch/riscv/built-in.a
>   GEN     .version
>   CHK     include/generated/compile.h
>   UPD     include/generated/compile.h
>   CC      init/version.o
>   AR      init/built-in.a
>   LD      vmlinux.o
>
> The reason is "Any target that utilizes if_changed must be listed in
> $(targets), otherwise the command line check will fail, and the target
> will always be built" as explained by Documentation/kbuild/makefiles.rst
>
> Fix this build bug by adding vdso-syms.S to $(targets)
>
> At the same time, there are two trivial clean up modifications:
>
> - the vdso-dummy.o is not needed any more after so remove it.
>
> - vdso.lds is a generated file, so it should be prefixed with
>   $(obj)/ instead of $(src)/
>
> Fixes: c2c81bb2f691 ("RISC-V: Fix the VDSO symbol generaton for binutils-2.35+")
> Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
> ---
>  arch/riscv/kernel/vdso/Makefile | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/riscv/kernel/vdso/Makefile b/arch/riscv/kernel/vdso/Makefile
> index 71a315e73cbe..7b9f505ba82f 100644
> --- a/arch/riscv/kernel/vdso/Makefile
> +++ b/arch/riscv/kernel/vdso/Makefile
> @@ -23,7 +23,7 @@ ifneq ($(c-gettimeofday-y),)
>  endif
>
>  # Build rules
> -targets := $(obj-vdso) vdso.so vdso.so.dbg vdso.lds vdso-dummy.o
> +targets := $(obj-vdso) vdso.so vdso.so.dbg vdso.lds vdso-syms.S
>  obj-vdso := $(addprefix $(obj)/, $(obj-vdso))
>
>  obj-y += vdso.o vdso-syms.o
> @@ -42,7 +42,7 @@ $(obj)/vdso.o: $(obj)/vdso.so
>
>  # link rule for the .so file, .lds has to be first
>  SYSCFLAGS_vdso.so.dbg = $(c_flags)
> -$(obj)/vdso.so.dbg: $(src)/vdso.lds $(obj-vdso) FORCE
> +$(obj)/vdso.so.dbg: $(obj)/vdso.lds $(obj-vdso) FORCE
>  	$(call if_changed,vdsold)
>  SYSCFLAGS_vdso.so.dbg = -shared -s -Wl,-soname=linux-vdso.so.1 \
>  	-Wl,--build-id=sha1 -Wl,--hash-style=both

Thanks, this is on for-next.

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

end of thread, other threads:[~2021-04-23  3:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-02 13:29 [PATCH] riscv: vdso: fix and clean-up Makefile Jisheng Zhang
2021-04-02 13:29 ` Jisheng Zhang
2021-04-23  3:00 ` Palmer Dabbelt
2021-04-23  3:00   ` Palmer Dabbelt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.