[PATCH] powerpc/boot: regenerate zImage linker script when options change

Subsystems: linux for powerpc (32-bit and 64-bit), the rest

STALE3540d

2 messages, 1 author, 2016-11-27 · open the first message on its own page

[PATCH] powerpc/boot: regenerate zImage linker script when options change

From: Nicholas Piggin <npiggin@gmail.com>
Date: 2016-11-26 04:00:12

Changing config options (e.g., endianness) does not always seem to
regenerate zImage.lds properly. Adapt the standard kernel linker script
build command and use that.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 arch/powerpc/boot/Makefile | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 0442516..cf60936 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -175,9 +175,12 @@ $(addprefix $(obj)/,$(libfdt) $(libfdtheader)): $(obj)/%: $(srctree)/scripts/dtc
 $(obj)/empty.c:
 	$(Q)touch $@
 
-$(obj)/zImage.lds: $(obj)/%: $(srctree)/$(src)/%.S
-	$(CROSS32CC) $(cpp_flags) -E -Wp,-MD,$(depfile) -P -Upowerpc \
-		-D__ASSEMBLY__ -DLINKER_SCRIPT -o $@ $<
+quiet_cmd_cpp_lds_S = LDS     $@
+	cmd_cpp_lds_S = $(CROSS32CC) $(cpp_flags) -E -Wp,-MD,$(depfile) -P \
+			-Upowerpc -D__ASSEMBLY__ -DLINKER_SCRIPT -o $@ $<
+
+$(obj)/zImage.lds: $(obj)/%: $(srctree)/$(src)/%.S FORCE
+	$(call if_changed_dep,cpp_lds_S)
 
 $(obj)/zImage.coff.lds $(obj)/zImage.ps3.lds : $(obj)/%: $(srctree)/$(src)/%.S
 	$(Q)cp $< $@
-- 
2.10.2

[PATCH v2] powerpc/boot: regenerate zImage linker script when options change

From: Nicholas Piggin <npiggin@gmail.com>
Date: 2016-11-27 03:22:07

Changing config options (e.g., endianness) does not always seem to
regenerate zImage.lds properly. Adapt the standard kernel linker script
build command and use that.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
Changes since v1:
- Using cmd_cpp_lds_S command name was causing it to actually use the
  generic kbuild linker script command, which among other things did
  not undefine powerpc, causing the linker script to break for 32-bit.
  Use a new name.

 arch/powerpc/boot/Makefile | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 0442516..06c19a7 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -175,9 +175,12 @@ $(addprefix $(obj)/,$(libfdt) $(libfdtheader)): $(obj)/%: $(srctree)/scripts/dtc
 $(obj)/empty.c:
 	$(Q)touch $@
 
-$(obj)/zImage.lds: $(obj)/%: $(srctree)/$(src)/%.S
-	$(CROSS32CC) $(cpp_flags) -E -Wp,-MD,$(depfile) -P -Upowerpc \
-		-D__ASSEMBLY__ -DLINKER_SCRIPT -o $@ $<
+quiet_cmd_zImage_lds_S = LDS     $@
+	cmd_zImage_lds_S = $(CROSS32CC) $(cpp_flags) -E -Wp,-MD,$(depfile) -P \
+			-Upowerpc -D__ASSEMBLY__ -DLINKER_SCRIPT -o $@ $<
+
+$(obj)/zImage.lds: $(obj)/%: $(srctree)/$(src)/%.S FORCE
+	$(call if_changed_dep,zImage_lds_S)
 
 $(obj)/zImage.coff.lds $(obj)/zImage.ps3.lds : $(obj)/%: $(srctree)/$(src)/%.S
 	$(Q)cp $< $@
-- 
2.10.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help