# HG changeset patch # User phh # Date 1623275193 0 # Node ID 9f55d69c13a7be29ba7729690dfa32b6123c8131 # Parent 8f0c77f98b2ab47d4627d34eb0943b1e9b331baa 8267545: [8u] Enable Xcode 12 builds on macOS Summary: Makefile and source code patches to enable Xcode 12 builds Reviewed-by: simonis, andrew Contributed-by: benty@amazon.com, hohensee@amazon.com diff -r 8f0c77f98b2a -r 9f55d69c13a7 make/lib/CoreLibraries.gmk --- a/make/lib/CoreLibraries.gmk Tue Jun 01 05:34:16 2021 +0100 +++ b/make/lib/CoreLibraries.gmk Wed Jun 09 21:46:33 2021 +0000 @@ -409,6 +409,7 @@ ifeq ($(OPENJDK_TARGET_OS), macosx) LIBJLI_CFLAGS += -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" + LIBJLI_CFLAGS += -mmacosx-version-min=$(MACOSX_VERSION_MIN) endif ifneq ($(USE_EXTERNAL_LIBZ), true) @@ -442,7 +443,7 @@ $(call SET_SHARED_LIBRARY_ORIGIN), \ LDFLAGS_linux := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \ LDFLAGS_solaris := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \ - LDFLAGS_macosx := -framework Cocoa -framework Security -framework ApplicationServices, \ + LDFLAGS_macosx := -framework Cocoa -framework Security -framework ApplicationServices -mmacosx-version-min=$(MACOSX_VERSION_MIN), \ LDFLAGS_SUFFIX_solaris := $(LIBZ) $(LIBDL) -lc, \ LDFLAGS_SUFFIX_linux := $(LIBZ) $(LIBDL) -lc -lpthread, \ LDFLAGS_SUFFIX_aix := $(LIBZ) $(LIBDL),\ @@ -503,7 +504,7 @@ LANG := C, \ OPTIMIZATION := HIGH, \ CFLAGS := $(CFLAGS_JDKLIB) $(LIBJLI_CFLAGS), \ - LDFLAGS := -nostdlib -r, \ + LDFLAGS := -nostdlib -r -mmacosx-version-min=$(MACOSX_VERSION_MIN), \ OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjli_static, \ DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) diff -r 8f0c77f98b2a -r 9f55d69c13a7 src/macosx/native/apple/applescript/AppleScriptExecutionContext.m --- a/src/macosx/native/apple/applescript/AppleScriptExecutionContext.m Tue Jun 01 05:34:16 2021 +0100 +++ b/src/macosx/native/apple/applescript/AppleScriptExecutionContext.m Wed Jun 09 21:46:33 2021 +0000 @@ -26,6 +26,7 @@ #import "AppleScriptExecutionContext.h" #import +#import #import "AS_NS_ConversionUtils.h" diff -r 8f0c77f98b2a -r 9f55d69c13a7 src/macosx/native/sun/osxapp/ThreadUtilities.h --- a/src/macosx/native/sun/osxapp/ThreadUtilities.h Tue Jun 01 05:34:16 2021 +0100 +++ b/src/macosx/native/sun/osxapp/ThreadUtilities.h Wed Jun 09 21:46:33 2021 +0000 @@ -26,7 +26,7 @@ #ifndef __THREADUTILITIES_H #define __THREADUTILITIES_H -#import +#include #import "AWT_debug.h" diff -r 8f0c77f98b2a -r 9f55d69c13a7 src/share/native/sun/misc/URLClassPath.c --- a/src/share/native/sun/misc/URLClassPath.c Tue Jun 01 05:34:16 2021 +0100 +++ b/src/share/native/sun/misc/URLClassPath.c Wed Jun 09 21:46:33 2021 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,6 +24,7 @@ */ #include +#include #include "jni.h" #include "jni_util.h" @@ -31,6 +32,10 @@ #include "jvm.h" #include "jdk_util.h" +/* defined in libverify.so/verify.dll (src file common/check_format.c) */ +extern jboolean VerifyClassname(char *utf_name, jboolean arrayAllowed); +extern jboolean VerifyFixClassname(char *utf_name); + #include "sun_misc_URLClassPath.h" extern char* @@ -55,7 +60,7 @@ // getUTF() throws OOME before returning NULL, no need to throw OOME here return result; } - VerifyFixClassname(clname); + (void)VerifyFixClassname(clname); if (!VerifyClassname(clname, JNI_TRUE)) { /* expects slashed name */ goto done;