# HG changeset patch # User martin # Date 1529714235 25200 # Fri Jun 22 17:37:15 2018 -0700 # Node ID 0c82149ab6a2004b262f4f47aed441dc9603def6 # Parent 0dbb6117f9970bac6bef3d2e379082006e620c94 8186780: clang-4.0 fastdebug assertion failure in os_linux_x86:os::verify_stack_alignment() Reviewed-by: dholmes, erikj diff --git a/make/autoconf/flags-cflags.m4 b/make/autoconf/flags-cflags.m4 --- a/make/autoconf/flags-cflags.m4 +++ b/make/autoconf/flags-cflags.m4 @@ -491,6 +491,12 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER], # (see http://llvm.org/bugs/show_bug.cgi?id=7554) TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -flimit-debug-info" + # In principle the stack alignment below is cpu- and ABI-dependent and + # should agree with values of StackAlignmentInBytes in various + # src/hotspot/cpu/*/globalDefinitions_*.hpp files, but this value currently + # works for all platforms. + TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -mno-omit-leaf-frame-pointer -mstack-alignment=16" + if test "x$OPENJDK_TARGET_OS" = xlinux; then TOOLCHAIN_CFLAGS_JDK="-pipe" TOOLCHAIN_CFLAGS_JDK_CONLY="-fno-strict-aliasing" # technically NOT for CXX @@ -601,10 +607,6 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER], fi fi - if test "x$OPENJDK_TARGET_OS" = xmacosx; then - OS_CFLAGS_JVM="$OS_CFLAGS_JVM -mno-omit-leaf-frame-pointer -mstack-alignment=16" - fi - # Optional POSIX functionality needed by the JVM # # Check if clock_gettime is available and in which library. This indicates diff --git a/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp b/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp --- a/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp +++ b/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp @@ -93,7 +93,7 @@ #define SPELL_REG_FP "ebp" #endif // AMD64 -address os::current_stack_pointer() { +NOINLINE address os::current_stack_pointer() { #ifdef SPARC_WORKS register void *esp; __asm__("mov %%" SPELL_REG_SP ", %0":"=r"(esp));