[SLOF] [PATCH v2] Allow to build SLOF on Little Endian host

Alexey Kardashevskiy aik at ozlabs.ru
Fri Oct 9 13:55:52 AEDT 2015


On 10/06/2015 11:45 PM, Dinar valeev wrote:
> From: Dinar Valeev <dvaleev at suse.com>
>
> Don't require cross compiler in order to build SLOF on ppc64le platform.
> Native compiler is capable to build ELFv1 BE binary. We just need to
> instruct it how to do it. By adding -mbig and -mabi=elfv1 flags
>
> Signed-off-by: Dinar Valeev <dvaleev at suse.com>
> ---
>   make.rules | 10 +++++++---
>   1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/make.rules b/make.rules
> index aebc4e3..40b48bc 100644
> --- a/make.rules
> +++ b/make.rules
> @@ -19,7 +19,11 @@
>   ARCH := $(shell uname -p)
>
>   # Auto-detect ppc64
> -ifeq ($(ARCH), ppc64)
> +ifeq (ppc64,$(findstring ppc64,$(ARCH)))
> +  ifeq ($(ARCH), ppc64le)
> +    EXTRA_CC       = -mbig -mabi=elfv1
> +    EXTRA_LD       = -mbig
> +  endif
>   CROSS          = ""
>   else
>   CROSS		?= powerpc64-linux-

The patch is ok but if I may, I'd ask to improve it by making CROSS a 
highest priority, even on ppc64 as this provides an easy way of using 
different GCC, can you please add this?



> @@ -31,8 +35,8 @@ HOSTCC		?= gcc
>   HOSTCFLAGS	= -g -Wall -W -O2 -I. -I../include
>   DD		= dd
>
> -ONLY_CC 	= $(CROSS)gcc -m$(CELLSIZE)
> -ONLY_AS 	= $(CROSS)as -m$(CELLSIZE)
> +ONLY_CC 	= $(CROSS)gcc -m$(CELLSIZE) $(EXTRA_CC)
> +ONLY_AS 	= $(CROSS)as -m$(CELLSIZE) $(EXTRA_LD)
>   ONLY_LD 	= $(CROSS)ld -melf$(CELLSIZE)ppc
>
>   # Verbose level:
>


-- 
Alexey


More information about the SLOF mailing list