Index: Makefile =================================================================== --- Makefile (revision 397102) +++ Makefile (working copy) @@ -45,7 +45,7 @@ BUILD_DEPENDS+= ${UNZIP_CMD}:${PORTSDIR}/archivers/unzip .endif -ONLY_FOR_ARCHS= i386 amd64 +ONLY_FOR_ARCHS= i386 amd64 armv6 WRKSRC= ${WRKDIR}/${PORTNAME} DOS2UNIX_FILES= jdk/src/bsd/doc/man/appletviewer.1 \ @@ -189,7 +189,7 @@ .else JRE_IMAGEDIR= ${JDK_BUILDDIR}/images/j2re-image .endif -JDK_OSARCH= bsd-${ARCH:S/i386/x86/:S/amd64/x86_64/} +JDK_OSARCH= bsd-${ARCH:S/i386/x86/:S/amd64/x86_64/:S/armv6/arm/} INSTALLDIR= ${PREFIX}/${PKGBASE} NO_CCACHE= yes @@ -260,6 +260,16 @@ .include +.if ${ARCH} == "armv6" +CONFIGURE_ARGS+= --with-jvm-variants=zero + +# we're building a zero build +JDK_BUILDDIR= ${WRKSRC}/build/${JDK_OSARCH}-normal-zero-${JDK_BUILD_TYPE} + +# libffi is needed for zerobuild +LIB_DEPENDS+= libffi.so:${PORTSDIR}/devel/libffi +.endif + .if ${PORT_OPTIONS:MDEBUG} JDK_BUILD_TYPE= slowdebug .elif ${PORT_OPTIONS:MDEBUGFAST} @@ -273,8 +283,12 @@ .include -BOOTSTRAP_JDKS= ${LOCALBASE}/openjdk8 \ - ${LOCALBASE}/openjdk7 +BOOTSTRAP_JDKS= ${LOCALBASE}/openjdk8 +.if ${ARCH} == "armv6" +BOOTSTRAP_JDKS+= ${LOCALBASE}/bootstrap-openjdk +.else +BOOTSTRAP_JDKS+= ${LOCALBASE}/openjdk7 +.endif # do we have valid native jdk installed? .for BJDK in ${BOOTSTRAP_JDKS} @@ -285,8 +299,14 @@ # if no valid jdk found, set dependency .if !defined(BOOTSTRAPJDKDIR) +. if ${ARCH} == "armv6" +# bootstrap-openjdk is based on openjdk7 and can compile openjdk8 +BOOTSTRAPJDKDIR?= ${LOCALBASE}/bootstrap-openjdk +BUILD_DEPENDS+= ${BOOTSTRAPJDKDIR}/bin/javac:${PORTSDIR}/java/bootstrap-openjdk +. else BOOTSTRAPJDKDIR?= ${LOCALBASE}/openjdk7 BUILD_DEPENDS+= ${BOOTSTRAPJDKDIR}/bin/javac:${PORTSDIR}/java/openjdk7 +. endif .endif # PR193009: work around the rtld bug @@ -358,6 +378,34 @@ .endif @${CHMOD} 755 ${WRKSRC}/configure +.if ${ARCH} == "armv6" + # From NetBSD http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/lang/openjdk7/hacks.mk + # Workaround incorrect constant folding of subnormals in javac when the FPU + # does not handle subnormal arithmetic, like on ARM in Flush-to-zero mode. + # These workarounds avoid underflow conditions during the bootstrap so the + # JDK can correctly build itself. Compiling or running programs other than + # openjdk itself on such hardware may still cause unexpected behaviour. + # + @${REINPLACE_CMD} -e 's|2.2250738585072014e-308d*|Double.longBitsToDouble(0x10000000000000L)|ig' \ + -e 's|0x1.0p-1022d*|Double.longBitsToDouble(0x10000000000000L)|ig' \ + -e 's|4.9e-324d*|Double.longBitsToDouble(0x1L)|ig' \ + -e 's|0x0.0000000000001p-1022d*|Double.longBitsToDouble(0x1L)|ig' \ + ${WRKSRC}/jdk/src/share/classes/sun/misc/DoubleConsts.java \ + ${WRKSRC}/jdk/src/share/classes/java/lang/Double.java + @${REINPLACE_CMD} -e 's|1.17549435e-38f*|Float.intBitsToFloat(0x800000)|ig' \ + -e 's|0x1.0p-126f*|Float.intBitsToFloat(0x800000)|ig' \ + -e 's|1.4e-45f*|Float.intBitsToFloat(0x1)|ig' \ + -e 's|0x0.000002P-126f*|Float.intBitsToFloat(0x1)|ig' \ + ${WRKSRC}/jdk/src/share/classes/sun/misc/FloatConsts.java \ + ${WRKSRC}/jdk/src/share/classes/java/lang/Float.java + @${REINPLACE_CMD} -e 's|n.floatValue() == 0.0f && !isZero(proper)|& \&\& Float.floatToIntBits(n) != 0x1|' \ + -e 's|n.doubleValue() == 0.0d && !isZero(proper)|& \&\& Double.doubleToLongBits(n) != 0x1L|' \ + ${WRKSRC}/langtools/src/share/classes/com/sun/tools/javac/parser/JavacParser.java + @${REINPLACE_CMD} -e 's|x == 0.0f && 1.0f / x > 0.0f|Float.floatToIntBits(x) == 0x0|g' \ + -e 's|x == 0.0d && 1.0d / x > 0.0d|Double.doubleToLongBits(x) == 0x0L|g' \ + ${WRKSRC}/langtools/src/share/classes/com/sun/tools/javac/jvm/Items.java +.endif + run-autotools-autoconf: @cd ${CONFIGURE_WRKSRC} && ${SETENV} ${AUTOTOOLS_ENV} bash autogen.sh @@ -384,14 +432,14 @@ @cd ${JDK_IMAGEDIR} && ${COPYTREE_SHARE} . ${STAGEDIR}${INSTALLDIR} @cd ${STAGEDIR}${INSTALLDIR} && \ ${FIND} bin jre/bin -type f -exec ${CHMOD} ${BINMODE} {} \; && \ - ${CHMOD} ${BINMODE} jre/lib/${ARCH}/jexec \ - jre/lib/${ARCH}/jspawnhelper lib/${ARCH}/jexec + ${CHMOD} ${BINMODE} jre/lib/${ARCH:S/armv6/arm/}/jexec \ + jre/lib/${ARCH:S/armv6/arm/}/jspawnhelper lib/${ARCH:S/armv6/arm/}/jexec @${ECHO} "@dir ${INSTALLDIR}/jre/lib/applet" >> ${TMPPLIST} .else @cd ${JRE_IMAGEDIR} && ${COPYTREE_SHARE} . ${STAGEDIR}${INSTALLDIR} @cd ${STAGEDIR}${INSTALLDIR} && \ ${FIND} bin -type f -exec ${CHMOD} ${BINMODE} {} \; && \ - ${CHMOD} ${BINMODE} lib/${ARCH}/jexec lib/${ARCH}/jspawnhelper + ${CHMOD} ${BINMODE} lib/${ARCH:S/armv6/arm/}/jexec lib/${ARCH:S/armv6/arm/}/jspawnhelper @${ECHO} "@dir ${INSTALLDIR}/lib/applet" >> ${TMPPLIST} .endif @${ECHO} "@unexec ${LOCALBASE}/bin/unregistervm ${INSTALLDIR}/bin/java" >> ${TMPPLIST} Index: files/patch-hotspot_src_os__cpu_bsd__zero_vm_atomic__bsd__zero.inline.hpp =================================================================== --- files/patch-hotspot_src_os__cpu_bsd__zero_vm_atomic__bsd__zero.inline.hpp (revision 0) +++ files/patch-hotspot_src_os__cpu_bsd__zero_vm_atomic__bsd__zero.inline.hpp (working copy) @@ -0,0 +1,46 @@ +--- hotspot/src/os_cpu/bsd_zero/vm/atomic_bsd_zero.inline.hpp.orig 2015-06-03 16:41:00 UTC ++++ hotspot/src/os_cpu/bsd_zero/vm/atomic_bsd_zero.inline.hpp +@@ -112,8 +112,16 @@ static inline int m68k_lock_test_and_set + * + */ + ++#if defined(__FreeBSD__) ++#include ++#define __kernel_cmpxchg(oldval, newval, ptr) (!atomic_cmpset_rel_32((volatile u_int32_t *)(ptr), (u_int32_t)(oldval), (u_int32_t)(newval))) ++#elif defined(__NetBSD__) ++#include ++#define __kernel_cmpxchg(oldval, newval, ptr) ((unsigned int)(oldval) != atomic_cas_uint((volatile unsigned int*)(ptr), (unsigned int)(oldval), (unsigned int)(newval))) ++#else + typedef int (__kernel_cmpxchg_t)(int oldval, int newval, volatile int *ptr); + #define __kernel_cmpxchg (*(__kernel_cmpxchg_t *) 0xffff0fc0) ++#endif + + + +@@ -177,7 +185,7 @@ inline void Atomic::store_ptr(intptr_t s + + inline jint Atomic::add(jint add_value, volatile jint* dest) { + #ifdef ARM +- return arm_add_and_fetch(dest, add_value); ++ return arm_add_and_fetch((volatile int*)dest, add_value); + #else + #ifdef M68K + return m68k_add_and_fetch(dest, add_value); +@@ -189,7 +197,7 @@ inline jint Atomic::add(jint add_value, + + inline intptr_t Atomic::add_ptr(intptr_t add_value, volatile intptr_t* dest) { + #ifdef ARM +- return arm_add_and_fetch(dest, add_value); ++ return arm_add_and_fetch((volatile int*)dest, add_value); + #else + #ifdef M68K + return m68k_add_and_fetch(dest, add_value); +@@ -286,7 +294,7 @@ inline intptr_t Atomic::cmpxchg_ptr(intp + volatile intptr_t* dest, + intptr_t compare_value) { + #ifdef ARM +- return arm_compare_and_swap(dest, compare_value, exchange_value); ++ return arm_compare_and_swap((volatile int*)dest, compare_value, exchange_value); + #else + #ifdef M68K + return m68k_compare_and_swap(dest, compare_value, exchange_value); Property changes on: files/patch-hotspot_src_os__cpu_bsd__zero_vm_atomic__bsd__zero.inline.hpp ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: files/patch-hotspot_src_os__cpu_bsd__zero_vm_orderAccess__bsd__zero.inline.hpp =================================================================== --- files/patch-hotspot_src_os__cpu_bsd__zero_vm_orderAccess__bsd__zero.inline.hpp (revision 0) +++ files/patch-hotspot_src_os__cpu_bsd__zero_vm_orderAccess__bsd__zero.inline.hpp (working copy) @@ -0,0 +1,21 @@ +ARM: Substitute Linux atomic ops with FreeBSD/NetBSD atomic ops + +--- hotspot/src/os_cpu/bsd_zero/vm/orderAccess_bsd_zero.inline.hpp.orig 2015-06-03 15:49:41 UTC ++++ hotspot/src/os_cpu/bsd_zero/vm/orderAccess_bsd_zero.inline.hpp +@@ -37,8 +37,16 @@ + * and gcc __sync_synchronize(); implementation does not use the kernel + * helper for all gcc versions so it is unreliable to use as well. + */ ++#if defined(__FreeBSD__) ++#include ++#define __kernel_dmb dmb ++#elif defined(__NetBSD__) ++#include ++#define __kernel_dmb membar_sync ++#else + typedef void (__kernel_dmb_t) (void); + #define __kernel_dmb (*(__kernel_dmb_t *) 0xffff0fa0) ++#endif + + #define FULL_MEM_BARRIER __kernel_dmb() + #define READ_MEM_BARRIER __kernel_dmb() Property changes on: files/patch-hotspot_src_os__cpu_bsd__zero_vm_orderAccess__bsd__zero.inline.hpp ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: files/patch-hotspot_src_os__cpu_bsd__zero_vm_os__bsd__zero.cpp =================================================================== --- files/patch-hotspot_src_os__cpu_bsd__zero_vm_os__bsd__zero.cpp (revision 0) +++ files/patch-hotspot_src_os__cpu_bsd__zero_vm_os__bsd__zero.cpp (working copy) @@ -0,0 +1,26 @@ +clang objects to redefining builtins. + +--- hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp.orig 2015-06-03 15:48:43 UTC ++++ hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp +@@ -446,21 +446,6 @@ extern "C" { + } + }; + +-///////////////////////////////////////////////////////////////////////////// +-// Implementations of atomic operations not supported by processors. +-// -- http://gcc.gnu.org/onlinedocs/gcc-4.2.1/gcc/Atomic-Builtins.html +- +-#ifndef _LP64 +-extern "C" { +- long long unsigned int __sync_val_compare_and_swap_8( +- volatile void *ptr, +- long long unsigned int oldval, +- long long unsigned int newval) { +- ShouldNotCallThis(); +- } +-}; +-#endif // !_LP64 +- + #ifndef PRODUCT + void os::verify_stack_alignment() { + } Property changes on: files/patch-hotspot_src_os__cpu_bsd__zero_vm_os__bsd__zero.cpp ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property