lkml.org 
[lkml]   [2022]   [Aug]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] powerpc/boot: Fix compilation of uImage for e500 platforms
Date
Commit 40a75584e526 ("powerpc/boot: Build wrapper for an appropriate CPU")
broke compilation of uImage target for mpc85xx platforms by powerpc e500
SPE capable cross compilers. After that commit build process throws error:

BOOTAS arch/powerpc/boot/crt0.o
powerpc-linux-gnuspe-gcc: error: unrecognized argument in option ‘-mcpu=powerpc’
powerpc-linux-gnuspe-gcc: note: valid arguments to ‘-mcpu=’ are: 8540 8548 native
make[1]: *** [arch/powerpc/boot/Makefile:231: arch/powerpc/boot/crt0.o] Error 1

Fix this issue by checking for CONFIG_PPC_E500MC / CONFIG_E500 options and
applying appropriate -mcpu options for building uImage boot code.

Fixes: 40a75584e526 ("powerpc/boot: Build wrapper for an appropriate CPU")
Cc: stable@vger.kernel.org
Signed-off-by: Pali Rohár <pali@kernel.org>
---
arch/powerpc/boot/Makefile | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index a9cd2ea4a861..d7cf5d87e4bc 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -44,8 +44,14 @@ else
BOOTCFLAGS += -m64 -mcpu=powerpc64
endif
else
+ifdef CONFIG_PPC_E500MC
+BOOTCFLAGS += -m32 $(call cc-option,-mcpu=e500mc,-mcpu=powerpc)
+else ifdef CONFIG_E500
+BOOTCFLAGS += -m32 $(call cc-option,-mcpu=8540 -msoft-float,-mcpu=powerpc)
+else
BOOTCFLAGS += -m32 -mcpu=powerpc
endif
+endif

BOOTCFLAGS += -isystem $(shell $(BOOTCC) -print-file-name=include)

--
2.20.1
\
 
 \ /
  Last update: 2022-08-20 12:54    [W:0.119 / U:0.364 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site