8184022: Build JDK 10 on OSX 10.12 and above

Reviewed-by: erikj, tbell
This commit is contained in:
Paul Hohensee 2017-07-14 13:02:27 -07:00
parent 4da2b1f33f
commit 7391f2dac4
5 changed files with 135 additions and 43 deletions

View File

@ -996,7 +996,6 @@ AC_DEFUN([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK_HELPER],
$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 @@ AC_DEFUN([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK_HELPER],
# 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

View File

@ -749,6 +749,7 @@ CXXFLAGS_JDKEXE
CXXFLAGS_JDKLIB
CFLAGS_JDKEXE
CFLAGS_JDKLIB
MACOSX_VERSION_MAX
MACOSX_VERSION_MIN
CXXSTD_CXXFLAG
JDK_ARCH_ABI_PROP_NAME
@ -1182,6 +1183,7 @@ with_toolchain_version
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 @@ Optional Packages:
(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 @@ VS_SDK_PLATFORM_NAME_2013=
#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 @@ $as_echo "$as_me: GCC >= 6 detected; adding ${NO_DELETE_NULL_POINTER_CHECKS_CFLA
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 @@ $as_echo "$as_me: GCC >= 6 detected; adding ${NO_DELETE_NULL_POINTER_CHECKS_CFLA
# 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 @@ $as_echo "$as_me: GCC >= 6 detected; adding ${NO_DELETE_NULL_POINTER_CHECKS_CFLA
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 @@ $as_echo "$as_me: GCC >= 6 detected; adding ${NO_DELETE_NULL_POINTER_CHECKS_CFLA
# 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

View File

@ -335,8 +335,10 @@ GCOV_ENABLED=@GCOV_ENABLED@
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@

View File

@ -436,7 +436,8 @@ var getJibProfilesProfiles = function (input, common, data) {
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": {

View File

@ -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>