Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8344458: [11u] Add initial support for building with XCode 14 #2966

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions make/autoconf/flags-cflags.m4
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,23 @@ AC_DEFUN([FLAGS_SETUP_DEBUG_SYMBOLS],

AC_DEFUN([FLAGS_SETUP_WARNINGS],
[
AC_ARG_ENABLE([xcode14], [AS_HELP_STRING([--enable-xcode14],
[add additional CFLAGS for compiling with XCode 14 toolset @<:@enabled@:>@])])

# Set default values
CFLAGS_XCODE14_DEPR_DECLARATIONS=""
CFLAGS_XCODE14_DEPR_NON_PROTOTYPE=""
if test "x$enable_xcode14" = "xyes"; then
if test "x$OPENJDK_BUILD_OS" != "xmacosx"; then
AC_MSG_ERROR([--enable-xcode14 can only be set if building on macosx])
fi
CFLAGS_XCODE14_DEPR_DECLARATIONS="-Wno-deprecated-declarations"
CFLAGS_XCODE14_DEPR_NON_PROTOTYPE="-Wno-deprecated-non-prototype"
AC_MSG_RESULT([Building on macosx with XCode 14 flags])
fi
AC_SUBST(CFLAGS_XCODE14_DEPR_DECLARATIONS)
AC_SUBST(CFLAGS_XCODE14_DEPR_NON_PROTOTYPE)

AC_ARG_ENABLE([warnings-as-errors], [AS_HELP_STRING([--disable-warnings-as-errors],
[do not consider native warnings to be an error @<:@enabled@:>@])])

Expand Down
2 changes: 2 additions & 0 deletions make/autoconf/spec.gmk.in
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,8 @@ JT_HOME:=@JT_HOME@
JTREGEXE:=@JTREGEXE@
JIB_HOME:=@JIB_HOME@
XCODEBUILD=@XCODEBUILD@
CFLAGS_XCODE14_DEPR_DECLARATIONS=@CFLAGS_XCODE14_DEPR_DECLARATIONS@
CFLAGS_XCODE14_DEPR_NON_PROTOTYPE=@CFLAGS_XCODE14_DEPR_NON_PROTOTYPE@
DTRACE := @DTRACE@
FIXPATH := @FIXPATH@
FIXPATH_BASE := @FIXPATH_BASE@
Expand Down
2 changes: 2 additions & 0 deletions make/hotspot/gensrc/GensrcAdlc.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ ifeq ($(call check-jvm-feature, compiler2), true)
else ifeq ($(call isBuildOs, aix), true)
ADLC_LDFLAGS := -q64
ADLC_CFLAGS := -qnortti -qeh -q64 -DAIX
else ifeq ($(call isBuildOs, macosx), true)
ADLC_CFLAGS := $(CFLAGS_XCODE14_DEPR_DECLARATIONS)
else ifeq ($(call isBuildOs, windows), true)
ADLC_LDFLAGS := -nologo
ADLC_CFLAGS := -nologo -EHsc
Expand Down
2 changes: 1 addition & 1 deletion make/launcher/Launcher-jdk.pack.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ $(eval $(call SetupJdkExecutable, BUILD_UNPACKEXE, \
CFLAGS_release := -DPRODUCT, \
CFLAGS_linux := -fPIC, \
CFLAGS_solaris := -KPIC, \
CFLAGS_macosx := -fPIC, \
CFLAGS_macosx := -fPIC $(CFLAGS_XCODE14_DEPR_DECLARATIONS), \
LDFLAGS := $(LDFLAGS_JDKEXE) $(LDFLAGS_CXX_JDK) \
$(call SET_SHARED_LIBRARY_ORIGIN), \
LIBS := $(UNPACKEXE_LIBS) $(LIBCXX), \
Expand Down
6 changes: 5 additions & 1 deletion make/lib/Awt2dLibraries.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,10 @@ ifeq ($(call isTargetOs, linux), true)
LIBAWT_CFLAGS += $(EXPORT_ALL_SYMBOLS)
endif

ifeq ($(call isBuildOs, macosx), true)
LIBAWT_CFLAGS += $(CFLAGS_XCODE14_DEPR_NON_PROTOTYPE)
endif

# Turn off all warnings for debug_mem.c This is needed because the specific warning
# about initializing a declared 'extern' cannot be turned off individually. Only
# applies to debug builds.
Expand Down Expand Up @@ -931,7 +935,7 @@ ifeq ($(call isTargetOs, macosx), true)
libosxapp \
#

LIBAWT_LWAWT_CFLAGS := $(X_CFLAGS) $(X_LIBS)
LIBAWT_LWAWT_CFLAGS := $(X_CFLAGS) $(X_LIBS) $(CFLAGS_XCODE14_DEPR_NON_PROTOTYPE)

LIBAWT_LWAWT_EXFILES := fontpath.c awt_Font.c X11Color.c
LIBAWT_LWAWT_EXCLUDES := $(TOPDIR)/src/$(MODULE)/unix/native/common/awt/medialib
Expand Down
1 change: 1 addition & 0 deletions make/lib/Lib-java.desktop.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ ifeq ($(call isTargetOs, aix), false)
OPTIMIZATION := LOW, \
CFLAGS := $(CFLAGS_JDKLIB) \
$(LIBJSOUND_CFLAGS), \
CFLAGS_macosx := $(CFLAGS_XCODE14_DEPR_DECLARATIONS), \
CXXFLAGS := $(CXXFLAGS_JDKLIB) $(LIBJSOUND_CFLAGS), \
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN), \
Expand Down
1 change: 1 addition & 0 deletions make/lib/Lib-jdk.pack.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBUNPACK, \
CFLAGS := $(CXXFLAGS_JDKLIB) \
-DNO_ZLIB -DUNPACK_JNI -DFULL, \
CFLAGS_release := -DPRODUCT, \
CFLAGS_macosx := $(CFLAGS_XCODE14_DEPR_DECLARATIONS), \
EXTRA_HEADER_DIRS := $(call GetJavaHeaderDir, java.base), \
DISABLED_WARNINGS_gcc := implicit-fallthrough, \
LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \
Expand Down
5 changes: 5 additions & 0 deletions make/test/JtregNativeHotspot.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,11 @@ endif

JVMTI_COMMON_INCLUDES=-I$(TOPDIR)/test/lib/jdk/test/lib/jvmti

ifeq ($(call isBuildOs, macosx), true)
NSK_AOD_INCLUDES += $(CFLAGS_XCODE14_DEPR_DECLARATIONS)
JVMTI_COMMON_INCLUDES += $(CFLAGS_XCODE14_DEPR_DECLARATIONS)
endif

BUILD_HOTSPOT_JTREG_LIBRARIES_CFLAGS_libNoFramePointer := $(NO_FRAMEPOINTER_CFLAGS)
# Optimization -O3 needed, HIGH == -O3
BUILD_HOTSPOT_JTREG_LIBRARIES_OPTIMIZATION_libNoFramePointer := HIGH
Expand Down