--- a/common/autoconf/flags.m4 Thu Jul 13 19:34:22 2017 +0000
+++ b/common/autoconf/flags.m4 Fri Jul 14 13:02:27 2017 -0700
@@ -996,7 +996,6 @@
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -D_DARWIN_C_SOURCE -D_XOPEN_SOURCE"
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -fno-rtti -fno-exceptions -fvisibility=hidden \
-mno-omit-leaf-frame-pointer -mstack-alignment=16 -pipe -fno-strict-aliasing \
- -DMAC_OS_X_VERSION_MAX_ALLOWED=1070 -mmacosx-version-min=10.7.0 \
-fno-omit-frame-pointer"
elif test "x$OPENJDK_$1_OS" = xaix; then
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -DAIX"
@@ -1081,18 +1080,50 @@
# Additional macosx handling
if test "x$OPENJDK_$1_OS" = xmacosx; then
- # Setting these parameters makes it an error to link to macosx APIs that are
- # newer than the given OS version and makes the linked binaries compatible
- # even if built on a newer version of the OS.
- # The expected format is X.Y.Z
+ # MACOSX_VERSION_MIN is the c++ and ld is -mmacosx-version-min argument. The expected
+ # format is X.Y.Z. It's hard-coded to the minimum OSX version on which the
+ # JDK can be built and makes the linked binaries compatible even if built on
+ # a newer version of the OS.
MACOSX_VERSION_MIN=10.7.0
AC_SUBST(MACOSX_VERSION_MIN)
- # The macro takes the version with no dots, ex: 1070
+ # Setting --with-macosx-version-max=<version> makes it an error to build or
+ # link to macosx APIs that are newer than the given OS version. The expected
+ # format for <version> is either nn.n.n or nn.nn.nn. See /usr/include/AvailabilityMacros.h.
+ AC_ARG_WITH([macosx-version-max], [AS_HELP_STRING([--with-macosx-version-max],
+ [error on use of newer functionality. @<:@macosx@:>@])],
+ [
+ if echo "$with_macosx_version_max" | $GREP -q "^[[0-9]][[0-9]]\.[[0-9]]\.[[0-9]]\$"; then
+ MACOSX_VERSION_MAX=$with_macosx_version_max
+ elif echo "$with_macosx_version_max" | $GREP -q "^[[0-9]][[0-9]]\.[[0-9]][[0-9]]\.[[0-9]][[0-9]]\$"; then
+ MACOSX_VERSION_MAX=$with_macosx_version_max
+ elif test "x$with_macosx_version_max" = "xno"; then
+ # Use build system default
+ MACOSX_VERSION_MAX=
+ else
+ AC_MSG_ERROR([osx version format must be nn.n.n or nn.nn.nn])
+ fi
+ ],
+ [MACOSX_VERSION_MAX=]
+ )
+ AC_SUBST(MACOSX_VERSION_MAX)
+
# Let the flags variables get resolved in make for easier override on make
- # command line.
- $2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -DMAC_OS_X_VERSION_MAX_ALLOWED=\$(subst .,,\$(MACOSX_VERSION_MIN)) -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
+ # command line. AvailabilityMacros.h versions have no dots, ex: 1070.
+ $2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK \
+ -DMAC_OS_X_VERSION_MIN_REQUIRED=\$(subst .,,\$(MACOSX_VERSION_MIN)) \
+ -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
$2LDFLAGS_JDK="[$]$2LDFLAGS_JDK -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
+ $2JVM_CFLAGS="[$]$2JVM_CFLAGS \
+ -DMAC_OS_X_VERSION_MIN_REQUIRED=\$(subst .,,\$(MACOSX_VERSION_MIN)) \
+ -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
+
+ if test -n "$MACOSX_VERSION_MAX"; then
+ $2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK \
+ -DMAC_OS_X_VERSION_MAX_ALLOWED=\$(subst .,,\$(MACOSX_VERSION_MAX))"
+ $2JVM_CFLAGS="[$]$2JVM_CFLAGS \
+ -DMAC_OS_X_VERSION_MAX_ALLOWED=\$(subst .,,\$(MACOSX_VERSION_MAX))"
+ fi
fi
# Setup some hard coded includes
--- a/common/autoconf/generated-configure.sh Thu Jul 13 19:34:22 2017 +0000
+++ b/common/autoconf/generated-configure.sh Fri Jul 14 13:02:27 2017 -0700
@@ -749,6 +749,7 @@
CXXFLAGS_JDKLIB
CFLAGS_JDKEXE
CFLAGS_JDKLIB
+MACOSX_VERSION_MAX
MACOSX_VERSION_MIN
CXXSTD_CXXFLAG
JDK_ARCH_ABI_PROP_NAME
@@ -1182,6 +1183,7 @@
with_build_devkit
with_jtreg
with_abi_profile
+with_macosx_version_max
enable_warnings_as_errors
with_native_debug_symbols
enable_debug_symbols
@@ -2132,6 +2134,8 @@
(arm-vfp-sflt,arm-vfp-hflt,arm-sflt,
armv5-vfp-sflt,armv6-vfp-hflt,arm64,aarch64)
[toolchain dependent]
+ --with-macosx-version-max
+ error on use of newer functionality. [macosx]
--with-native-debug-symbols
set the native debug symbol configuration (none,
internal, external, zipped) [varying]
@@ -5189,7 +5193,7 @@
#CUSTOM_AUTOCONF_INCLUDE
# Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1496926402
+DATE_WHEN_GENERATED=1500048914
###############################################################################
#
@@ -51461,7 +51465,6 @@
JVM_CFLAGS="$JVM_CFLAGS -D_DARWIN_C_SOURCE -D_XOPEN_SOURCE"
JVM_CFLAGS="$JVM_CFLAGS -fno-rtti -fno-exceptions -fvisibility=hidden \
-mno-omit-leaf-frame-pointer -mstack-alignment=16 -pipe -fno-strict-aliasing \
- -DMAC_OS_X_VERSION_MAX_ALLOWED=1070 -mmacosx-version-min=10.7.0 \
-fno-omit-frame-pointer"
elif test "x$OPENJDK_TARGET_OS" = xaix; then
JVM_CFLAGS="$JVM_CFLAGS -DAIX"
@@ -51635,18 +51638,54 @@
# Additional macosx handling
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
- # Setting these parameters makes it an error to link to macosx APIs that are
- # newer than the given OS version and makes the linked binaries compatible
- # even if built on a newer version of the OS.
- # The expected format is X.Y.Z
+ # MACOSX_VERSION_MIN is the c++ and ld is -mmacosx-version-min argument. The expected
+ # format is X.Y.Z. It's hard-coded to the minimum OSX version on which the
+ # JDK can be built and makes the linked binaries compatible even if built on
+ # a newer version of the OS.
MACOSX_VERSION_MIN=10.7.0
- # The macro takes the version with no dots, ex: 1070
+ # Setting --with-macosx-version-max=<version> makes it an error to build or
+ # link to macosx APIs that are newer than the given OS version. The expected
+ # format for <version> is either nn.n.n or nn.nn.nn. See /usr/include/AvailabilityMacros.h.
+
+# Check whether --with-macosx-version-max was given.
+if test "${with_macosx_version_max+set}" = set; then :
+ withval=$with_macosx_version_max;
+ if echo "$with_macosx_version_max" | $GREP -q "^[0-9][0-9]\.[0-9]\.[0-9]\$"; then
+ MACOSX_VERSION_MAX=$with_macosx_version_max
+ elif echo "$with_macosx_version_max" | $GREP -q "^[0-9][0-9]\.[0-9][0-9]\.[0-9][0-9]\$"; then
+ MACOSX_VERSION_MAX=$with_macosx_version_max
+ elif test "x$with_macosx_version_max" = "xno"; then
+ # Use build system default
+ MACOSX_VERSION_MAX=
+ else
+ as_fn_error $? "osx version format must be nn.n.n or nn.nn.nn" "$LINENO" 5
+ fi
+
+else
+ MACOSX_VERSION_MAX=
+
+fi
+
+
+
# Let the flags variables get resolved in make for easier override on make
- # command line.
- COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DMAC_OS_X_VERSION_MAX_ALLOWED=\$(subst .,,\$(MACOSX_VERSION_MIN)) -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
+ # command line. AvailabilityMacros.h versions have no dots, ex: 1070.
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK \
+ -DMAC_OS_X_VERSION_MIN_REQUIRED=\$(subst .,,\$(MACOSX_VERSION_MIN)) \
+ -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
LDFLAGS_JDK="$LDFLAGS_JDK -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
+ JVM_CFLAGS="$JVM_CFLAGS \
+ -DMAC_OS_X_VERSION_MIN_REQUIRED=\$(subst .,,\$(MACOSX_VERSION_MIN)) \
+ -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
+
+ if test -n "$MACOSX_VERSION_MAX"; then
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK \
+ -DMAC_OS_X_VERSION_MAX_ALLOWED=\$(subst .,,\$(MACOSX_VERSION_MAX))"
+ JVM_CFLAGS="$JVM_CFLAGS \
+ -DMAC_OS_X_VERSION_MAX_ALLOWED=\$(subst .,,\$(MACOSX_VERSION_MAX))"
+ fi
fi
# Setup some hard coded includes
@@ -52279,7 +52318,6 @@
OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -D_DARWIN_C_SOURCE -D_XOPEN_SOURCE"
OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -fno-rtti -fno-exceptions -fvisibility=hidden \
-mno-omit-leaf-frame-pointer -mstack-alignment=16 -pipe -fno-strict-aliasing \
- -DMAC_OS_X_VERSION_MAX_ALLOWED=1070 -mmacosx-version-min=10.7.0 \
-fno-omit-frame-pointer"
elif test "x$OPENJDK_BUILD_OS" = xaix; then
OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -DAIX"
@@ -52453,18 +52491,54 @@
# Additional macosx handling
if test "x$OPENJDK_BUILD_OS" = xmacosx; then
- # Setting these parameters makes it an error to link to macosx APIs that are
- # newer than the given OS version and makes the linked binaries compatible
- # even if built on a newer version of the OS.
- # The expected format is X.Y.Z
+ # MACOSX_VERSION_MIN is the c++ and ld is -mmacosx-version-min argument. The expected
+ # format is X.Y.Z. It's hard-coded to the minimum OSX version on which the
+ # JDK can be built and makes the linked binaries compatible even if built on
+ # a newer version of the OS.
MACOSX_VERSION_MIN=10.7.0
- # The macro takes the version with no dots, ex: 1070
+ # Setting --with-macosx-version-max=<version> makes it an error to build or
+ # link to macosx APIs that are newer than the given OS version. The expected
+ # format for <version> is either nn.n.n or nn.nn.nn. See /usr/include/AvailabilityMacros.h.
+
+# Check whether --with-macosx-version-max was given.
+if test "${with_macosx_version_max+set}" = set; then :
+ withval=$with_macosx_version_max;
+ if echo "$with_macosx_version_max" | $GREP -q "^[0-9][0-9]\.[0-9]\.[0-9]\$"; then
+ MACOSX_VERSION_MAX=$with_macosx_version_max
+ elif echo "$with_macosx_version_max" | $GREP -q "^[0-9][0-9]\.[0-9][0-9]\.[0-9][0-9]\$"; then
+ MACOSX_VERSION_MAX=$with_macosx_version_max
+ elif test "x$with_macosx_version_max" = "xno"; then
+ # Use build system default
+ MACOSX_VERSION_MAX=
+ else
+ as_fn_error $? "osx version format must be nn.n.n or nn.nn.nn" "$LINENO" 5
+ fi
+
+else
+ MACOSX_VERSION_MAX=
+
+fi
+
+
+
# Let the flags variables get resolved in make for easier override on make
- # command line.
- OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK="$OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK -DMAC_OS_X_VERSION_MAX_ALLOWED=\$(subst .,,\$(MACOSX_VERSION_MIN)) -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
+ # command line. AvailabilityMacros.h versions have no dots, ex: 1070.
+ OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK="$OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK \
+ -DMAC_OS_X_VERSION_MIN_REQUIRED=\$(subst .,,\$(MACOSX_VERSION_MIN)) \
+ -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
OPENJDK_BUILD_LDFLAGS_JDK="$OPENJDK_BUILD_LDFLAGS_JDK -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
+ OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS \
+ -DMAC_OS_X_VERSION_MIN_REQUIRED=\$(subst .,,\$(MACOSX_VERSION_MIN)) \
+ -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
+
+ if test -n "$MACOSX_VERSION_MAX"; then
+ OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK="$OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK \
+ -DMAC_OS_X_VERSION_MAX_ALLOWED=\$(subst .,,\$(MACOSX_VERSION_MAX))"
+ OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS \
+ -DMAC_OS_X_VERSION_MAX_ALLOWED=\$(subst .,,\$(MACOSX_VERSION_MAX))"
+ fi
fi
# Setup some hard coded includes
--- a/common/autoconf/spec.gmk.in Thu Jul 13 19:34:22 2017 +0000
+++ b/common/autoconf/spec.gmk.in Fri Jul 14 13:02:27 2017 -0700
@@ -335,8 +335,10 @@
X_CFLAGS:=@X_CFLAGS@
X_LIBS:=@X_LIBS@
-# The lowest required version of macosx to enforce compatiblity for
+# The lowest required version of macosx
MACOSX_VERSION_MIN=@MACOSX_VERSION_MIN@
+# The highest allowed version of macosx
+MACOSX_VERSION_MAX=@MACOSX_VERSION_MAX@
# Toolchain type: gcc, clang, solstudio, lxc, microsoft...
TOOLCHAIN_TYPE:=@TOOLCHAIN_TYPE@
--- a/common/conf/jib-profiles.js Thu Jul 13 19:34:22 2017 +0000
+++ b/common/conf/jib-profiles.js Fri Jul 14 13:02:27 2017 -0700
@@ -436,7 +436,8 @@
target_os: "macosx",
target_cpu: "x64",
dependencies: ["devkit"],
- configure_args: concat(common.configure_args_64bit, "--with-zlib=system"),
+ configure_args: concat(common.configure_args_64bit, "--with-zlib=system",
+ "--with-macosx-version-max=10.7.0"),
},
"solaris-x64": {
--- a/common/nb_native/nbproject/configurations.xml Thu Jul 13 19:34:22 2017 +0000
+++ b/common/nb_native/nbproject/configurations.xml Fri Jul 14 13:02:27 2017 -0700
@@ -3517,7 +3517,6 @@
<Elem>COMPILER2</Elem>
<Elem>DTRACE_ENABLED</Elem>
<Elem>HOTSPOT_LIB_ARCH="amd64"</Elem>
- <Elem>MAC_OS_X_VERSION_MAX_ALLOWED=1070</Elem>
<Elem>TARGET_ARCH_MODEL_x86_64</Elem>
<Elem>TARGET_ARCH_x86</Elem>
<Elem>TARGET_COMPILER_gcc</Elem>
@@ -10570,7 +10569,6 @@
<Elem>COMPILER2</Elem>
<Elem>DTRACE_ENABLED</Elem>
<Elem>HOTSPOT_LIB_ARCH="amd64"</Elem>
- <Elem>MAC_OS_X_VERSION_MAX_ALLOWED=1070</Elem>
<Elem>TARGET_ARCH_MODEL_x86_64</Elem>
<Elem>TARGET_ARCH_x86</Elem>
<Elem>TARGET_COMPILER_gcc</Elem>
@@ -18227,7 +18225,6 @@
<Elem>COMPILER2</Elem>
<Elem>DTRACE_ENABLED</Elem>
<Elem>HOTSPOT_LIB_ARCH="amd64"</Elem>
- <Elem>MAC_OS_X_VERSION_MAX_ALLOWED=1070</Elem>
<Elem>TARGET_ARCH_MODEL_x86_64</Elem>
<Elem>TARGET_ARCH_x86</Elem>
<Elem>TARGET_COMPILER_gcc</Elem>
@@ -20787,7 +20784,6 @@
<Elem>COMPILER2</Elem>
<Elem>DTRACE_ENABLED</Elem>
<Elem>HOTSPOT_LIB_ARCH="amd64"</Elem>
- <Elem>MAC_OS_X_VERSION_MAX_ALLOWED=1070</Elem>
<Elem>TARGET_ARCH_MODEL_x86_64</Elem>
<Elem>TARGET_ARCH_x86</Elem>
<Elem>TARGET_COMPILER_gcc</Elem>
@@ -21531,7 +21527,6 @@
<Elem>ARCHPROPNAME="x86_64"</Elem>
<Elem>DEBUG</Elem>
<Elem>MACOSX</Elem>
- <Elem>MAC_OS_X_VERSION_MAX_ALLOWED=1070</Elem>
<Elem>THIS_FILE="java_props_macosx.c"</Elem>
<Elem>_ALLBSD_SOURCE</Elem>
<Elem>_DARWIN_UNLIMITED_SELECT</Elem>
@@ -23025,7 +23020,6 @@
<Elem>ARCHPROPNAME="x86_64"</Elem>
<Elem>DEBUG</Elem>
<Elem>MACOSX</Elem>
- <Elem>MAC_OS_X_VERSION_MAX_ALLOWED=1070</Elem>
<Elem>THIS_FILE="java_props_md.c"</Elem>
<Elem>_ALLBSD_SOURCE</Elem>
<Elem>_DARWIN_UNLIMITED_SELECT</Elem>
@@ -23104,7 +23098,6 @@
<Elem>ARCH="x86_64"</Elem>
<Elem>DEBUG</Elem>
<Elem>MACOSX</Elem>
- <Elem>MAC_OS_X_VERSION_MAX_ALLOWED=1070</Elem>
<Elem>THIS_FILE="ExtendedOptionsImpl.c"</Elem>
<Elem>_ALLBSD_SOURCE</Elem>
<Elem>_DARWIN_UNLIMITED_SELECT</Elem>
@@ -23481,7 +23474,6 @@
<Elem>ARCH="x86_64"</Elem>
<Elem>DEBUG</Elem>
<Elem>MACOSX</Elem>
- <Elem>MAC_OS_X_VERSION_MAX_ALLOWED=1070</Elem>
<Elem>THIS_FILE="SocketDispatcher.c"</Elem>
<Elem>_ALLBSD_SOURCE</Elem>
<Elem>_DARWIN_UNLIMITED_SELECT</Elem>
@@ -29987,7 +29979,6 @@
<Elem>COMPILER2</Elem>
<Elem>DTRACE_ENABLED</Elem>
<Elem>HOTSPOT_LIB_ARCH="amd64"</Elem>
- <Elem>MAC_OS_X_VERSION_MAX_ALLOWED=1070</Elem>
<Elem>TARGET_ARCH_MODEL_x86_64</Elem>
<Elem>TARGET_ARCH_x86</Elem>
<Elem>TARGET_COMPILER_gcc</Elem>
@@ -30069,7 +30060,6 @@
<Elem>COMPILER2</Elem>
<Elem>DTRACE_ENABLED</Elem>
<Elem>HOTSPOT_LIB_ARCH="amd64"</Elem>
- <Elem>MAC_OS_X_VERSION_MAX_ALLOWED=1070</Elem>
<Elem>TARGET_ARCH_MODEL_x86_64</Elem>
<Elem>TARGET_ARCH_x86</Elem>
<Elem>TARGET_COMPILER_gcc</Elem>
@@ -30104,7 +30094,6 @@
<Elem>ARCH="x86_64"</Elem>
<Elem>DEBUG</Elem>
<Elem>MACOSX</Elem>
- <Elem>MAC_OS_X_VERSION_MAX_ALLOWED=1070</Elem>
<Elem>_ALLBSD_SOURCE</Elem>
<Elem>_DARWIN_UNLIMITED_SELECT</Elem>
<Elem>_GNU_SOURCE</Elem>
@@ -30147,7 +30136,6 @@
<Elem>COMPILER2</Elem>
<Elem>DTRACE_ENABLED</Elem>
<Elem>HOTSPOT_LIB_ARCH="amd64"</Elem>
- <Elem>MAC_OS_X_VERSION_MAX_ALLOWED=1070</Elem>
<Elem>TARGET_ARCH_MODEL_x86_64</Elem>
<Elem>TARGET_ARCH_x86</Elem>
<Elem>TARGET_COMPILER_gcc</Elem>
@@ -30211,7 +30199,6 @@
<Elem>COMPILER2</Elem>
<Elem>DTRACE_ENABLED</Elem>
<Elem>HOTSPOT_LIB_ARCH="amd64"</Elem>
- <Elem>MAC_OS_X_VERSION_MAX_ALLOWED=1070</Elem>
<Elem>TARGET_ARCH_MODEL_x86_64</Elem>
<Elem>TARGET_ARCH_x86</Elem>
<Elem>TARGET_COMPILER_gcc</Elem>
@@ -30274,7 +30261,6 @@
<Elem>COMPILER2</Elem>
<Elem>DTRACE_ENABLED</Elem>
<Elem>HOTSPOT_LIB_ARCH="amd64"</Elem>
- <Elem>MAC_OS_X_VERSION_MAX_ALLOWED=1070</Elem>
<Elem>TARGET_ARCH_MODEL_x86_64</Elem>
<Elem>TARGET_ARCH_x86</Elem>
<Elem>TARGET_COMPILER_gcc</Elem>
@@ -30341,7 +30327,6 @@
<preprocessorList>
<Elem>ARCH="x86_64"</Elem>
<Elem>MACOSX</Elem>
- <Elem>MAC_OS_X_VERSION_MAX_ALLOWED=1070</Elem>
<Elem>THIS_FILE="agent_util.c"</Elem>
<Elem>_ALLBSD_SOURCE</Elem>
<Elem>_DARWIN_UNLIMITED_SELECT</Elem>
@@ -30354,7 +30339,6 @@
<preprocessorList>
<Elem>ARCH="x86_64"</Elem>
<Elem>MACOSX</Elem>
- <Elem>MAC_OS_X_VERSION_MAX_ALLOWED=1070</Elem>
<Elem>THIS_FILE="Agent.cpp"</Elem>
<Elem>_ALLBSD_SOURCE</Elem>
<Elem>_DARWIN_UNLIMITED_SELECT</Elem>