[PATCH] powerpc: e500: Fix compilation with gcc e500 compiler

Arnd Bergmann arnd at arndb.de
Sat Jul 9 06:06:46 AEST 2022


On Fri, Jul 8, 2022 at 7:14 PM Pali Rohár <pali at kernel.org> wrote:
>
> -ifeq ($(HAS_BIARCH),y)
> -ifeq ($(CROSS32_COMPILE),)
> -ifdef CONFIG_PPC32
> -# These options will be overridden by any -mcpu option that the CPU
> -# or platform code sets later on the command line, but they are needed
> -# to set a sane 32-bit cpu target for the 64-bit cross compiler which
> -# may default to the wrong ISA.
> -KBUILD_CFLAGS          += -mcpu=powerpc
> -KBUILD_AFLAGS          += -mcpu=powerpc
> -endif
> -endif

I think to remove these, we first need to ensure that /some/ option is
set for any of
the CPU options.
>
> -ifdef CONFIG_PPC32
> -ifdef CONFIG_PPC_E500MC
> -CFLAGS-y += $(call cc-option,-mcpu=e500mc,-mcpu=powerpc)
> -else
> +CFLAGS-$(CONFIG_PPC_E500MC) += $(call cc-option,-mcpu=e500mc,-mcpu=powerpc)
>  CFLAGS-$(CONFIG_E500) += $(call cc-option,-mcpu=8540 -msoft-float,-mcpu=powerpc)
> -endif
> -endif
>

And this part will not do what you want because CONFIG_PPC_E500MC is only
set when CONFIG_E500 is also set, so the -mcpu=e500mc option always
gets overridden by -mcpu=8540

         Arnd


More information about the Linuxppc-dev mailing list