[OpenBIOS] [PATCH] ppc: force target CPU

Laurent Vivier laurent at vivier.eu
Mon Jan 25 17:23:46 CET 2016



Le 25/01/2016 16:38, Programmingkid a écrit :
> 
> On Jan 25, 2016, at 10:23 AM, Laurent Vivier wrote:
> 
>>
>>
>> Le 25/01/2016 15:48, Programmingkid a écrit :
>>>
>>> On Jan 25, 2016, at 9:31 AM, Laurent Vivier wrote:
>>>
>>>>
>>>>
>>>> Le 22/01/2016 16:26, Mark Cave-Ayland a écrit :
>>>>> On 22/01/16 15:05, Andreas Färber wrote:
>>>>>
>>>>>> Am 22.01.2016 um 14:59 schrieb Mark Cave-Ayland:
>>>>>>> On 20/01/16 08:33, Laurent Vivier wrote:
>>>>>>>> Le 19/01/2016 21:33, Mark Cave-Ayland a écrit :
>>>>>>>>> Great! If we go with Segher's suggestion for 64-bit then we end up with
>>>>>>>>> this:
>>>>>>>>>
>>>>>>>>> 32-bit: -mcpu=604
>>>>>>>>> 64-bit: -mcpu=970 -mno-altivec
>>>>>>>>
>>>>>>>> I think you can use "-mcpu=power4" here, this is the old default value
>>>>>>>> for gcc.
>>>>>>>
>>>>>>> It seems they are effectively the same, so I don't have any strong
>>>>>>> preference either way.
>>>>>>
>>>>>> I prefer Mark's explicit variant, ideally with some explanatory comment.
>>>>>
>>>>> Thanks Andreas! Laurent, can you resubmit accordingly with a brief
>>>>> comment for each summarising why these flags have been chosen?
>>>>
>>>> I can, but I'm not able to build openbios for target ppc64 on ppc64 host.
>>>>
>>>> Is this normal ?
>>>
>>> It definitely shouldn't be.
>>>
>>>>
>>>> $ ./config/scripts/switch-arch ppc64
>>>> Configuring OpenBIOS on ppc64 for ppc64
>>>> Initializing build tree /home/laurent/Projects/openbios/obj-ppc64...ok.
>>>> Creating target config.mak...ok.
>>>> Creating target rules.mak...ok.
>>>> Creating config files...ok.
>>>> [laurent at pmacg5-1 openbios]$ make
>>>> Building OpenBIOS for ppc64
>>>> Building...
>>>> error:
>>>> HOSTCC host/kernel/dict.o
>>>> HOSTCC host/kernel/bootstrap.o
>>>> HOSTCC host/kernel/forth.o
>>>> HOSTCC host/kernel/stack.o
>>>> HOSTCC forthstrap
>>>> GEN   bootstrap.dict
>>>> panic: segmentation violation at 0x87a1062c
>>>> dict=0x3fff87a10010 here=0x3fff87a10638(dict+0x628) pc=0x0(dict+0x785efff0)
>>>> dstackcnt=0 rstackcnt=0 instruction=deadbeef
>>>> dstack: 0x0
>>>> rstack: 0x0
>>>> Writing dictionary core file
>>>> rules.mak:69: recipe for target 'bootstrap.dict' failed
>>>> make[1]: *** [bootstrap.dict] Error 1
>>>> make[1]: Leaving directory '/home/laurent/Projects/openbios/obj-ppc64'
>>>> Makefile:19: recipe for target 'build' failed
>>>> make: *** [build] Error 1
>>>
>>> What operating system are you using to build OpenBIOS on? 
>>
>> Fedora23/ppc64
>>
>>> Is your operating system 32 bit or 64 bit?
>>
>> 64bit. but I've tested on debian ppc 32bit and it fails for another reason:
>>
>>  CC    target/arch/ppc/qemu/init.o
>> /home/laurent/Projects/openbios/arch/ppc/qemu/init.c: In function ‘adler32’:
>> /home/laurent/Projects/openbios/arch/ppc/qemu/init.c:705:17: error: cast
>> to pointer from integer of different size [-Werror=int-to-pointer-cast]
>>     char *buf = (char *)POP();
>>                 ^
>> cc1: all warnings being treated as errors
>>
>>> What version of GCC are you using? 
>>>
>>
>> 64bit host: gcc (GCC) 5.1.1 20150618 (Red Hat 5.1.1-4)
>> 32bit host: gcc (Debian 4.9.2-10) 4.9.2
>>
>> Laurent
> 
> I use to have segmentation violations when I would compile OpenBIOS. The fix
> for me was to do this: 
> 
> HOSTARCH=amd64 ./switch-arch ppc
> 
> But you should try this:
> 
> HOSTARCH=ppc64 ./switch-arch ppc

The problem is not with "switch-arch ppc" but with "switch-arch ppc64"

and the result is the same.

> 
> Lets see what happens when you try it.
> 
> Also what is the output of your "uname -a" command on the 64 bit operating system?

Linux pmacg5-1 4.4.0+ #10 SMP Mon Jan 11 15:30:32 CET 2016 ppc64 ppc64
ppc64 GNU/Linux

Laurent



More information about the OpenBIOS mailing list