|
|
43ae3d |
# HG changeset patch
|
|
|
43ae3d |
# User andrew
|
|
|
43ae3d |
# Date 1526122977 -3600
|
|
|
43ae3d |
# Sat May 12 12:02:57 2018 +0100
|
|
|
43ae3d |
# Node ID 00ccc73498628a51a45301322e64ce2ad06e49be
|
|
|
43ae3d |
# Parent aecf9f48f7b5c6148b62713a6b746301435b57cc
|
|
|
43ae3d |
PR3533: HotSpot generates code with unaligned stack, crashes on SSE operations
|
|
|
43ae3d |
Summary: Enable -mstackrealign on x86 Linux as well as x86 Mac OS X
|
|
|
43ae3d |
|
|
|
43ae3d |
diff --git openjdk.orig///common/autoconf/hotspot-spec.gmk.in openjdk///common/autoconf/hotspot-spec.gmk.in
|
|
|
43ae3d |
--- openjdk.orig///common/autoconf/hotspot-spec.gmk.in
|
|
|
43ae3d |
+++ openjdk///common/autoconf/hotspot-spec.gmk.in
|
|
|
43ae3d |
@@ -110,7 +110,8 @@
|
|
|
43ae3d |
RC:=@HOTSPOT_RC@
|
|
|
43ae3d |
|
|
|
43ae3d |
EXTRA_CFLAGS=@LEGACY_EXTRA_CFLAGS@ $(NO_DELETE_NULL_POINTER_CHECKS_CFLAG) \
|
|
|
43ae3d |
- $(NO_LIFETIME_DSE_CFLAG) $(CXXSTD_CXXFLAG)
|
|
|
43ae3d |
+ $(NO_LIFETIME_DSE_CFLAG) $(CXXSTD_CXXFLAG) \
|
|
|
43ae3d |
+ $(REALIGN_CFLAG)
|
|
|
43ae3d |
EXTRA_CXXFLAGS=@LEGACY_EXTRA_CXXFLAGS@
|
|
|
43ae3d |
EXTRA_LDFLAGS=@LEGACY_EXTRA_LDFLAGS@
|
|
|
43ae3d |
|
|
|
43ae3d |
diff --git openjdk.orig///common/autoconf/spec.gmk.in openjdk///common/autoconf/spec.gmk.in
|
|
|
43ae3d |
--- openjdk.orig///common/autoconf/spec.gmk.in
|
|
|
43ae3d |
+++ openjdk///common/autoconf/spec.gmk.in
|
|
|
43ae3d |
@@ -333,6 +333,7 @@
|
|
|
43ae3d |
|
|
|
43ae3d |
NO_DELETE_NULL_POINTER_CHECKS_CFLAG=@NO_DELETE_NULL_POINTER_CHECKS_CFLAG@
|
|
|
43ae3d |
NO_LIFETIME_DSE_CFLAG=@NO_LIFETIME_DSE_CFLAG@
|
|
|
43ae3d |
+REALIGN_CFLAG=@REALIGN_CFLAG@
|
|
|
43ae3d |
CXXSTD_CXXFLAG=@CXXSTD_CXXFLAG@
|
|
|
43ae3d |
|
|
|
43ae3d |
CXX:=@FIXPATH@ @CCACHE@ @CXX@
|
|
|
43ae3d |
diff --git openjdk.orig///common/autoconf/toolchain.m4 openjdk///common/autoconf/toolchain.m4
|
|
|
43ae3d |
--- openjdk.orig///common/autoconf/toolchain.m4
|
|
|
43ae3d |
+++ openjdk///common/autoconf/toolchain.m4
|
|
|
43ae3d |
@@ -796,20 +796,16 @@
|
|
|
43ae3d |
#
|
|
|
43ae3d |
# NOTE: check for -mstackrealign needs to be below potential addition of -m32
|
|
|
43ae3d |
#
|
|
|
43ae3d |
- if test "x$OPENJDK_TARGET_CPU_BITS" = x32 && test "x$OPENJDK_TARGET_OS" = xmacosx; then
|
|
|
43ae3d |
+ if test "x$OPENJDK_TARGET_CPU" = xx86 && test "x$OPENJDK_TARGET_OS" = xmacosx -o \
|
|
|
43ae3d |
+ "x$OPENJDK_TARGET_OS" = xlinux; then
|
|
|
43ae3d |
# On 32-bit MacOSX the OS requires C-entry points to be 16 byte aligned.
|
|
|
43ae3d |
- # While waiting for a better solution, the current workaround is to use -mstackrealign.
|
|
|
43ae3d |
- CFLAGS="$CFLAGS -mstackrealign"
|
|
|
43ae3d |
- AC_MSG_CHECKING([if 32-bit compiler supports -mstackrealign])
|
|
|
43ae3d |
- AC_LINK_IFELSE([AC_LANG_SOURCE([[int main() { return 0; }]])],
|
|
|
43ae3d |
- [
|
|
|
43ae3d |
- AC_MSG_RESULT([yes])
|
|
|
43ae3d |
- ],
|
|
|
43ae3d |
- [
|
|
|
43ae3d |
- AC_MSG_RESULT([no])
|
|
|
43ae3d |
- AC_MSG_ERROR([The selected compiler $CXX does not support -mstackrealign! Try to put another compiler in the path.])
|
|
|
43ae3d |
- ]
|
|
|
43ae3d |
+ # While waiting for a better solution, the current workaround is to use -mstackrealign
|
|
|
43ae3d |
+ # This is also required on Linux systems which use libraries compiled with SSE instructions
|
|
|
43ae3d |
+ REALIGN_CFLAG="-mstackrealign"
|
|
|
43ae3d |
+ TOOLCHAIN_COMPILER_CHECK_ARGUMENTS([$REALIGN_CFLAG -Werror], [],
|
|
|
43ae3d |
+ AC_MSG_ERROR([The selected compiler $CXX does not support -mstackrealign! Try to put another compiler in the path.])
|
|
|
43ae3d |
)
|
|
|
43ae3d |
+ AC_SUBST([REALIGN_CFLAG])
|
|
|
43ae3d |
fi
|
|
|
43ae3d |
|
|
|
43ae3d |
C_FLAG_DEPS="-MMD -MF"
|