-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-121996: Introduce --disable-safety and --enable-slower-safety options #122054
Changes from all commits
8455a0f
eefbcac
70bed19
558813e
764873a
b1ae877
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Introduce ./configure --disable-safety and --enable-slower-safety options. | ||
Patch by Donghee Na. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2499,9 +2499,28 @@ AS_VAR_IF([with_strict_overflow], [yes], | |
|
||
# Enable flags that warn and protect for potential security vulnerabilities. | ||
# These flags should be enabled by default for all builds. | ||
AX_CHECK_COMPILE_FLAG([-fstack-protector-strong], [BASECFLAGS="$BASECFLAGS -fstack-protector-strong"], [AC_MSG_WARN([-fstack-protector-strong not supported])], [-Werror]) | ||
AX_CHECK_COMPILE_FLAG([-Wtrampolines], [BASECFLAGS="$BASECFLAGS -Wtrampolines"], [AC_MSG_WARN([-Wtrampolines not supported])], [-Werror]) | ||
AX_CHECK_COMPILE_FLAG([-D_FORTIFY_SOURCE=3], [BASECFLAGS="$BASECFLAGS -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3"], [AC_MSG_WARN([-D_FORTIFY_SOURCE=3 not supported])]) | ||
|
||
AC_MSG_CHECKING([for --disable-safety]) | ||
AC_ARG_ENABLE([safety], | ||
[AS_HELP_STRING([--disable-safety], [disable usage of the security compiler options with no performance overhead])], | ||
[AS_VAR_IF([enable_safety], [yes], [disable_safety=no], [disable_saftey=yes])], [disable_saftey=no]) | ||
AC_MSG_RESULT([$disable_safety]) | ||
|
||
if test "$disable_safety" = "no" | ||
then | ||
AX_CHECK_COMPILE_FLAG([-fstack-protector-strong], [BASECFLAGS="$BASECFLAGS -fstack-protector-strong"], [AC_MSG_WARN([-fstack-protector-strong not supported])], [-Werror]) | ||
AX_CHECK_COMPILE_FLAG([-Wtrampolines], [BASECFLAGS="$BASECFLAGS -Wtrampolines"], [AC_MSG_WARN([-Wtrampolines not supported])], [-Werror]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The mixing of warning options with an actual codegen option (SSP) doesn't feel ideal. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, tbh, pretty much every Linux distro builds with SSP and _F_S=2 at least.. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's handle it as the seperate PR cc @nohlson |
||
fi | ||
|
||
AC_MSG_CHECKING([for --enable-slower-safety]) | ||
AC_ARG_ENABLE([slower-safety], | ||
[AS_HELP_STRING([--enable-slower-safety], [enable usage of the security compiler options with performance overhead])],[]) | ||
AC_MSG_RESULT([$enable_slower_safety]) | ||
|
||
if test "$enable_slower_safety" = "yes" | ||
then | ||
AX_CHECK_COMPILE_FLAG([-D_FORTIFY_SOURCE=3], [BASECFLAGS="$BASECFLAGS -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3"], [AC_MSG_WARN([-D_FORTIFY_SOURCE=3 not supported])]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use AX_ADD_FORTIFY_SOURCE. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. #122054 (comment) ditto, |
||
fi | ||
|
||
case $GCC in | ||
yes) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo:
disable_saftey
should bedisable_safety