Patch to enable build on s390x

Mike Frysinger vapier at gentoo.org
Mon Sep 19 16:55:06 CEST 2011


On Monday, September 19, 2011 03:56:11 Marc Glisse wrote:
> 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...

sorry, i think i tested the wrong tree.  after applying your patch, `make && 
make check` work.

however, most s390x systems don't bother shipping with multilib support, so 
this will now fail out of the box:
$ ./configure
checking build system type... s390x-ibm-linux-gnu
checking host system type... s390x-ibm-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking ABI=64
checking ABI=32
checking compiler gcc -O2 -pedantic -fomit-frame-pointer -m31 ... no
checking whether cc is gcc... yes
checking compiler cc -O2 -pedantic -fomit-frame-pointer -m31 ... no
configure: error: could not find a working compiler, see config.log for 
details

i have to explicitly do:
$ CC=gcc ABI=64 ./configure
in order to make it work
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://gmplib.org/list-archives/gmp-bugs/attachments/20110919/0a31a33e/attachment.bin>


More information about the gmp-bugs mailing list