[OpenBIOS] [PATCH] ppc: force target CPU

Mark Cave-Ayland mark.cave-ayland at ilande.co.uk
Tue Dec 29 18:12:42 CET 2015


On 29/12/15 17:01, Cole Robinson wrote:

> On 12/29/2015 11:43 AM, Mark Cave-Ayland wrote:
>> On 22/11/15 11:54, Mark Cave-Ayland wrote:
>>
>> (Add Hervé to CC)
>>
>>> On 21/11/15 16:00, Laurent Vivier wrote:
>>>
>>>> With gcc-5.2 default target is power7.
>>>> As openbios targets PowerMacs G3/G4/G5, force
>>>> gcc target to be G3 (32bit) or G5 (64bit).
>>>>
>>>> Signed-off-by: Laurent Vivier <laurent at vivier.eu>
>>>> ---
>>>>  config/scripts/switch-arch | 4 ++--
>>>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/config/scripts/switch-arch b/config/scripts/switch-arch
>>>> index 38d263d..bcf807a 100755
>>>> --- a/config/scripts/switch-arch
>>>> +++ b/config/scripts/switch-arch
>>>> @@ -265,7 +265,7 @@ for ARCH in $arch_list; do
>>>>          ppc)
>>>>          select_prefix powerpc powerpc64
>>>>          if [ "$unix" = "no" ]; then
>>>> -            CFLAGS="-m32 -msoft-float -fno-builtin-bcopy -fno-builtin-log2"
>>>> +            CFLAGS="-m32 -mcpu=G3 -msoft-float -fno-builtin-bcopy -fno-builtin-log2"
>>>>              AS_FLAGS="-m32"
>>>>          else
>>>>              CFLAGS="-fno-builtin"
>>>> @@ -275,7 +275,7 @@ for ARCH in $arch_list; do
>>>>  
>>>>          ppc64)
>>>>          select_prefix powerpc64
>>>> -        CFLAGS="-Wa,-a64 -m64 -msoft-float -fno-builtin"
>>>> +        CFLAGS="-Wa,-a64 -m64 -mcpu=G5 -msoft-float -fno-builtin"
>>>>          AS_FLAGS="-Wa,-a64"
>>>>          ;;
>>>>  
>>>
>>> Great work! Andreas, I'd be much happier if you could review/commit this
>>> (or at least give a Reviewed-by) as this is a little bit out of my area
>>> of knowledge...
>>
>> After some further research, there are currently 2 reasons that make me
>> feel we should be targeting earlier CPUs than the G3 for 32-bit OpenBIOS
>> builds: firstly there are some people trying to emulate PPC 604 CPUs
>> with QEMU/KVM which currently hangs in OpenBIOS, and secondly there has
>> been talk of switching over QEMU's PReP machine from OHW to OpenBIOS
>> instead.
>>
>> To that end the minimum supported CPU for PPC needs to be 602 and so
>> with this in mind, I've lightly tested the attached patch which seems to
>> work here - Cole, does this work on your compiler setup? If so, I think
>> this is the option I would like to apply upstream.
>>
> 
> That patch also fixes the build on fedora 23.

Great, thanks for testing Cole!


ATB,

Mark.




More information about the OpenBIOS mailing list