Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34k
gh-121996: Introduce --disable-safety and --enable-slower-safety options#122054
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
8455a0feefbcac70bed19558813e764873ab1ae877File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -53,6 +53,7 @@ jobs: | ||
| ./configure \ | ||
| --config-cache \ | ||
| --with-pydebug \ | ||
| --enable-slower-safety \ | ||
| ${{inputs.free-threading && '--disable-gil' || ''}} \ | ||
| --prefix=/opt/python-dev \ | ||
| --with-openssl="$(brew --prefix [email protected])" | ||
| 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.
Uh oh!
There was an error while loading. Please reload this page.
| 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]) | ||
Contributor 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. Contributor 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.. MemberAuthor 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])]) | ||
Contributor 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. MemberAuthor
| ||
| 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_safteyshould bedisable_safety