Skip to contentSkip to conversation

sh: decompressor: do not copy source files while building

PATCH In review Masahiro Yamada 2 participants 3 messages Oct 30, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sh: decompressor: do not copy source files while building

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.

---

 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
arch/sh/boot/compressed/.gitignore +0 -5
index 37aa53057369..cd16663bc7c8 100644
@@ -1,7 +1,2 @@
 # SPDX-License-Identifier: GPL-2.0-only
-ashiftrt.S
-ashldi3.c
-ashlsi3.S
-ashrsi3.S
-lshrsi3.S
 vmlinux.bin.*
arch/sh/boot/compressed/Makefile +6 -18
index 589d2d8a573d..2f53babd9249 100644
@@ -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
arch/sh/boot/compressed/ashiftrt.S new file +2 -0
new file mode 100644
index 000000000000..0f3b291a3f4b
@@ -0,0 +1,2 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#include "../../lib/ashiftrt.S"
arch/sh/boot/compressed/ashldi3.c new file +2 -0
new file mode 100644
index 000000000000..7cebd646df83
@@ -0,0 +1,2 @@
+// SPDX-License-Identifier: GPL-2.0-only
+#include "../../lib/ashldi3.c"
arch/sh/boot/compressed/ashlsi3.S new file +2 -0
new file mode 100644
index 000000000000..e354262b275f
@@ -0,0 +1,2 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#include "../../lib/ashlsi3.S"
arch/sh/boot/compressed/ashrsi3.S new file +2 -0
new file mode 100644
index 000000000000..e564be9a4dcd
@@ -0,0 +1,2 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#include "../../lib/ashrsi3.S"
arch/sh/boot/compressed/lshrsi3.S new file +2 -0
new file mode 100644
index 000000000000..5a8281b7e516
@@ -0,0 +1,2 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#include "../../lib/lshrsi3.S"
scripts/remove-stale-files +5 -0
index eb630ee287c3..ad5ba3ee1f5e 100755
@@ -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
Signature · 1 line
2.30.2
maintainer
#1 lore raw
Quoted 8 lines · Masahiro Yamada

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.

---

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

#2 lore raw
Quoted 16 lines · Rich Felker
Quoted 8 lines · Masahiro Yamada

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.

---

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.

Quoted 4 lines

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.

Signature · 2 lines
Best Regards
Masahiro Yamada