Package: src:openjdk-7 Version: 2.3.12-4 Severity: important Tags: upstream patch Justification: fails to build from source
openjdk-7 fails to build on mips and mipsel with a SIGBUS when the JVM is executed. This is due to ugly casts in hotspot, which do not respect the alignment of the type it casts into, but instead only maintain a 32-bit alignement on 32-bit machine, even for 64-bit types. The problem appears only when built with GCC version greater than 4.4, as it seems GCC then started to be more aggressive about load/store optimisations. The attached patch fixes the problem. With it I was able to get a fairly decent testsuite result on both mips and mipsel (see below), comparable to the other architectures using zero and for which the testsuite is not disabled. mips ---- | --------------- jtreg console summary for hotspot --------------- | Error: compiler/5091921/Test6196102.java | Error: compiler/5091921/Test6850611.java | Error: compiler/5091921/Test6890943.java | Error: compiler/5091921/Test6897150.java | Error: compiler/5091921/Test6905845.java | Error: compiler/5091921/Test6931567.java | Error: compiler/5091921/Test6992759.java | Error: compiler/5091921/Test7020614.java | Error: compiler/6851282/Test.java | Error: compiler/6866651/Test.java | Error: compiler/6901572/Test.java | Error: compiler/6942326/Test.java | Error: compiler/7024475/Test7024475.java | Error: compiler/7047069/Test7047069.java | Error: compiler/7100757/Test7100757.java | FAILED: compiler/7141637/SpreadNullArg.java | FAILED: runtime/6929067/Test6929067.sh | Test results: passed: 146; failed: 2; error: 15 | --------------- jtreg console summary for langtools --------------- | FAILED: com/sun/javadoc/testJavascript/TestJavascript.java | FAILED: com/sun/javadoc/testNestedGenerics/TestNestedGenerics.java | Error: tools/javac/Diagnostics/6769027/T6769027.java | FAILED: tools/javac/processing/6499119/ClassProcessor.java | FAILED: tools/javac/T5090006/T5090006.java | Error: tools/javac/versions/check.sh | Test results: passed: 1,938; failed: 4; error: 2 | END jtreg-summary-zero mipsel ------ | --------------- jtreg console summary for hotspot --------------- | Error: compiler/5091921/Test6850611.java | Error: compiler/5091921/Test6890943.java | Error: compiler/5091921/Test6897150.java | Error: compiler/5091921/Test6905845.java | Error: compiler/5091921/Test6931567.java | Error: compiler/5091921/Test6992759.java | Error: compiler/5091921/Test7020614.java | Error: compiler/6663621/IVTest.java | Error: compiler/6851282/Test.java | Error: compiler/6866651/Test.java | Error: compiler/6901572/Test.java | Error: compiler/6942326/Test.java | Error: compiler/6968348/Test6968348.java | Error: compiler/7024475/Test7024475.java | Error: compiler/7047069/Test7047069.java | Error: compiler/7100757/Test7100757.java | FAILED: compiler/7141637/SpreadNullArg.java | FAILED: compiler/7158807/Test7158807.java | Error: runtime/6925573/SortMethodsTest.java | FAILED: runtime/6929067/Test6929067.sh | Test results: passed: 143; failed: 3; error: 17 | --------------- jtreg console summary for langtools --------------- | FAILED: com/sun/javadoc/testJavascript/TestJavascript.java | FAILED: com/sun/javadoc/testNestedGenerics/TestNestedGenerics.java | Error: tools/javac/Diagnostics/6769027/T6769027.java | Error: tools/javac/diags/RunExamples.java | FAILED: tools/javac/processing/6499119/ClassProcessor.java | FAILED: tools/javac/T5090006/T5090006.java | Error: tools/javac/versions/check.sh | Test results: passed: 1,937; failed: 4; error: 3 -- System Information: Debian Release: jessie/sid APT prefers unstable APT policy: (500, 'unstable') Architecture: mips (mips64) Kernel: Linux 3.2.0-4-5kc-malta Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash
diff -u openjdk-7-7u25-2.3.12/debian/control openjdk-7-7u25-2.3.12/debian/control --- openjdk-7-7u25-2.3.12/debian/control +++ openjdk-7-7u25-2.3.12/debian/control @@ -10,7 +10,7 @@ Vcs-Browser: https://code.launchpad.net/~openjdk/openjdk/openjdk7 Package: openjdk-7-jdk -Architecture: amd64 armel armhf arm64 i386 ia64 lpia powerpc powerpcspe ppc64 m68k sh4 sparc sparc64 s390 s390x x32 kfreebsd-i386 kfreebsd-amd64 +Architecture: amd64 armel armhf arm64 i386 ia64 lpia mips mipsel powerpc powerpcspe ppc64 m68k sh4 sparc sparc64 s390 s390x x32 kfreebsd-i386 kfreebsd-amd64 Multi-Arch: same Pre-Depends: ${dpkg:Depends} Depends: openjdk-7-jre (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} @@ -25,7 +25,7 @@ from the IcedTea project. Package: openjdk-7-jre-headless -Architecture: amd64 armel armhf arm64 i386 ia64 lpia powerpc powerpcspe ppc64 m68k sh4 sparc sparc64 s390 s390x x32 kfreebsd-i386 kfreebsd-amd64 +Architecture: amd64 armel armhf arm64 i386 ia64 lpia mips mipsel powerpc powerpcspe ppc64 m68k sh4 sparc sparc64 s390 s390x x32 kfreebsd-i386 kfreebsd-amd64 Multi-Arch: same Pre-Depends: ${dpkg:Depends}, ${multiarch:Depends} Depends: openjdk-7-jre-lib (= ${source:Version}), ${jredefault:Depends}, ${cacert:Depends}, ${tzdata:Depends}, ${jcommon:Depends}, ${dlopenhl:Depends}, ${shlibs:Depends}, ${misc:Depends} @@ -42,7 +42,7 @@ from the IcedTea project. Package: openjdk-7-jre -Architecture: amd64 armel armhf arm64 i386 ia64 lpia powerpc powerpcspe ppc64 m68k sh4 sparc sparc64 s390 s390x x32 kfreebsd-i386 kfreebsd-amd64 +Architecture: amd64 armel armhf arm64 i386 ia64 lpia mips mipsel powerpc powerpcspe ppc64 m68k sh4 sparc sparc64 s390 s390x x32 kfreebsd-i386 kfreebsd-amd64 Multi-Arch: same Pre-Depends: ${dpkg:Depends} Depends: openjdk-7-jre-headless (= ${binary:Version}), ${xandsound:Depends}, ${shlibs:Depends}, ${dlopenjre:Depends}, ${misc:Depends}, ${dep:bridge} @@ -71,7 +71,7 @@ from the IcedTea project. Package: openjdk-7-demo -Architecture: amd64 armel armhf arm64 i386 ia64 lpia powerpc powerpcspe ppc64 m68k sh4 sparc sparc64 s390 s390x x32 kfreebsd-i386 kfreebsd-amd64 +Architecture: amd64 armel armhf arm64 i386 ia64 lpia mips mipsel powerpc powerpcspe ppc64 m68k sh4 sparc sparc64 s390 s390x x32 kfreebsd-i386 kfreebsd-amd64 Priority: extra Pre-Depends: ${dpkg:Depends} Depends: openjdk-7-jre (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} @@ -113,7 +113,7 @@ from the IcedTea project. Package: openjdk-7-dbg -Architecture: amd64 armel armhf arm64 i386 ia64 lpia powerpc powerpcspe ppc64 m68k sh4 sparc sparc64 s390 s390x x32 kfreebsd-i386 kfreebsd-amd64 +Architecture: amd64 armel armhf arm64 i386 ia64 lpia mips mipsel powerpc powerpcspe ppc64 m68k sh4 sparc sparc64 s390 s390x x32 kfreebsd-i386 kfreebsd-amd64 Multi-Arch: same Priority: extra Section: debug diff -u openjdk-7-7u25-2.3.12/debian/rules openjdk-7-7u25-2.3.12/debian/rules --- openjdk-7-7u25-2.3.12/debian/rules +++ openjdk-7-7u25-2.3.12/debian/rules @@ -129,7 +129,7 @@ hotspot_version = $(if $(filter $(DEB_HOST_ARCH), $(hotspot_archs)),default,zero) hotspot_version = default -any_archs = amd64 armel armhf arm64 i386 ia64 lpia powerpc powerpcspe ppc64 m68k sh4 sparc sparc64 s390 s390x x32 kfreebsd-i386 kfreebsd-amd64 +any_archs = amd64 armel armhf arm64 i386 ia64 lpia mips mipsel powerpc powerpcspe ppc64 m68k sh4 sparc sparc64 s390 s390x x32 kfreebsd-i386 kfreebsd-amd64 stage1_gcj_archs = alpha amd64 armel armhf arm64 hppa i386 ia64 lpia powerpc powerpcspe ppc64 m68k mips mipsel sh4 sparc64 s390x x32 kfreebsd-i386 kfreebsd-amd64 stage1_openjdk_archs = s390 sparc stage1_cacao_archs = @@ -441,6 +441,7 @@ debian/patches/zero-opt.diff \ debian/patches/jdk-zero-arch.diff \ debian/patches/hotspot-powerpcspe.diff \ + debian/patches/hotspot-mips-align.diff \ # FIXME CACAO update needed #ifeq ($(DEB_HOST_ARCH),armel) --- openjdk-7-7u25-2.3.12.orig/debian/patches/hotspot-mips-align.diff +++ openjdk-7-7u25-2.3.12/debian/patches/hotspot-mips-align.diff @@ -0,0 +1,38 @@ +--- openjdk/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp ++++ openjdk/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp +@@ -56,7 +56,16 @@ + jlong l; + jdouble d; + uint32_t v[2]; +-}; ++} ++#ifndef _LP64 ++ /* Hotspot only aligns the union to the uintptr_t type, that is 32 bit ++ on a 32-bit CPU. Accesses to double values should be 64-bit aligned ++ on at least MIPS and SPARC. Declare it to GCC for all 32-bit CPUs, ++ as it might also help GCC to select the best instruction on other ++ CPUs. */ ++ __attribute__ ((packed, aligned (4))) ++#endif ++; + + + typedef class BytecodeInterpreter* interpreterState; +@@ -169,7 +178,16 @@ + jlong l; + jdouble d; + uint32_t v[2]; +-}; ++} ++#ifndef _LP64 ++ /* Hotspot only aligns the union to the uintptr_t type, that is 32 bit ++ on a 32-bit CPU. Accesses to double values should be 64-bit aligned ++ on at least MIPS and SPARC. Declare it to GCC for all 32-bit CPUs, ++ as it might also help GCC to select the best instruction on other ++ CPUs. */ ++ __attribute__ ((packed, aligned (4))) ++#endif ++; + + /* + * Generic 32-bit wide "Java slot" definition. This type occurs