Skip to content

Commit

Permalink
8218965: aix: support xlclang++ in the compiler detection
Browse files Browse the repository at this point in the history
Reviewed-by: mdoerr
Backport-of: d9463e6
  • Loading branch information
backwaterred authored and TheRealMDoerr committed Apr 5, 2022
1 parent f42e3d2 commit 061c083
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
6 changes: 5 additions & 1 deletion make/autoconf/flags-cflags.m4
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,11 @@ AC_DEFUN([FLAGS_SETUP_DEBUG_SYMBOLS],
# -g0 enables debug symbols without disabling inlining.
CFLAGS_DEBUG_SYMBOLS="-g0 -xs"
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
CFLAGS_DEBUG_SYMBOLS="-g"
if test "x$XLC_USES_CLANG" = xtrue; then
CFLAGS_DEBUG_SYMBOLS="-g1"
else
CFLAGS_DEBUG_SYMBOLS="-g"
fi
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
CFLAGS_DEBUG_SYMBOLS="-Z7 -d2Zi+"
fi
Expand Down
22 changes: 22 additions & 0 deletions make/autoconf/toolchain.m4
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,20 @@ AC_DEFUN_ONCE([TOOLCHAIN_DETERMINE_TOOLCHAIN_TYPE],
fi
AC_SUBST(TOOLCHAIN_TYPE)
# on AIX, check for xlclang++ on the PATH and TOOLCHAIN_PATH and use it if it is available
if test "x$OPENJDK_TARGET_OS" = xaix; then
if test "x$TOOLCHAIN_PATH" != x; then
XLC_TEST_PATH=${TOOLCHAIN_PATH}/
fi
XLCLANG_VERSION_OUTPUT=`${XLC_TEST_PATH}xlclang++ -qversion 2>&1 | $HEAD -n 1`
$ECHO "$XLCLANG_VERSION_OUTPUT" | $GREP "IBM XL C/C++ for AIX" > /dev/null
if test $? -eq 0; then
AC_MSG_NOTICE([xlclang++ output: $XLCLANG_VERSION_OUTPUT])
XLC_USES_CLANG=true
fi
fi
TOOLCHAIN_CC_BINARY_clang="clang"
TOOLCHAIN_CC_BINARY_gcc="gcc"
TOOLCHAIN_CC_BINARY_microsoft="cl"
Expand All @@ -290,6 +304,14 @@ AC_DEFUN_ONCE([TOOLCHAIN_DETERMINE_TOOLCHAIN_TYPE],
TOOLCHAIN_CXX_BINARY_solstudio="CC"
TOOLCHAIN_CXX_BINARY_xlc="xlC_r"
if test "x$OPENJDK_TARGET_OS" = xaix; then
if test "x$XLC_USES_CLANG" = xtrue; then
AC_MSG_NOTICE([xlclang++ detected, using it])
TOOLCHAIN_CC_BINARY_xlc="xlclang"
TOOLCHAIN_CXX_BINARY_xlc="xlclang++"
fi
fi
# Use indirect variable referencing
toolchain_var_name=TOOLCHAIN_DESCRIPTION_$TOOLCHAIN_TYPE
TOOLCHAIN_DESCRIPTION=${!toolchain_var_name}
Expand Down

1 comment on commit 061c083

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.