Skip to content

Commit 2df6c92

Browse files
committed
gh-121045: Disable -fstack-protector-strong for gcc compiler in AIX
1 parent 7435f05 commit 2df6c92

File tree

2 files changed

+25
-4
lines changed

2 files changed

+25
-4
lines changed

configure

Lines changed: 13 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2511,8 +2511,18 @@ AS_VAR_IF([with_strict_overflow], [yes],
25112511

25122512
# Enable flags that warn and protect for potential security vulnerabilities.
25132513
# These flags should be enabled by default for all builds.
2514-
AX_CHECK_COMPILE_FLAG([-fstack-protector-strong], [BASECFLAGS="$BASECFLAGS -fstack-protector-strong"], [AC_MSG_WARN([-fstack-protector-strong not supported])], [-Werror])
2515-
AX_CHECK_COMPILE_FLAG([-Wtrampolines], [BASECFLAGS="$BASECFLAGS -Wtrampolines"], [AC_MSG_WARN([-Wtrampolines not supported])], [-Werror])
2514+
case $ac_sys_system/$CC in
2515+
AIX*/gcc*)
2516+
# In AIX with GCC, the compile check passes with -fstack-protector-strong
2517+
# even though it is not supported and is exposed only by a run/link check.
2518+
# So disable it.
2519+
AC_MSG_WARN([-fstack-protector-strong not supported in AIX with gcc])
2520+
;;
2521+
*)
2522+
AX_CHECK_COMPILE_FLAG([-fstack-protector-strong], [BASECFLAGS="$BASECFLAGS -fstack-protector-strong"], [AC_MSG_WARN([-fstack-protector-strong not supported])], [-Werror])
2523+
AX_CHECK_COMPILE_FLAG([-Wtrampolines], [BASECFLAGS="$BASECFLAGS -Wtrampolines"], [AC_MSG_WARN([-Wtrampolines not supported])], [-Werror])
2524+
;;
2525+
esac
25162526

25172527
case $GCC in
25182528
yes)

0 commit comments

Comments
 (0)