8205649: Make clang stack flags independent of OS
authormartin
Mon, 25 Jun 2018 20:58:01 -0700
changeset 50781 9f781ce22e7d
parent 50780 c9f193a8b671
child 50782 e92d48cf94f9
8205649: Make clang stack flags independent of OS Reviewed-by: erikj
make/autoconf/flags-cflags.m4
--- a/make/autoconf/flags-cflags.m4	Mon Jun 25 20:08:05 2018 -0700
+++ b/make/autoconf/flags-cflags.m4	Mon Jun 25 20:58:01 2018 -0700
@@ -491,6 +491,12 @@
     # (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 @@
     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