[SLOF] [PATCH v2] Allow to build SLOF on Little Endian host
Dinar Valeev
k0da at opensuse.org
Fri Oct 9 21:58:39 AEDT 2015
nvm,
make V=2 CROSS="foo/bar/" qemu
produces
foo/bar/gcc -m64 -mbig -mabi=elfv1 -g -O2 -fno-builtin -ffreestanding
-nostdinc -msoft-float -fno-strict-aliasing -mno-altivec
-mabi=no-altivec -fno-stack-protector -Wall -Wmissing-prototypes
-Wstrict-prototypes -DRTAS_NVRAM -DBROKEN_SC1 -DDHCPARCH=0x0C
-DRTAS_NVRAM -DBROKEN_SC1 -DDHCPARCH=0x0C
-I/root/SLOF/clients/net-snk/include -I/root/SLOF/lib/libc/include
-I/root/SLOF/include -I/root/SLOF/lib/libbootmsg
-I/root/SLOF/include/ppcp7 -I. -c -o init.o init.c
on LE, should do the same on BE
I'm sending V3 in a moment
On Fri, Oct 9, 2015 at 12:23 PM, Dinar Valeev <k0da at opensuse.org> wrote:
> On Fri, Oct 9, 2015 at 12:18 PM, Nikunj A Dadhania
> <nikunj at linux.vnet.ibm.com> wrote:
>> Dinar Valeev <k0da at opensuse.org> writes:
>>
>>> On 9 Oct 2015 04:56, "Alexey Kardashevskiy" <aik at ozlabs.ru> wrote:
>>>>
>>>> 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?
>>> I have to check how qemu builds slof. It might set CROSS explicitly.
>>
>> - CROSS = ""
>> + CROSS ?=
>>
>> Something like this will do the trick. Not tested :-)
> But qemu always sets it:
> https://github.com/qemu/qemu/blob/master/roms/Makefile#L136
>>
>>> But even without this patch, CROSS was always overridden on BE, no?
>>
>>
>> Regards
>> Nikunj
>>
More information about the SLOF
mailing list