FreeBSD Bugzilla – Attachment 158300 Details for
Bug 201308
java/openjdk8: Patches for armv6
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patches for armv6
java_openjdk8.patch (text/plain), 9.20 KB, created by
Mikael Urankar
on 2015-07-03 18:13:04 UTC
(
hide
)
Description:
patches for armv6
Filename:
MIME Type:
Creator:
Mikael Urankar
Created:
2015-07-03 18:13:04 UTC
Size:
9.20 KB
patch
obsolete
>--- Makefile (revision 391234) >+++ Makefile (working copy) >@@ -36,7 +36,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/java.1 \ >@@ -87,7 +87,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 >@@ -156,6 +156,21 @@ > > .include <bsd.port.options.mk> > >+.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} >+ >+# bootstrap-openjdk is based on openjdk7 and can compile openjdk8 >+BOOTSTRAP_JDKS= ${LOCALBASE}/bootstrap-openjdk >+BOOTSTRAPJDKDIR= ${LOCALBASE}/bootstrap-openjdk >+ >+# libffi is needed for zerobuild >+BUILD_DEPENDS+= ${BOOTSTRAPJDKDIR}/bin/javac:${PORTSDIR}/java/bootstrap-openjdk >+LIB_DEPENDS+= libffi.so:${PORTSDIR}/devel/libffi >+.endif >+ > .if ${PORT_OPTIONS:MDEBUG} > JDK_BUILD_TYPE= slowdebug > .elif ${PORT_OPTIONS:MDEBUGFAST} >@@ -246,6 +261,34 @@ > ${WRKSRC}/jdk/make/lib/ServiceabilityLibraries.gmk > @${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 > >@@ -272,14 +315,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} > > > >--- 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 <machine/atomic.h> >++#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 <sys/atomic.h> >++#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); > > > >--- 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 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 <machine/atomic.h> >++#define __kernel_dmb dmb >++#elif defined(__NetBSD__) >++#include <sys/atomic.h> >++#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() > > > >--- 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() { >+ } > > >--- files/patch-hotspot_src_share_vm_interpreter_interpreterRuntime.cpp (revision 0) >+++ files/patch-hotspot_src_share_vm_interpreter_interpreterRuntime.cpp (working copy) >@@ -0,0 +1,22 @@ >+http://hg.openjdk.java.net/jdk9/jdk9/hotspot/rev/a733dad6fc1e >+8067231: Zero builds fails after JDK-6898462 >+Summary: Interpreter::remove_activation_entry() is not defined for the C++ interpreter >+Reviewed-by: roland, coleenp >+Contributed-by: Severin Gehwolf <sgehwolf@redhat.com> >+ >+ >+--- hotspot/src/share/vm/interpreter/interpreterRuntime.cpp.orig 2015-03-27 09:45:45 UTC >++++ hotspot/src/share/vm/interpreter/interpreterRuntime.cpp >+@@ -407,7 +407,11 @@ IRT_ENTRY(address, InterpreterRuntime::e >+ // during deoptimization so the interpreter needs to skip it when >+ // the frame is popped. >+ thread->set_do_not_unlock_if_synchronized(true); >+- return Interpreter::remove_activation_entry(); >++#ifdef CC_INTERP >++ return (address) -1; >++#else >++ return Interpreter::remove_activation_entry(); >++#endif >+ } >+ >+ // Need to do this check first since when _do_not_unlock_if_synchronized
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 201308
:
158300
|
161175
|
161382
|
161412