|
| 1 | +diff --git a/make/autoconf/lib-softfloat.m4 b/make/autoconf/lib-softfloat.m4 |
| 2 | +new file mode 100644 |
| 3 | +index 0000000..7fa1ed1 |
| 4 | +--- /dev/null |
| 5 | ++++ b/make/autoconf/lib-softfloat.m4 |
| 6 | +@@ -0,0 +1,57 @@ |
| 7 | ++# |
| 8 | ++# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. |
| 9 | ++# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
| 10 | ++# |
| 11 | ++# This code is free software; you can redistribute it and/or modify it |
| 12 | ++# under the terms of the GNU General Public License version 2 only, as |
| 13 | ++# published by the Free Software Foundation. Oracle designates this |
| 14 | ++# particular file as subject to the "Classpath" exception as provided |
| 15 | ++# by Oracle in the LICENSE file that accompanied this code. |
| 16 | ++# |
| 17 | ++# This code is distributed in the hope that it will be useful, but WITHOUT |
| 18 | ++# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 19 | ++# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 20 | ++# version 2 for more details (a copy is included in the LICENSE file that |
| 21 | ++# accompanied this code). |
| 22 | ++# |
| 23 | ++# You should have received a copy of the GNU General Public License version |
| 24 | ++# 2 along with this work; if not, write to the Free Software Foundation, |
| 25 | ++# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
| 26 | ++# |
| 27 | ++# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
| 28 | ++# or visit www.oracle.com if you need additional information or have any |
| 29 | ++# questions. |
| 30 | ++# |
| 31 | ++ |
| 32 | ++################################################################################ |
| 33 | ++# Setup softfloat helper |
| 34 | ++################################################################################ |
| 35 | ++AC_DEFUN_ONCE([LIB_SETUP_SOFTFLOAT], |
| 36 | ++[ |
| 37 | ++ AC_ARG_WITH(softfloat, [AS_HELP_STRING([--with-softfloat], |
| 38 | ++ [specify path to patched softfloat.a])]) |
| 39 | ++ |
| 40 | ++ if test "x$NEEDS_LIB_SOFTFLOAT" = xfalse; then |
| 41 | ++ if (test "x${with_softfloat}" != x && test "x${with_softfloat}" != xno); then |
| 42 | ++ AC_MSG_WARN([[softfloat not used, so --with-softfloat is ignored]]) |
| 43 | ++ fi |
| 44 | ++ SOFTFLOAT_LIBS= |
| 45 | ++ else |
| 46 | ++ SOFTFLOAT_FOUND=no |
| 47 | ++ |
| 48 | ++ if test "x${with_softfloat}" = xno; then |
| 49 | ++ AC_MSG_ERROR([It is not possible to disable the use of softfloat. Remove the --without-softfloat option.]) |
| 50 | ++ fi |
| 51 | ++ |
| 52 | ++ if test "x${with_softfloat}" != x; then |
| 53 | ++ SOFTFLOAT_LIBS="${with_softfloat}" |
| 54 | ++ SOFTFLOAT_FOUND=yes |
| 55 | ++ fi |
| 56 | ++ if test "x$SOFTFLOAT_FOUND" = xno; then |
| 57 | ++ HELP_MSG_MISSING_DEPENDENCY([softfloat]) |
| 58 | ++ AC_MSG_ERROR([Could not find softfloat! $HELP_MSG]) |
| 59 | ++ fi |
| 60 | ++ fi |
| 61 | ++ |
| 62 | ++ AC_SUBST(SOFTFLOAT_LIBS) |
| 63 | ++]) |
| 64 | +diff --git a/make/autoconf/libraries.m4 b/make/autoconf/libraries.m4 |
| 65 | +index 5bf8569..eec4be6 100644 |
| 66 | +--- a/make/autoconf/libraries.m4 |
| 67 | ++++ b/make/autoconf/libraries.m4 |
| 68 | +@@ -32,6 +32,7 @@ m4_include([lib-freetype.m4]) |
| 69 | + m4_include([lib-std.m4]) |
| 70 | + m4_include([lib-x11.m4]) |
| 71 | + m4_include([lib-fontconfig.m4]) |
| 72 | ++m4_include([lib-softfloat.m4]) |
| 73 | + |
| 74 | + ################################################################################ |
| 75 | + # Determine which libraries are needed for this configuration |
| 76 | +@@ -78,6 +79,13 @@ AC_DEFUN_ONCE([LIB_DETERMINE_DEPENDENCIES], |
| 77 | + NEEDS_LIB_ALSA=false |
| 78 | + fi |
| 79 | + |
| 80 | ++ if (test "x$OPENJDK_TARGET_CPU" == xarm && |
| 81 | ++ test "x$ARM_FLOAT_TYPE" = xsflt); then |
| 82 | ++ NEEDS_LIB_SOFTFLOAT=true |
| 83 | ++ else |
| 84 | ++ NEEDS_LIB_SOFTFLOAT=false |
| 85 | ++ fi |
| 86 | ++ |
| 87 | + # Check if ffi is needed |
| 88 | + if HOTSPOT_CHECK_JVM_VARIANT(zero); then |
| 89 | + NEEDS_LIB_FFI=true |
| 90 | +@@ -97,6 +105,7 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBRARIES], |
| 91 | + LIB_SETUP_FONTCONFIG |
| 92 | + LIB_SETUP_FREETYPE |
| 93 | + LIB_SETUP_ALSA |
| 94 | ++ LIB_SETUP_SOFTFLOAT |
| 95 | + LIB_SETUP_LIBFFI |
| 96 | + LIB_SETUP_BUNDLED_LIBS |
| 97 | + LIB_SETUP_MISC_LIBS |
| 98 | +diff --git a/make/autoconf/spec.gmk.in b/make/autoconf/spec.gmk.in |
| 99 | +index ec45949..f3b222e 100644 |
| 100 | +--- a/make/autoconf/spec.gmk.in |
| 101 | ++++ b/make/autoconf/spec.gmk.in |
| 102 | +@@ -343,6 +343,7 @@ FONTCONFIG_CFLAGS:=@FONTCONFIG_CFLAGS@ |
| 103 | + CUPS_CFLAGS:=@CUPS_CFLAGS@ |
| 104 | + ALSA_LIBS:=@ALSA_LIBS@ |
| 105 | + ALSA_CFLAGS:=@ALSA_CFLAGS@ |
| 106 | ++SOFTFLOAT_LIBS:=@SOFTFLOAT_LIBS@ |
| 107 | + LIBFFI_LIBS:=@LIBFFI_LIBS@ |
| 108 | + LIBFFI_CFLAGS:=@LIBFFI_CFLAGS@ |
| 109 | + ENABLE_LIBFFI_BUNDLING:=@ENABLE_LIBFFI_BUNDLING@ |
| 110 | +diff --git a/make/hotspot/lib/CompileJvm.gmk b/make/hotspot/lib/CompileJvm.gmk |
| 111 | +index a4b67f0..15f8ae6 100644 |
| 112 | +--- a/make/hotspot/lib/CompileJvm.gmk |
| 113 | ++++ b/make/hotspot/lib/CompileJvm.gmk |
| 114 | +@@ -49,6 +49,7 @@ JVM_LDFLAGS += \ |
| 115 | + |
| 116 | + JVM_LIBS += \ |
| 117 | + $(JVM_LIBS_FEATURES) \ |
| 118 | ++ $(SOFTFLOAT_LIBS) \ |
| 119 | + # |
| 120 | + |
| 121 | + # These files and directories are always excluded |
| 122 | +diff --git a/src/hotspot/cpu/arm/assembler_arm_32.hpp b/src/hotspot/cpu/arm/assembler_arm_32.hpp |
| 123 | +index 53d6d17..c949c63 100644 |
| 124 | +--- a/src/hotspot/cpu/arm/assembler_arm_32.hpp |
| 125 | ++++ b/src/hotspot/cpu/arm/assembler_arm_32.hpp |
| 126 | +@@ -1239,10 +1239,11 @@ extern int __aeabi_dcmpgt(double, double); |
| 127 | + |
| 128 | + // Imported code from glibc soft-fp bundle for |
| 129 | + // calculation accuracy improvement. See CR 6757269. |
| 130 | +-extern double __aeabi_fadd_glibc(float, float); |
| 131 | +-extern double __aeabi_fsub_glibc(float, float); |
| 132 | ++extern float __aeabi_fadd_glibc(float, float); |
| 133 | ++extern float __aeabi_fsub_glibc(float, float); |
| 134 | + extern double __aeabi_dadd_glibc(double, double); |
| 135 | + extern double __aeabi_dsub_glibc(double, double); |
| 136 | ++ |
| 137 | + }; |
| 138 | + #endif // __SOFTFP__ |
| 139 | + |
0 commit comments