Skip to content

Commit e7e888b

Browse files
committed
8363910: Avoid tuning for Power10 CPUs on Linux ppc64le when gcc < 10 is used
Backport-of: 41c94eed37aad570229ee2c5fb51d9e5d0378a40
1 parent 4b37d97 commit e7e888b

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

make/autoconf/flags-cflags.m4

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -736,8 +736,15 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
736736
$1_CFLAGS_CPU_JVM="${$1_CFLAGS_CPU_JVM} -mminimal-toc"
737737
elif test "x$FLAGS_CPU" = xppc64le; then
738738
# Little endian machine uses ELFv2 ABI.
739-
# Use Power8, this is the first CPU to support PPC64 LE with ELFv2 ABI.
740-
$1_CFLAGS_CPU="-mcpu=power8 -mtune=power10"
739+
# Use Power8 for target cpu, this is the first CPU to support PPC64 LE with ELFv2 ABI.
740+
# Use Power10 for tuning target, this is supported by gcc >= 10
741+
POWER_TUNE_VERSION="-mtune=power10"
742+
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [${POWER_TUNE_VERSION}],
743+
IF_FALSE: [
744+
POWER_TUNE_VERSION="-mtune=power8"
745+
]
746+
)
747+
$1_CFLAGS_CPU="-mcpu=power8 ${POWER_TUNE_VERSION}"
741748
$1_CFLAGS_CPU_JVM="${$1_CFLAGS_CPU_JVM} -DABI_ELFv2"
742749
fi
743750
elif test "x$FLAGS_CPU" = xs390x; then

0 commit comments

Comments
 (0)