Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
12 changes: 6 additions & 6 deletions doc/building.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ <h1 class="title">Building the JDK</h1>
<li><a href="#apple-xcode" id="toc-apple-xcode">Apple Xcode</a></li>
<li><a href="#microsoft-visual-studio"
id="toc-microsoft-visual-studio">Microsoft Visual Studio</a></li>
<li><a href="#ibm-xl-cc" id="toc-ibm-xl-cc">IBM XL C/C++</a></li>
<li><a href="#ibm-open-xl-cc" id="toc-ibm-open-xl-cc">IBM Open XL
C/C++</a></li>
</ul></li>
<li><a href="#boot-jdk-requirements" id="toc-boot-jdk-requirements">Boot
JDK Requirements</a>
Expand Down Expand Up @@ -697,11 +698,10 @@ <h3 id="microsoft-visual-studio">Microsoft Visual Studio</h3>
version number accordingly. If you have not installed the
<code>BuildTools</code>, but e.g. <code>Professional</code>, adjust the
product ID accordingly.</p>
<h3 id="ibm-xl-cc">IBM XL C/C++</h3>
<p>Please consult the AIX section of the <a
href="https://wiki.openjdk.org/display/Build/Supported+Build+Platforms">Supported
Build Platforms</a> OpenJDK Build Wiki page for details about which
versions of XLC are supported.</p>
<h3 id="ibm-open-xl-cc">IBM Open XL C/C++</h3>
<p>The minimum accepted version of Open XL is 17.1.1.4. This is in
essence clang 15, and will be treated as such by the OpenJDK build
system.</p>
<h2 id="boot-jdk-requirements">Boot JDK Requirements</h2>
<p>Paradoxically, building the JDK requires a pre-existing JDK. This is
called the "boot JDK". The boot JDK does not, however, have to be a JDK
Expand Down
7 changes: 3 additions & 4 deletions doc/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -503,11 +503,10 @@ that the " characters are essential)
accordingly. If you have not installed the `BuildTools`, but e.g.
`Professional`, adjust the product ID accordingly.

### IBM XL C/C++
### IBM Open XL C/C++

Please consult the AIX section of the [Supported Build Platforms](
https://wiki.openjdk.org/display/Build/Supported+Build+Platforms) OpenJDK Build
Wiki page for details about which versions of XLC are supported.
The minimum accepted version of Open XL is 17.1.1.4. This is in essence clang
15, and will be treated as such by the OpenJDK build system.

## Boot JDK Requirements

Expand Down
3 changes: 0 additions & 3 deletions make/autoconf/build-performance.m4
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,6 @@ AC_DEFUN_ONCE([BPERF_SETUP_PRECOMPILED_HEADERS],
if test "x$ICECC" != "x"; then
AC_MSG_RESULT([no, does not work effectively with icecc])
PRECOMPILED_HEADERS_AVAILABLE=false
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
AC_MSG_RESULT([no, does not work with xlc])
PRECOMPILED_HEADERS_AVAILABLE=false
elif test "x$TOOLCHAIN_TYPE" = xgcc; then
# Check that the compiler actually supports precomp headers.
echo "int alfa();" > conftest.h
Expand Down
86 changes: 7 additions & 79 deletions make/autoconf/flags-cflags.m4
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@
# questions.
#

# ===========================================================================
# (c) Copyright IBM Corp. 2025, 2025 All Rights Reserved
# ===========================================================================

################################################################################
#
# Setup flags for C/C++ compiler
Expand Down Expand Up @@ -56,9 +52,6 @@ AC_DEFUN([FLAGS_SETUP_SHARED_LIBS],
SHARED_LIBRARY_FLAGS='-shared'
fi

elif test "x$TOOLCHAIN_TYPE" = xxlc; then
SHARED_LIBRARY_FLAGS="-qmkshrobj -bM:SRE -bnoentry"

elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
SHARED_LIBRARY_FLAGS="-dll"
fi
Expand Down Expand Up @@ -122,8 +115,6 @@ AC_DEFUN([FLAGS_SETUP_DEBUG_SYMBOLS],

CFLAGS_DEBUG_SYMBOLS="-g ${GDWARF_FLAGS}"
ASFLAGS_DEBUG_SYMBOLS="-g"
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
CFLAGS_DEBUG_SYMBOLS="-g1"
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
CFLAGS_DEBUG_SYMBOLS="-Z7"
fi
Expand Down Expand Up @@ -189,11 +180,7 @@ AC_DEFUN([DEBUG_PREFIX_MAP_GCC_INCLUDE_PATHS],
AC_DEFUN([FLAGS_SETUP_WARNINGS],
[
# Set default value.
if test "x$TOOLCHAIN_TYPE" != xxlc; then
WARNINGS_AS_ERRORS_DEFAULT=true
else
WARNINGS_AS_ERRORS_DEFAULT=false
fi
WARNINGS_AS_ERRORS_DEFAULT=true

UTIL_ARG_ENABLE(NAME: warnings-as-errors, DEFAULT: $WARNINGS_AS_ERRORS_DEFAULT,
RESULT: WARNINGS_AS_ERRORS,
Expand Down Expand Up @@ -248,15 +235,6 @@ AC_DEFUN([FLAGS_SETUP_WARNINGS],
# false positives.
DISABLED_WARNINGS="unknown-warning-option unused-parameter"
;;

xlc)
DISABLE_WARNING_PREFIX="-Wno-"
CFLAGS_WARNINGS_ARE_ERRORS="-qhalt=w"

# Possibly a better subset than "all" is "lan:trx:ret:zea:cmp:ret"
WARNINGS_ENABLE_ALL="-qinfo=all -qformat=all"
DISABLED_WARNINGS=""
;;
esac
AC_SUBST(DISABLE_WARNING_PREFIX)
AC_SUBST(BUILD_CC_DISABLE_WARNING_PREFIX)
Expand Down Expand Up @@ -330,15 +308,6 @@ AC_DEFUN([FLAGS_SETUP_OPTIMIZATION],
C_O_FLAG_DEBUG_JVM="${C_O_FLAG_DEBUG_JVM} ${DISABLE_FORTIFY_CFLAGS}"
C_O_FLAG_NONE="${C_O_FLAG_NONE} ${DISABLE_FORTIFY_CFLAGS}"
fi
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
C_O_FLAG_HIGHEST_JVM="-O3 -qhot=level=1 -qinline -qinlglue"
C_O_FLAG_HIGHEST="-O3 -qhot=level=1 -qinline -qinlglue"
C_O_FLAG_HI="-O3 -qinline -qinlglue"
C_O_FLAG_NORM="-O2"
C_O_FLAG_DEBUG="-qnoopt"
# FIXME: Value below not verified.
C_O_FLAG_DEBUG_JVM=""
C_O_FLAG_NONE="-qnoopt"
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
C_O_FLAG_HIGHEST_JVM="-O2 -Oy-"
C_O_FLAG_HIGHEST="-O2"
Expand Down Expand Up @@ -482,13 +451,6 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
else
DEBUG_CFLAGS_JDK="-DDEBUG"

if test "x$TOOLCHAIN_TYPE" = xxlc; then
# We need '-qminimaltoc' or '-qpic=large -bbigtoc' if the TOC overflows.
# Hotspot now overflows its 64K TOC (currently only for debug),
# so for debug we build with '-qpic=large -bbigtoc'.
DEBUG_CFLAGS_JVM="-qpic=large"
fi

if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang ; then
INIT_PATTERN_FLAG="-ftrivial-auto-var-init=pattern"
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$INIT_PATTERN_FLAG],
Expand All @@ -515,9 +477,6 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
ALWAYS_DEFINES_JVM="-D_GNU_SOURCE -D_REENTRANT"
elif test "x$TOOLCHAIN_TYPE" = xclang; then
ALWAYS_DEFINES_JVM="-D_GNU_SOURCE"
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
ALWAYS_DEFINES_JVM="-D_REENTRANT"
ALWAYS_DEFINES_JDK="-D_GNU_SOURCE -D_REENTRANT -DSTDC"
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
# _WIN32_WINNT=0x0602 means access APIs for Windows 8 and above. See
# https://docs.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt?view=msvc-170
Expand Down Expand Up @@ -582,12 +541,6 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],

TOOLCHAIN_CFLAGS_JDK="$TOOLCHAIN_CFLAGS_JDK -fvisibility=hidden -fstack-protector"

elif test "x$TOOLCHAIN_TYPE" = xxlc; then
# Suggested additions: -qsrcmsg to get improved error reporting
# set -qtbtable=full for a better traceback table/better stacks in hs_err when xlc16 is used
TOOLCHAIN_CFLAGS_JDK="-qtbtable=full -qchars=signed -qfullpath -qsaveopt -qstackprotect" # add on both CFLAGS
TOOLCHAIN_CFLAGS_JVM="-qtbtable=full -qtune=balanced -fno-exceptions \
-qalias=noansi -qstrict -qtls=default -qnortti -qnoeh -qignerrno -qstackprotect"
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
TOOLCHAIN_CFLAGS_JVM="-nologo -MD -Zc:preprocessor -Zc:inline -Zc:throwingNew -permissive- -MP"
TOOLCHAIN_CFLAGS_JDK="-nologo -MD -Zc:preprocessor -Zc:inline -Zc:throwingNew -permissive- -Zc:wchar_t-"
Expand All @@ -604,7 +557,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
TOOLCHAIN_CFLAGS_JDK="$TOOLCHAIN_CFLAGS_JDK $CHARSET_CFLAGS"

# CFLAGS C language level for JDK sources (hotspot only uses C++)
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang || test "x$TOOLCHAIN_TYPE" = xxlc; then
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
LANGSTD_CFLAGS="-std=c11"
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
LANGSTD_CFLAGS="-std:c11"
Expand All @@ -616,8 +569,6 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
LANGSTD_CXXFLAGS="-std=c++17"
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
LANGSTD_CXXFLAGS="-std:c++17"
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
LANGSTD_CXXFLAGS="-std=c++14"
else
AC_MSG_ERROR([Cannot enable C++17 for this toolchain])
fi
Expand All @@ -638,8 +589,6 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
WARNING_CFLAGS="$WARNINGS_ENABLE_ALL"

elif test "x$TOOLCHAIN_TYPE" = xxlc; then
WARNING_CFLAGS="" # currently left empty
fi

# Set some additional per-OS defines.
Expand All @@ -664,31 +613,16 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
PICFLAG="-fPIC"
PIEFLAG="-fPIE"
elif test "x$TOOLCHAIN_TYPE" = xclang && test "x$OPENJDK_TARGET_OS" = xaix; then
JVM_PICFLAG="-fpic -mcmodel=large -Wl,-bbigtoc
JDK_PICFLAG="-fpic
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
# '-qpic' defaults to 'qpic=small'. This means that the compiler generates only
# one instruction for accessing the TOC. If the TOC grows larger than 64K, the linker
# will have to patch this single instruction with a call to some out-of-order code which
# does the load from the TOC. This is of course slower, and we also would have
# to use '-bbigtoc' for linking anyway so we could also change the PICFLAG to 'qpic=large'.
# With 'qpic=large' the compiler will by default generate a two-instruction sequence which
# can be patched directly by the linker and does not require a jump to out-of-order code.
#
# Since large TOC causes perf. overhead, only pay it where we must. Currently this is
# for all libjvm variants (both gtest and normal) but no other binaries. So, build
# libjvm with -qpic=large and link with -bbigtoc.
JVM_PICFLAG="-qpic=large"
JDK_PICFLAG="-qpic"
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
PICFLAG=""
fi

if test "x$TOOLCHAIN_TYPE" != xxlc; then
if test "x$TOOLCHAIN_TYPE" = xclang && test "x$OPENJDK_TARGET_OS" = xaix; then
JVM_PICFLAG="-fpic -mcmodel=large"
else
JVM_PICFLAG="$PICFLAG"
JDK_PICFLAG="$PICFLAG"
fi
JDK_PICFLAG="$PICFLAG"

if test "x$OPENJDK_TARGET_OS" = xmacosx; then
# Linking is different on macOS
Expand Down Expand Up @@ -718,8 +652,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
$1_DEFINES_CPU_JDK="${$1_DEFINES_CPU_JDK} -DARCH='\"$FLAGS_CPU_LEGACY\"' \
-D$FLAGS_CPU_LEGACY"

if test "x$FLAGS_CPU_BITS" = x64 && test "x$FLAGS_OS" != xaix; then
# xlc on AIX defines _LP64=1 by default and issues a warning if we redefine it.
if test "x$FLAGS_CPU_BITS" = x64; then
$1_DEFINES_CPU_JDK="${$1_DEFINES_CPU_JDK} -D_LP64=1"
$1_DEFINES_CPU_JVM="${$1_DEFINES_CPU_JVM} -D_LP64=1"
fi
Expand Down Expand Up @@ -809,11 +742,6 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
$1_CFLAGS_CPU="-mcpu=pwr8"
fi

elif test "x$TOOLCHAIN_TYPE" = xxlc; then
if test "x$FLAGS_CPU" = xppc64; then
$1_CFLAGS_CPU_JVM="-qarch=ppc64"
fi

elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
if test "x$FLAGS_CPU" = xx86; then
$1_CFLAGS_CPU_JVM="-arch:IA32"
Expand Down
20 changes: 3 additions & 17 deletions make/autoconf/flags-ldflags.m4
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@
# or visit www.oracle.com if you need additional information or have any
# questions.
#
# ===========================================================================
# (c) Copyright IBM Corp. 2019, 2025 All Rights Reserved
# ===========================================================================

################################################################################
#

# ===========================================================================
# (c) Copyright IBM Corp. 2019, 2024 All Rights Reserved
# ===========================================================================

AC_DEFUN([FLAGS_SETUP_LDFLAGS],
[
FLAGS_SETUP_LDFLAGS_HELPER
Expand Down Expand Up @@ -86,11 +85,6 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
-Wl,-bernotok -Wl,-bcdtors:mbr::s -Wl,-bdatapsize:64k -Wl,-btextpsize:64k -Wl,-bstackpsize:64k"
BASIC_LDFLAGS_JVM_ONLY="$BASIC_LDFLAGS_JVM_ONLY -Wl,-lC_r -Wl,-bbigtoc"
fi
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
BASIC_LDFLAGS="-b64 -brtl -bnolibpath -bnoexpall -bernotok -brwexec_must -btextpsize:64K \
-bdatapsize:64K -bstackpsize:64K"
# libjvm.so has gotten too large for normal TOC size; compile with qpic=large and link with bigtoc
BASIC_LDFLAGS_JVM_ONLY="-Wl,-lC_r -bbigtoc"

elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
BASIC_LDFLAGS="-opt:ref"
Expand Down Expand Up @@ -120,14 +114,6 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
fi
fi

elif test "x$TOOLCHAIN_TYPE" = xxlc; then
# We need '-qminimaltoc' or '-qpic=large -bbigtoc' if the TOC overflows.
# Hotspot now overflows its 64K TOC (currently only for debug),
# so we build with '-qpic=large -bbigtoc'.
if test "x$DEBUG_LEVEL" != xrelease; then
DEBUGLEVEL_LDFLAGS_JVM_ONLY="$DEBUGLEVEL_LDFLAGS_JVM_ONLY -bbigtoc"
fi

elif test "x$TOOLCHAIN_TYPE" = xclang && test "x$OPENJDK_TARGET_OS" = xaix; then
# We need '-fpic' or '-fpic -mcmodel=large -Wl,-bbigtoc' if the TOC overflows.
# Hotspot now overflows its 64K TOC (currently only for debug),
Expand Down
48 changes: 1 addition & 47 deletions make/autoconf/flags.m4
Original file line number Diff line number Diff line change
Expand Up @@ -261,12 +261,9 @@ AC_DEFUN_ONCE([FLAGS_PRE_TOOLCHAIN],
# The sysroot flags are needed for configure to be able to run the compilers
FLAGS_SETUP_SYSROOT_FLAGS

# For xlc, the word size flag is required for correct behavior.
# For clang/gcc, the flag is only strictly required for reduced builds, but
# set it always where possible (x86 and ppc).
if test "x$TOOLCHAIN_TYPE" = xxlc; then
MACHINE_FLAG="-q${OPENJDK_TARGET_CPU_BITS}"
elif test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
if test "x$OPENJDK_TARGET_CPU_ARCH" = xx86 &&
test "x$OPENJDK_TARGET_CPU" != xx32 ||
test "x$OPENJDK_TARGET_CPU_ARCH" = xppc; then
Expand Down Expand Up @@ -321,47 +318,6 @@ AC_DEFUN_ONCE([FLAGS_PRE_TOOLCHAIN],

AC_DEFUN([FLAGS_SETUP_TOOLCHAIN_CONTROL],
[
# COMPILER_TARGET_BITS_FLAG : option for selecting 32- or 64-bit output
# COMPILER_COMMAND_FILE_FLAG : option for passing a command file to the compiler
# COMPILER_BINDCMD_FILE_FLAG : option for specifying a file which saves the binder
# commands produced by the link step (currently AIX only)
if test "x$TOOLCHAIN_TYPE" = xxlc; then
COMPILER_TARGET_BITS_FLAG="-q"
COMPILER_COMMAND_FILE_FLAG="-f"
COMPILER_BINDCMD_FILE_FLAG="-bloadmap:"
else
COMPILER_TARGET_BITS_FLAG="-m"
COMPILER_COMMAND_FILE_FLAG="@"
COMPILER_BINDCMD_FILE_FLAG=""

# Check if @file is supported by gcc
if test "x$TOOLCHAIN_TYPE" = xgcc; then
AC_MSG_CHECKING([if @file is supported by gcc])
# Extra empty "" to prevent ECHO from interpreting '--version' as argument
$ECHO "" "--version" > command.file
# Redirect stderr and stdout to config.log (AS_MESSAGE_LOG_FD) via merge
if $CXX @command.file 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD; then
AC_MSG_RESULT(yes)
COMPILER_COMMAND_FILE_FLAG="@"
else
AC_MSG_RESULT(no)
COMPILER_COMMAND_FILE_FLAG=
fi
$RM command.file
fi
fi

AC_SUBST(COMPILER_TARGET_BITS_FLAG)
AC_SUBST(COMPILER_COMMAND_FILE_FLAG)
AC_SUBST(COMPILER_BINDCMD_FILE_FLAG)

# Check that the compiler supports -mX (or -qX on AIX) flags
# Set COMPILER_SUPPORTS_TARGET_BITS_FLAG to 'true' if it does
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}],
IF_TRUE: [COMPILER_SUPPORTS_TARGET_BITS_FLAG=true],
IF_FALSE: [COMPILER_SUPPORTS_TARGET_BITS_FLAG=false])
AC_SUBST(COMPILER_SUPPORTS_TARGET_BITS_FLAG)

if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
if test "x$OPENJDK_TARGET_CPU" != xaarch64; then
AS_NON_ASM_EXTENSION_OPTION=-Ta
Expand All @@ -374,8 +330,6 @@ AC_DEFUN([FLAGS_SETUP_TOOLCHAIN_CONTROL],
GENDEPS_FLAGS="-MMD -MF"
elif test "x$TOOLCHAIN_TYPE" = xclang; then
GENDEPS_FLAGS="-MMD -MF"
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
GENDEPS_FLAGS="-qmakedep=gcc -MF"
fi
AC_SUBST(GENDEPS_FLAGS)
])
Expand Down
7 changes: 0 additions & 7 deletions make/autoconf/spec.gmk.template
Original file line number Diff line number Diff line change
Expand Up @@ -504,13 +504,6 @@ CXX_VERSION_NUMBER := @CXX_VERSION_NUMBER@
# Legacy support
HOTSPOT_TOOLCHAIN_TYPE := @HOTSPOT_TOOLCHAIN_TYPE@

# Option used to pass a command file to the compiler
COMPILER_COMMAND_FILE_FLAG := @COMPILER_COMMAND_FILE_FLAG@

# Option for specifying a file which saves the binder commands
# produced by the link step (for debugging, currently AIX only)
COMPILER_BINDCMD_FILE_FLAG := @COMPILER_BINDCMD_FILE_FLAG@

AS_NON_ASM_EXTENSION_OPTION := @AS_NON_ASM_EXTENSION_OPTION@

# Flags used for overriding the default opt setting for a C/C++ source file.
Expand Down
Loading