Re: OpenJDK 8 & GCC 5

Aurelien Jarno <[email protected]>
Newsgroups gmane.linux.debian.ports.mips
Message-ID <[email protected]>
On 2015-12-15 19:52, James Cowgill wrote:
> Hi,
> 
> On Tue, 2015-12-15 at 12:42 +0100, Aurelien Jarno wrote:
> > OpenJDK 8 doesn't compile with GCC 5 on mips, presumably due to the
> > switch to the FPXX ABI [1]:
> > 
> > > /bin/bash ../../../../libtool   --mode=compile mipsel-linux-gnu-gcc-5 -DHAVE_CONFIG_H -I. -I../../../../../jamvm/src/os/linux/mips -I../../../../src  -I../../../../src -D_FORTIFY_SOURCE=2 -I../../../../src -g -fstack-protector-strong -Wformat -Werror=format-security -O3 -MT callNative.lo -MD -MP -MF .deps/callNative.Tpo -c -o callNative.lo ../../../../../jamvm/src/os/linux/mips/callNative.S
> > > libtool: compile:  mipsel-linux-gnu-gcc-5 -DHAVE_CONFIG_H -I. -I../../../../../jamvm/src/os/linux/mips -I../../../../src -I../../../../src -D_FORTIFY_SOURCE=2 -I../../../../src -g -fstack-protector-strong -Wformat -Werror=format-security -O3 -MT callNative.lo -MD -MP -MF .deps/callNative.Tpo -c ../../../../../jamvm/src/os/linux/mips/callNative.S  -fPIC -DPIC -o .libs/callNative.o
> > > ../../../../../jamvm/src/os/linux/mips/callNative.S: Assembler messages:
> > > ../../../../../jamvm/src/os/linux/mips/callNative.S:161: Error: float register should be even, was 1
> > > Makefile:298: recipe for target 'callNative.lo' failed
> > 
> > It is now built again with GCC 4.9, but we will eventually need to build
> > it with GCC 5. Therefore if someone has time to look at it, it would be
> > nice to provide patch.
> 
> I've attached a completely and utterly untested patch which might
> work...
> 

Thanks for the patch. The only concern with this patch is that it
increases the alignment requirement of a double from 32-bit from 64-bit.
OTOH, it's what the ABI requires.

> diff -u -ur a/src/os/linux/mips/callNative.S b/src/os/linux/mips/callNative.S
> --- a/src/os/linux/mips/callNative.S	2012-05-17 22:01:47.000000000 +0100
> +++ b/src/os/linux/mips/callNative.S	2015-12-15 19:46:03.679022719 +0000
> @@ -157,8 +157,7 @@
>  
>  ret_double:
>  #ifdef __mips_hard_float
> -	swc1 $f0,0($8)
> -	swc1 $f1,4($8)
> +	sdc1 $f0,0($8)
>  	addu $8,8
>  	j return
>  #endif

I have tried to build openjdk-8 with this patch on mipsel. It builds
fine and I haven't seen any regression in the testsuite.

Matthias, could you please add this patch in the next openjdk-8 upload
and switch again to GCC 5? Note that mipsel is currently still trying to
use GCC 5 due to a typo in the debian/rules file.

Thanks,
Aurelien

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
[email protected]                 http://www.aurel32.net
signature.asc (application/pgp-signature, 819 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBAgAGBQJWdtHdAAoJELqceAYd3Yyb1NAP/3YDppa3hB4bcj4RPi5yyz+b
1lveow3qJchXRLoR1HuwdX+OGic1KbzG/nHbsmBiDBt/rC/P70jDmg+wlIiKPYXi
8GK9ZrKz3sbFRbwyOb0FKroWT1MW8RecoIDSw6sSqmlrsJAKR8l1scPgAcVwLf7E
gITUDG1h4YiFQ+ceF5hzMeRwxWLNwLRmXA9WSM4luLKgtxCMMZFNfklwq09IHkMC
a/5FXp96qnWoAsAV27PpNQ328lauc1OvR+5EwwjhwHLZ8RDWWzBV9/1/EiAFVlnC
zO2HMgEKv67bxAmVvU4HcTKGIco7DF4TSPBfAgEL/8jnfQA7RCMl81sQj+KhZTfF
cxzSUg9NVCqS0QcMy1X3R6a+0ISFSEwD4Z57D73hcQIYqWv3T58+fkuF2tUMopM6
E2tX4Mdag+Fo4VoKZur2JlXHjG8Fu7yisQ6rT9/zcZKcdn1dySfo9oitE8bBezOt
jGORPXE17htk9MKfBXDrzNzK4I+Fyj3MY2n+Zf0NlH9A5AHY07heJp0SKMgxPLP7
h+kE24xK6jwIWNxuRbNIgXpl1LDySJdXadmZhtWXHQW0k+HHTJYrvlgSLU4q1+4S
uV77kwhY8fxuRm6fEUvVb+7FcoE+Hql94mDQgdc1HYjxHNfv8nc+uWSC7mesJkCb
wOre2J3avH0rwKKq+8lc
=3eTe
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.