diff mbox series

sh: decompressor: do not copy source files while building

Message ID 20211030175604.1716611-1-masahiroy@kernel.org (mailing list archive)
State New, archived
Headers show
Series sh: decompressor: do not copy source files while building | expand

Commit Message

Masahiro Yamada Oct. 30, 2021, 5:56 p.m. UTC
As commit 7ae4a78daacf ("ARM: 8969/1: decompressor: simplify libfdt
builds") stated, copying source files during the build time may not
end up with as clean code as expected.

Do similar for sh to clean up the Makefile and .gitignore.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 arch/sh/boot/compressed/.gitignore |  5 -----
 arch/sh/boot/compressed/Makefile   | 24 ++++++------------------
 arch/sh/boot/compressed/ashiftrt.S |  2 ++
 arch/sh/boot/compressed/ashldi3.c  |  2 ++
 arch/sh/boot/compressed/ashlsi3.S  |  2 ++
 arch/sh/boot/compressed/ashrsi3.S  |  2 ++
 arch/sh/boot/compressed/lshrsi3.S  |  2 ++
 scripts/remove-stale-files         |  5 +++++
 8 files changed, 21 insertions(+), 23 deletions(-)
 create mode 100644 arch/sh/boot/compressed/ashiftrt.S
 create mode 100644 arch/sh/boot/compressed/ashldi3.c
 create mode 100644 arch/sh/boot/compressed/ashlsi3.S
 create mode 100644 arch/sh/boot/compressed/ashrsi3.S
 create mode 100644 arch/sh/boot/compressed/lshrsi3.S

Comments

Rich Felker Oct. 30, 2021, 6:53 p.m. UTC | #1
On Sun, Oct 31, 2021 at 02:56:04AM +0900, Masahiro Yamada wrote:
> As commit 7ae4a78daacf ("ARM: 8969/1: decompressor: simplify libfdt
> builds") stated, copying source files during the build time may not
> end up with as clean code as expected.
> 
> Do similar for sh to clean up the Makefile and .gitignore.
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---

I think this is the same as "sh: boot: avoid unneeded rebuilds under
arch/sh/boot/compressed/" in commit 7fe859eef9 in linux-next, which
I've had in next but with no pull request sent for embarrassingly
long. It will be included in the PR for the new release cycle.

Sorry about the long delay. Let me know if there's anything else I
need to know about it. And thanks for the patch.

Rich
Masahiro Yamada Oct. 30, 2021, 7:02 p.m. UTC | #2
On Sun, Oct 31, 2021 at 3:55 AM Rich Felker <dalias@libc.org> wrote:
>
> On Sun, Oct 31, 2021 at 02:56:04AM +0900, Masahiro Yamada wrote:
> > As commit 7ae4a78daacf ("ARM: 8969/1: decompressor: simplify libfdt
> > builds") stated, copying source files during the build time may not
> > end up with as clean code as expected.
> >
> > Do similar for sh to clean up the Makefile and .gitignore.
> >
> > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> > ---
>
> I think this is the same as "sh: boot: avoid unneeded rebuilds under
> arch/sh/boot/compressed/" in commit 7fe859eef9 in linux-next, which
> I've had in next but with no pull request sent for embarrassingly
> long. It will be included in the PR for the new release cycle.
>
> Sorry about the long delay. Let me know if there's anything else I
> need to know about it. And thanks for the patch.
>
> Rich

Oh, I had forgotten it completely.

That's good to hear you will send a pull req in the next MW.

Thanks.
diff mbox series

Patch

diff --git a/arch/sh/boot/compressed/.gitignore b/arch/sh/boot/compressed/.gitignore
index 37aa53057369..cd16663bc7c8 100644
--- a/arch/sh/boot/compressed/.gitignore
+++ b/arch/sh/boot/compressed/.gitignore
@@ -1,7 +1,2 @@ 
 # SPDX-License-Identifier: GPL-2.0-only
-ashiftrt.S
-ashldi3.c
-ashlsi3.S
-ashrsi3.S
-lshrsi3.S
 vmlinux.bin.*
diff --git a/arch/sh/boot/compressed/Makefile b/arch/sh/boot/compressed/Makefile
index 589d2d8a573d..2f53babd9249 100644
--- a/arch/sh/boot/compressed/Makefile
+++ b/arch/sh/boot/compressed/Makefile
@@ -5,12 +5,12 @@ 
 # create a compressed vmlinux image from the original vmlinux
 #
 
+OBJECTS := head_32.o misc.o cache.o piggy.o \
+	   ashiftrt.o ashldi3.o ashrsi3.o ashlsi3.o lshrsi3.o
+
 targets		:= vmlinux vmlinux.bin vmlinux.bin.gz \
 		   vmlinux.bin.bz2 vmlinux.bin.lzma \
-		   vmlinux.bin.xz vmlinux.bin.lzo \
-		   head_32.o misc.o piggy.o
-
-OBJECTS = $(obj)/head_32.o $(obj)/misc.o $(obj)/cache.o
+		   vmlinux.bin.xz vmlinux.bin.lzo $(OBJECTS)
 
 GCOV_PROFILE := n
 
@@ -33,21 +33,9 @@  ccflags-remove-$(CONFIG_MCOUNT) += -pg
 LDFLAGS_vmlinux := --oformat $(ld-bfd) -Ttext $(IMAGE_OFFSET) -e startup \
 		   -T $(obj)/../../kernel/vmlinux.lds
 
-#
-# Pull in the necessary libgcc bits from the in-kernel implementation.
-#
-lib1funcs-y	:= ashiftrt.S ashldi3.c ashrsi3.S ashlsi3.S lshrsi3.S
-lib1funcs-obj   := \
-	$(addsuffix .o, $(basename $(addprefix $(obj)/, $(lib1funcs-y))))
-
-lib1funcs-dir		:= $(srctree)/arch/$(SRCARCH)/lib
-
-KBUILD_CFLAGS += -I$(lib1funcs-dir) -DDISABLE_BRANCH_PROFILING
-
-$(addprefix $(obj)/,$(lib1funcs-y)): $(obj)/%: $(lib1funcs-dir)/% FORCE
-	$(call cmd,shipped)
+KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING
 
-$(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o $(lib1funcs-obj) FORCE
+$(obj)/vmlinux: $(addprefix $(obj)/, $(OBJECTS)) FORCE
 	$(call if_changed,ld)
 
 $(obj)/vmlinux.bin: vmlinux FORCE
diff --git a/arch/sh/boot/compressed/ashiftrt.S b/arch/sh/boot/compressed/ashiftrt.S
new file mode 100644
index 000000000000..0f3b291a3f4b
--- /dev/null
+++ b/arch/sh/boot/compressed/ashiftrt.S
@@ -0,0 +1,2 @@ 
+/* SPDX-License-Identifier: GPL-2.0-only */
+#include "../../lib/ashiftrt.S"
diff --git a/arch/sh/boot/compressed/ashldi3.c b/arch/sh/boot/compressed/ashldi3.c
new file mode 100644
index 000000000000..7cebd646df83
--- /dev/null
+++ b/arch/sh/boot/compressed/ashldi3.c
@@ -0,0 +1,2 @@ 
+// SPDX-License-Identifier: GPL-2.0-only
+#include "../../lib/ashldi3.c"
diff --git a/arch/sh/boot/compressed/ashlsi3.S b/arch/sh/boot/compressed/ashlsi3.S
new file mode 100644
index 000000000000..e354262b275f
--- /dev/null
+++ b/arch/sh/boot/compressed/ashlsi3.S
@@ -0,0 +1,2 @@ 
+/* SPDX-License-Identifier: GPL-2.0-only */
+#include "../../lib/ashlsi3.S"
diff --git a/arch/sh/boot/compressed/ashrsi3.S b/arch/sh/boot/compressed/ashrsi3.S
new file mode 100644
index 000000000000..e564be9a4dcd
--- /dev/null
+++ b/arch/sh/boot/compressed/ashrsi3.S
@@ -0,0 +1,2 @@ 
+/* SPDX-License-Identifier: GPL-2.0-only */
+#include "../../lib/ashrsi3.S"
diff --git a/arch/sh/boot/compressed/lshrsi3.S b/arch/sh/boot/compressed/lshrsi3.S
new file mode 100644
index 000000000000..5a8281b7e516
--- /dev/null
+++ b/arch/sh/boot/compressed/lshrsi3.S
@@ -0,0 +1,2 @@ 
+/* SPDX-License-Identifier: GPL-2.0-only */
+#include "../../lib/lshrsi3.S"
diff --git a/scripts/remove-stale-files b/scripts/remove-stale-files
index eb630ee287c3..ad5ba3ee1f5e 100755
--- a/scripts/remove-stale-files
+++ b/scripts/remove-stale-files
@@ -28,4 +28,9 @@  if [ -n "${building_out_of_srctree}" ]; then
 	do
 		rm -f arch/arm/boot/compressed/${f}
 	done
+
+	for f in ashiftrt.S ashldi3.c ashrsi3.S ashlsi3.S lshrsi3.S
+	do
+		rm -f arch/sh/boot/compressed/${f}
+	done
 fi