linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] unicore32: simplify linker script generation for decompressor
@ 2019-03-08  5:30 Masahiro Yamada
  2019-03-13 17:41 ` Masahiro Yamada
  0 siblings, 1 reply; 2+ messages in thread
From: Masahiro Yamada @ 2019-03-08  5:30 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel, Guan Xuetao

When I was searching for unneeded $(KCONFIG_CONFIG) usages, I noticed
this strange build dependency.

It can use $(call if_changed,...) in case ZTEXTADDR and ZBSSADDR are
changed, but even a simpler way is to use the pattern rule in
scripts/Makefile.build. This is what arch/arm/boot/compressed/Makefile
does.

I did only build test. I confirmed equivalent vmlinux.lds was generated.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 arch/unicore32/boot/compressed/Makefile                          | 5 +----
 arch/unicore32/boot/compressed/{vmlinux.lds.in => vmlinux.lds.S} | 0
 2 files changed, 1 insertion(+), 4 deletions(-)
 rename arch/unicore32/boot/compressed/{vmlinux.lds.in => vmlinux.lds.S} (100%)

diff --git a/arch/unicore32/boot/compressed/Makefile b/arch/unicore32/boot/compressed/Makefile
index 9aecdd3..150fafc 100644
--- a/arch/unicore32/boot/compressed/Makefile
+++ b/arch/unicore32/boot/compressed/Makefile
@@ -61,7 +61,4 @@ $(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/head.o $(obj)/piggy.o \
 ZTEXTADDR	:= 0x03000000
 ZBSSADDR	:= ALIGN(4)
 
-SEDFLAGS_lds	= s/TEXT_START/$(ZTEXTADDR)/;s/BSS_START/$(ZBSSADDR)/
-$(obj)/vmlinux.lds: $(obj)/vmlinux.lds.in arch/unicore32/boot/Makefile $(KCONFIG_CONFIG)
-	@sed "$(SEDFLAGS_lds)" < $< > $@
-
+CPPFLAGS_vmlinux.lds = -DTEXT_START="$(ZTEXTADDR)" -DBSS_START="$(ZBSSADDR)"
diff --git a/arch/unicore32/boot/compressed/vmlinux.lds.in b/arch/unicore32/boot/compressed/vmlinux.lds.S
similarity index 100%
rename from arch/unicore32/boot/compressed/vmlinux.lds.in
rename to arch/unicore32/boot/compressed/vmlinux.lds.S
-- 
2.7.4


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

* Re: [PATCH] unicore32: simplify linker script generation for decompressor
  2019-03-08  5:30 [PATCH] unicore32: simplify linker script generation for decompressor Masahiro Yamada
@ 2019-03-13 17:41 ` Masahiro Yamada
  0 siblings, 0 replies; 2+ messages in thread
From: Masahiro Yamada @ 2019-03-13 17:41 UTC (permalink / raw)
  To: Linux Kbuild mailing list; +Cc: Linux Kernel Mailing List, Guan Xuetao

On Fri, Mar 8, 2019 at 2:31 PM Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
>
> When I was searching for unneeded $(KCONFIG_CONFIG) usages, I noticed
> this strange build dependency.
>
> It can use $(call if_changed,...) in case ZTEXTADDR and ZBSSADDR are
> changed, but even a simpler way is to use the pattern rule in
> scripts/Makefile.build. This is what arch/arm/boot/compressed/Makefile
> does.
>
> I did only build test. I confirmed equivalent vmlinux.lds was generated.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---


Applied to linux-kbuild.



>  arch/unicore32/boot/compressed/Makefile                          | 5 +----
>  arch/unicore32/boot/compressed/{vmlinux.lds.in => vmlinux.lds.S} | 0
>  2 files changed, 1 insertion(+), 4 deletions(-)
>  rename arch/unicore32/boot/compressed/{vmlinux.lds.in => vmlinux.lds.S} (100%)
>
> diff --git a/arch/unicore32/boot/compressed/Makefile b/arch/unicore32/boot/compressed/Makefile
> index 9aecdd3..150fafc 100644
> --- a/arch/unicore32/boot/compressed/Makefile
> +++ b/arch/unicore32/boot/compressed/Makefile
> @@ -61,7 +61,4 @@ $(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/head.o $(obj)/piggy.o \
>  ZTEXTADDR      := 0x03000000
>  ZBSSADDR       := ALIGN(4)
>
> -SEDFLAGS_lds   = s/TEXT_START/$(ZTEXTADDR)/;s/BSS_START/$(ZBSSADDR)/
> -$(obj)/vmlinux.lds: $(obj)/vmlinux.lds.in arch/unicore32/boot/Makefile $(KCONFIG_CONFIG)
> -       @sed "$(SEDFLAGS_lds)" < $< > $@
> -
> +CPPFLAGS_vmlinux.lds = -DTEXT_START="$(ZTEXTADDR)" -DBSS_START="$(ZBSSADDR)"
> diff --git a/arch/unicore32/boot/compressed/vmlinux.lds.in b/arch/unicore32/boot/compressed/vmlinux.lds.S
> similarity index 100%
> rename from arch/unicore32/boot/compressed/vmlinux.lds.in
> rename to arch/unicore32/boot/compressed/vmlinux.lds.S
> --
> 2.7.4
>


-- 
Best Regards
Masahiro Yamada

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

end of thread, other threads:[~2019-03-13 17:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-08  5:30 [PATCH] unicore32: simplify linker script generation for decompressor Masahiro Yamada
2019-03-13 17:41 ` Masahiro Yamada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).