Skip to content

Commit 432e897

Browse files
author
duke
committed
Backport fe6d9ab951cb84d1161aee781af2d93edaac3595
1 parent 8012f69 commit 432e897

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

make/autoconf/flags-cflags.m4

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ AC_DEFUN([FLAGS_SETUP_WARNINGS],
277277
AC_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
@@ -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

0 commit comments

Comments
 (0)