11#
2- # Copyright (c) 2011, 2024 , Oracle and/or its affiliates. All rights reserved.
2+ # Copyright (c) 2011, 2025 , Oracle and/or its affiliates. All rights reserved.
33# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44#
55# This code is free software; you can redistribute it and/or modify it
@@ -277,7 +277,7 @@ AC_DEFUN([FLAGS_SETUP_WARNINGS],
277277AC_DEFUN ( [ FLAGS_SETUP_QUALITY_CHECKS] ,
278278[
279279 # bounds, memory and behavior checking options
280- if test "x$TOOLCHAIN_TYPE" = xgcc; then
280+ if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang ; then
281281 case $DEBUG_LEVEL in
282282 release )
283283 # no adjustment
@@ -354,7 +354,7 @@ AC_DEFUN([FLAGS_SETUP_OPTIMIZATION],
354354 C_O_FLAG_DEBUG="-Od"
355355 C_O_FLAG_DEBUG_JVM=""
356356 C_O_FLAG_NONE="-Od"
357- C_O_FLAG_SIZE="-Os "
357+ C_O_FLAG_SIZE="-O1 "
358358 fi
359359
360360 # Now copy to C++ flags
@@ -524,12 +524,6 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
524524 -fvisibility=hidden -fno-strict-aliasing -fno-omit-frame-pointer"
525525 fi
526526
527- if test "x$TOOLCHAIN_TYPE" = xclang && test "x$OPENJDK_TARGET_OS" = xaix; then
528- # clang compiler on aix needs -ffunction-sections
529- TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -ffunction-sections -ftls-model -fno-math-errno -fstack-protector"
530- TOOLCHAIN_CFLAGS_JDK="-ffunction-sections -fsigned-char -fstack-protector"
531- fi
532-
533527 if test "x$TOOLCHAIN_TYPE" = xgcc; then
534528 TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -fstack-protector"
535529 TOOLCHAIN_CFLAGS_JDK="-fvisibility=hidden -pipe -fstack-protector"
@@ -549,7 +543,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
549543 # Restrict the debug information created by Clang to avoid
550544 # too big object files and speed the build up a little bit
551545 # (see http://llvm.org/bugs/show_bug.cgi?id=7554)
552- TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -flimit-debug-info"
546+ TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -flimit-debug-info -fstack-protector "
553547
554548 # In principle the stack alignment below is cpu- and ABI-dependent and
555549 # should agree with values of StackAlignmentInBytes in various
@@ -567,7 +561,13 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
567561 TOOLCHAIN_CFLAGS_JDK="-pipe"
568562 TOOLCHAIN_CFLAGS_JDK_CONLY="-fno-strict-aliasing" # technically NOT for CXX
569563 fi
570- TOOLCHAIN_CFLAGS_JDK="$TOOLCHAIN_CFLAGS_JDK -fvisibility=hidden"
564+
565+ if test "x$OPENJDK_TARGET_OS" = xaix; then
566+ TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -ffunction-sections -ftls-model -fno-math-errno"
567+ TOOLCHAIN_CFLAGS_JDK="-ffunction-sections -fsigned-char"
568+ fi
569+
570+ TOOLCHAIN_CFLAGS_JDK="$TOOLCHAIN_CFLAGS_JDK -fvisibility=hidden -fstack-protector"
571571
572572 elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
573573 # The -utf-8 option sets source and execution character sets to UTF-8 to enable correct
@@ -743,7 +743,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
743743 elif test "x$FLAGS_CPU" = xppc64le; then
744744 # Little endian machine uses ELFv2 ABI.
745745 # Use Power8, this is the first CPU to support PPC64 LE with ELFv2 ABI.
746- $1 _CFLAGS_CPU_JVM="${$1 _CFLAGS_CPU_JVM} -DABI_ELFv2 -mcpu=power8 -mtune=power8 "
746+ $1 _CFLAGS_CPU_JVM="${$1 _CFLAGS_CPU_JVM} -DABI_ELFv2 -mcpu=power8 -mtune=power10 "
747747 fi
748748 elif test "x$FLAGS_CPU" = xs390x; then
749749 $1 _CFLAGS_CPU="-mbackchain -march=z10"
@@ -761,6 +761,11 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
761761 # for all archs except arm and ppc, prevent gcc to omit frame pointer
762762 $1 _CFLAGS_CPU_JDK="${$1 _CFLAGS_CPU_JDK} -fno-omit-frame-pointer"
763763 fi
764+ if test "x$FLAGS_CPU" = xppc64le; then
765+ # Little endian machine uses ELFv2 ABI.
766+ # Use Power8, this is the first CPU to support PPC64 LE with ELFv2 ABI.
767+ $1 _CFLAGS_CPU_JVM="${$1 _CFLAGS_CPU_JVM} -DABI_ELFv2 -mcpu=power8 -mtune=power10"
768+ fi
764769 fi
765770 if test "x$OPENJDK_TARGET_OS" = xaix; then
766771 $1 _CFLAGS_CPU="-mcpu=pwr8"
0 commit comments