powerpc/boot: Fix rebuild when changing kernel endian
authorMichael Ellerman <mpe@ellerman.id.au>
Mon, 21 Nov 2016 10:14:35 +0000 (21:14 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 29 Nov 2016 10:42:34 +0000 (21:42 +1100)
Now that we don't set ARCH incorrectly when calling the boot Makefile,
we can use the generic cpp_lds_S rule for converting our zImage.lds.S
into zImage.lds.

The main advantage of using the generic rule is that it correctly uses
if_changed, which means we correctly regenerate the linker script when
switching endian. Fixing that means we are finally able to build one
endian and then rebuild the other endian without requiring to clean
between builds.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/boot/Makefile

index 7f3faa6255a846588783a090acf90902e70ff60f..1d41d5a9d05ed128775adfbce9a5e278b07ad654 100644 (file)
@@ -171,10 +171,6 @@ $(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 $@ $<
-
 $(obj)/zImage.coff.lds $(obj)/zImage.ps3.lds : $(obj)/%: $(srctree)/$(src)/%.S
        $(Q)cp $< $@