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

Thomas Huth thuth at redhat.com
Tue Oct 6 23:10:36 AEDT 2015


On 06/10/15 13:54, 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 | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/make.rules b/make.rules
> index aebc4e3..143db6d 100644
> --- a/make.rules
> +++ b/make.rules
> @@ -19,7 +19,7 @@
>  ARCH := $(shell uname -p)
>  
>  # Auto-detect ppc64
> -ifeq ($(ARCH), ppc64)
> +ifeq (ppc64,$(findstring ppc64,$(ARCH)))
>  CROSS          = ""
>  else
>  CROSS		?= powerpc64-linux-
> @@ -31,8 +31,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) -mbig-endian -mabi=elfv1
> +ONLY_AS 	= $(CROSS)as -m$(CELLSIZE) -mbig
>  ONLY_LD 	= $(CROSS)ld -melf$(CELLSIZE)ppc

I'm afraid, but that does not work with "older" gcc versions, I get:

powerpc64-linux-gnu-gcc: error: unrecognized command line option
‘-mabi=elfv1’

Maybe you could add only add those options when the host is ppc64le ?

 Thomas




More information about the SLOF mailing list