1
1
#
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.
3
3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
#
5
5
# This code is free software; you can redistribute it and/or modify it
@@ -235,9 +235,10 @@ AC_DEFUN([FLAGS_SETUP_WARNINGS],
235
235
CFLAGS_WARNINGS_ARE_ERRORS="-Werror"
236
236
237
237
# Additional warnings that are not activated by -Wall and -Wextra
238
- WARNINGS_ENABLE_ADDITIONAL="-Wpointer-arith -Wreturn-type -Wsign-compare \
239
- -Wtrampolines -Wundef -Wunused-const-variable=1 -Wunused-function \
240
- -Wunused-result -Wunused-value -Wtype-limits -Wuninitialized"
238
+ WARNINGS_ENABLE_ADDITIONAL="-Winvalid-pch -Wpointer-arith -Wreturn-type \
239
+ -Wsign-compare -Wtrampolines -Wtype-limits -Wundef -Wuninitialized \
240
+ -Wunused-const-variable=1 -Wunused-function -Wunused-result \
241
+ -Wunused-value"
241
242
WARNINGS_ENABLE_ADDITIONAL_CXX="-Woverloaded-virtual -Wreorder"
242
243
WARNINGS_ENABLE_ALL_CFLAGS="-Wall -Wextra -Wformat=2 $WARNINGS_ENABLE_ADDITIONAL"
243
244
WARNINGS_ENABLE_ALL_CXXFLAGS="$WARNINGS_ENABLE_ALL_CFLAGS $WARNINGS_ENABLE_ADDITIONAL_CXX"
@@ -277,7 +278,7 @@ AC_DEFUN([FLAGS_SETUP_WARNINGS],
277
278
AC_DEFUN ( [ FLAGS_SETUP_QUALITY_CHECKS] ,
278
279
[
279
280
# bounds, memory and behavior checking options
280
- if test "x$TOOLCHAIN_TYPE" = xgcc; then
281
+ if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang ; then
281
282
case $DEBUG_LEVEL in
282
283
release )
283
284
# no adjustment
@@ -516,12 +517,6 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
516
517
-fvisibility=hidden -fno-strict-aliasing -fno-omit-frame-pointer"
517
518
fi
518
519
519
- if test "x$TOOLCHAIN_TYPE" = xclang && test "x$OPENJDK_TARGET_OS" = xaix; then
520
- # clang compiler on aix needs -ffunction-sections
521
- TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -ffunction-sections -ftls-model -fno-math-errno -fstack-protector"
522
- TOOLCHAIN_CFLAGS_JDK="-ffunction-sections -fsigned-char -fstack-protector"
523
- fi
524
-
525
520
if test "x$TOOLCHAIN_TYPE" = xgcc; then
526
521
TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -fstack-protector"
527
522
TOOLCHAIN_CFLAGS_JDK="-fvisibility=hidden -pipe -fstack-protector"
@@ -541,7 +536,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
541
536
# Restrict the debug information created by Clang to avoid
542
537
# too big object files and speed the build up a little bit
543
538
# (see http://llvm.org/bugs/show_bug.cgi?id=7554)
544
- TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -flimit-debug-info"
539
+ TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -flimit-debug-info -fstack-protector "
545
540
546
541
# In principle the stack alignment below is cpu- and ABI-dependent and
547
542
# should agree with values of StackAlignmentInBytes in various
@@ -559,7 +554,13 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
559
554
TOOLCHAIN_CFLAGS_JDK="-pipe"
560
555
TOOLCHAIN_CFLAGS_JDK_CONLY="-fno-strict-aliasing" # technically NOT for CXX
561
556
fi
562
- TOOLCHAIN_CFLAGS_JDK="$TOOLCHAIN_CFLAGS_JDK -fvisibility=hidden"
557
+
558
+ if test "x$OPENJDK_TARGET_OS" = xaix; then
559
+ TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -ffunction-sections -ftls-model -fno-math-errno"
560
+ TOOLCHAIN_CFLAGS_JDK="-ffunction-sections -fsigned-char"
561
+ fi
562
+
563
+ TOOLCHAIN_CFLAGS_JDK="$TOOLCHAIN_CFLAGS_JDK -fvisibility=hidden -fstack-protector"
563
564
564
565
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
565
566
# The -utf-8 option sets source and execution character sets to UTF-8 to enable correct
@@ -736,6 +737,11 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
736
737
# for all archs except arm and ppc, prevent gcc to omit frame pointer
737
738
$1 _CFLAGS_CPU_JDK="${$1 _CFLAGS_CPU_JDK} -fno-omit-frame-pointer"
738
739
fi
740
+ if test "x$FLAGS_CPU" = xppc64le; then
741
+ # Little endian machine uses ELFv2 ABI.
742
+ # Use Power8, this is the first CPU to support PPC64 LE with ELFv2 ABI.
743
+ $1 _CFLAGS_CPU_JVM="${$1 _CFLAGS_CPU_JVM} -DABI_ELFv2 -mcpu=power8 -mtune=power8"
744
+ fi
739
745
fi
740
746
if test "x$OPENJDK_TARGET_OS" = xaix; then
741
747
$1 _CFLAGS_CPU="-mcpu=pwr8"
0 commit comments