Skip to contentSkip to conversation

parisc: decompressor: do not copy source files while building

PATCH In review Masahiro Yamada 2 participants 3 messages Dec 13, 2021 – Dec 21, 2021 PA-RISC architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 parisc: 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 parisc to clean up the Makefile.

---

 arch/parisc/boot/compressed/.gitignore | 2 --
 arch/parisc/boot/compressed/Makefile   | 8 --------
 arch/parisc/boot/compressed/firmware.c | 2 ++
 arch/parisc/boot/compressed/real2.S    | 2 ++
 scripts/remove-stale-files             | 5 +++++
 5 files changed, 9 insertions(+), 10 deletions(-)
 create mode 100644 arch/parisc/boot/compressed/firmware.c
 create mode 100644 arch/parisc/boot/compressed/real2.S
arch/parisc/boot/compressed/.gitignore +0 -2
index b9853a356ab2..a5839aa16706 100644
@@ -1,6 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0-only
-firmware.c
-real2.S
 sizes.h
 vmlinux
 vmlinux.lds
arch/parisc/boot/compressed/Makefile +0 -8
index bf4f2891d0b7..116bd5c1873c 100644
@@ -13,7 +13,6 @@ OBJECTS := head.o real2.o firmware.o misc.o piggy.o
 targets := vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2
 targets += vmlinux.bin.xz vmlinux.bin.lzma vmlinux.bin.lzo vmlinux.bin.lz4
 targets += $(OBJECTS) sizes.h
-targets += real2.S firmware.c
 
 KBUILD_CFLAGS := -D__KERNEL__ -O2 -DBOOTLOADER
 KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING
@@ -42,14 +41,7 @@ $(obj)/head.o: $(obj)/sizes.h
 CFLAGS_misc.o += -I$(objtree)/$(obj)
 $(obj)/misc.o: $(obj)/sizes.h
 
-$(obj)/firmware.o: $(obj)/firmware.c
-$(obj)/firmware.c: $(srctree)/arch/$(SRCARCH)/kernel/firmware.c
-	$(call cmd,shipped)
-
 AFLAGS_real2.o += -DBOOTLOADER
-$(obj)/real2.o: $(obj)/real2.S
-$(obj)/real2.S: $(srctree)/arch/$(SRCARCH)/kernel/real2.S
-	$(call cmd,shipped)
 
 CPPFLAGS_vmlinux.lds += -I$(objtree)/$(obj) -DBOOTLOADER
 $(obj)/vmlinux.lds: $(obj)/sizes.h
arch/parisc/boot/compressed/firmware.c new file +2 -0
new file mode 100644
index 000000000000..16a07137fe92
@@ -0,0 +1,2 @@
+// SPDX-License-Identifier: GPL-2.0-only
+#include "../../kernel/firmware.c"
arch/parisc/boot/compressed/real2.S new file +2 -0
new file mode 100644
index 000000000000..cdc6a4da3240
@@ -0,0 +1,2 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#include "../../kernel/real2.S"
scripts/remove-stale-files +5 -0
index f0d53227fe7b..80430b8fb617 100755
@@ -33,4 +33,9 @@ if [ -n "${building_out_of_srctree}" ]; then
 	do
 		rm -f arch/mips/boot/compressed/${f}
 	done
+
+	for f in firmware.c real2.S
+	do
+		rm -f arch/parisc/boot/compressed/${f}
+	done
 fi
Signature · 1 line
2.32.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 7 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 parisc to clean up the Makefile.

Thanks!
Helge

Quoted 80 lines

---

 arch/parisc/boot/compressed/.gitignore | 2 --
 arch/parisc/boot/compressed/Makefile   | 8 --------
 arch/parisc/boot/compressed/firmware.c | 2 ++
 arch/parisc/boot/compressed/real2.S    | 2 ++
 scripts/remove-stale-files             | 5 +++++
 5 files changed, 9 insertions(+), 10 deletions(-)
 create mode 100644 arch/parisc/boot/compressed/firmware.c
 create mode 100644 arch/parisc/boot/compressed/real2.S
arch/parisc/boot/compressed/.gitignore +0 -2
index b9853a356ab2..a5839aa16706 100644
@@ -1,6 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0-only
-firmware.c
-real2.S
 sizes.h
 vmlinux
 vmlinux.lds
arch/parisc/boot/compressed/Makefile +0 -8
index bf4f2891d0b7..116bd5c1873c 100644
@@ -13,7 +13,6 @@ OBJECTS := head.o real2.o firmware.o misc.o piggy.o
 targets := vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2
 targets += vmlinux.bin.xz vmlinux.bin.lzma vmlinux.bin.lzo vmlinux.bin.lz4
 targets += $(OBJECTS) sizes.h
-targets += real2.S firmware.c
 
 KBUILD_CFLAGS := -D__KERNEL__ -O2 -DBOOTLOADER
 KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING
@@ -42,14 +41,7 @@ $(obj)/head.o: $(obj)/sizes.h
 CFLAGS_misc.o += -I$(objtree)/$(obj)
 $(obj)/misc.o: $(obj)/sizes.h
 
-$(obj)/firmware.o: $(obj)/firmware.c
-$(obj)/firmware.c: $(srctree)/arch/$(SRCARCH)/kernel/firmware.c
-	$(call cmd,shipped)
-
 AFLAGS_real2.o += -DBOOTLOADER
-$(obj)/real2.o: $(obj)/real2.S
-$(obj)/real2.S: $(srctree)/arch/$(SRCARCH)/kernel/real2.S
-	$(call cmd,shipped)
 
 CPPFLAGS_vmlinux.lds += -I$(objtree)/$(obj) -DBOOTLOADER
 $(obj)/vmlinux.lds: $(obj)/sizes.h
arch/parisc/boot/compressed/firmware.c new file +2 -0
new file mode 100644
index 000000000000..16a07137fe92
@@ -0,0 +1,2 @@
+// SPDX-License-Identifier: GPL-2.0-only
+#include "../../kernel/firmware.c"
arch/parisc/boot/compressed/real2.S new file +2 -0
new file mode 100644
index 000000000000..cdc6a4da3240
@@ -0,0 +1,2 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#include "../../kernel/real2.S"
scripts/remove-stale-files +5 -0
index f0d53227fe7b..80430b8fb617 100755
@@ -33,4 +33,9 @@ if [ -n "${building_out_of_srctree}" ]; then
 	do
 		rm -f arch/mips/boot/compressed/${f}
 	done
+
+	for f in firmware.c real2.S
+	do
+		rm -f arch/parisc/boot/compressed/${f}
+	done
 fi
#2 lore raw
Quoted 6 lines · Helge Deller
Quoted 4 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.

Quoted 6 lines
Quoted 3 lines

Do similar for parisc to clean up the Makefile.

Can you apply it to your tree?
Thanks.

Quoted 84 lines

Thanks!
Helge

Quoted 80 lines

---

 arch/parisc/boot/compressed/.gitignore | 2 --
 arch/parisc/boot/compressed/Makefile   | 8 --------
 arch/parisc/boot/compressed/firmware.c | 2 ++
 arch/parisc/boot/compressed/real2.S    | 2 ++
 scripts/remove-stale-files             | 5 +++++
 5 files changed, 9 insertions(+), 10 deletions(-)
 create mode 100644 arch/parisc/boot/compressed/firmware.c
 create mode 100644 arch/parisc/boot/compressed/real2.S
arch/parisc/boot/compressed/.gitignore +0 -2
index b9853a356ab2..a5839aa16706 100644
@@ -1,6 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0-only
-firmware.c
-real2.S
 sizes.h
 vmlinux
 vmlinux.lds
arch/parisc/boot/compressed/Makefile +0 -8
index bf4f2891d0b7..116bd5c1873c 100644
@@ -13,7 +13,6 @@ OBJECTS := head.o real2.o firmware.o misc.o piggy.o
 targets := vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2
 targets += vmlinux.bin.xz vmlinux.bin.lzma vmlinux.bin.lzo vmlinux.bin.lz4
 targets += $(OBJECTS) sizes.h
-targets += real2.S firmware.c
 
 KBUILD_CFLAGS := -D__KERNEL__ -O2 -DBOOTLOADER
 KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING
@@ -42,14 +41,7 @@ $(obj)/head.o: $(obj)/sizes.h
 CFLAGS_misc.o += -I$(objtree)/$(obj)
 $(obj)/misc.o: $(obj)/sizes.h
 
-$(obj)/firmware.o: $(obj)/firmware.c
-$(obj)/firmware.c: $(srctree)/arch/$(SRCARCH)/kernel/firmware.c
-     $(call cmd,shipped)
-
 AFLAGS_real2.o += -DBOOTLOADER
-$(obj)/real2.o: $(obj)/real2.S
-$(obj)/real2.S: $(srctree)/arch/$(SRCARCH)/kernel/real2.S
-     $(call cmd,shipped)
 
 CPPFLAGS_vmlinux.lds += -I$(objtree)/$(obj) -DBOOTLOADER
 $(obj)/vmlinux.lds: $(obj)/sizes.h
arch/parisc/boot/compressed/firmware.c new file +2 -0
new file mode 100644
index 000000000000..16a07137fe92
@@ -0,0 +1,2 @@
+// SPDX-License-Identifier: GPL-2.0-only
+#include "../../kernel/firmware.c"
arch/parisc/boot/compressed/real2.S new file +2 -0
new file mode 100644
index 000000000000..cdc6a4da3240
@@ -0,0 +1,2 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#include "../../kernel/real2.S"
scripts/remove-stale-files +5 -0
index f0d53227fe7b..80430b8fb617 100755
@@ -33,4 +33,9 @@ if [ -n "${building_out_of_srctree}" ]; then
      do
              rm -f arch/mips/boot/compressed/${f}
      done
+
+     for f in firmware.c real2.S
+     do
+             rm -f arch/parisc/boot/compressed/${f}
+     done
 fi
Signature · 2 lines
Best Regards
Masahiro Yamada