Patch to enable build on s390x

Marc Glisse marc.glisse at inria.fr
Mon Sep 19 09:56:11 CEST 2011


On Sat, 17 Sep 2011, Mike Frysinger wrote:

> On Saturday, September 17, 2011 11:07:42 Marc Glisse wrote:
>> On Fri, 16 Sep 2011, Andreas Krebbel wrote:
>>>> Do these systems support a 32-bit ABI?  If they do, the compiler
>>>> should have an option controlling ABI.  Please try it, using something
>>>> trivial like hello.c.
>>>
>>> Yes. The toolchain for System z supports 2 differents ABIs:
>>> -m31 for 32 bit GPRs, 31 bit addressing - s390 <-- machine id (uname -r)
>>> -m64 for 64 bit GPRs, 64 bit addressing - s390x
>>
>> Does something like this work (ie doesn't change anything on s390, works
>> on s390x and with ABI=32 works like s390 on s390x)?
>>
>> --- a/configure.in	Sun Aug 21 20:08:38 2011 +0200
>> +++ b/configure.in	Sat Sep 17 16:45:31 2011 +0200
>> @@ -1119,6 +1119,13 @@
>>       gcc_cflags="$gcc_cflags $fomit_frame_pointer"
>>       path="s390"
>>       extra_functions="udiv_w_sdiv"
>> +    case $host_cpu in
>> +      s390x)
>> +        abilist="64 32"
>> +        gcc_64_cflags="$gcc_cflags"
>> +        gcc_32_cflags="$gcc_cflags -m31"
>> +	;;
>> +    esac
>>       ;;
>
> this doesnt help with the problem the original patch fixes:
> /home/vapier/gmp-5.0.2/build/.libs/libgmp.so: undefined reference to
> `sdiv_qrnnd'

I thought the problem with sdiv_qrnnd was caused by 
extra_functions="udiv_w_sdiv". When there is an abilist, the 64 bit ABI 
should only look at extra_functions_64 whereas the 32 bit one still reads 
extra_functions. So what I wrote should in effect remove 
extra_functions="udiv_w_sdiv" (and the same for path) for s390x.

I am not sure what I missed...

-- 
Marc Glisse


More information about the gmp-bugs mailing list