Skip to content

Commit

Permalink
Make safety options opt-in
Browse files Browse the repository at this point in the history
  • Loading branch information
nohlson committed Sep 13, 2024
1 parent 4f25e28 commit 5694b2d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
1 change: 1 addition & 0 deletions .github/workflows/reusable-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:
--config-cache \
--with-pydebug \
--enable-slower-safety \
--enable-safety \
${{ inputs.free-threading && '--disable-gil' || '' }} \
--prefix=/opt/python-dev \
--with-openssl="$(brew --prefix [email protected])"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/reusable-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ jobs:
--config-cache
--with-pydebug
--enable-slower-safety
--enable-safety
--with-openssl=$OPENSSL_DIR
${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }}
- name: Build CPython out-of-tree
Expand Down
20 changes: 10 additions & 10 deletions configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2500,13 +2500,13 @@ 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.

AC_MSG_CHECKING([for --disable-safety])
AC_MSG_CHECKING([for --enable-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_safety=yes])], [disable_safety=no])
AC_MSG_RESULT([$disable_safety])
[AS_HELP_STRING([--enable-safety], [enable usage of the security compiler options with no performance overhead])],
[AS_VAR_IF([disable_safety], [yes], [enable_safety=no], [enable_safety=yes])], [enable_safety=no])
AC_MSG_RESULT([$enable_safety])

if test "$disable_safety" = "no"
if test "$enable_safety" = "yes"
then
AX_CHECK_COMPILE_FLAG([-fstack-protector-strong], [CFLAGS_NODIST="$CFLAGS_NODIST -fstack-protector-strong"], [AC_MSG_WARN([-fstack-protector-strong not supported])], [-Werror])
AX_CHECK_COMPILE_FLAG([-Wtrampolines], [CFLAGS_NODIST="$CFLAGS_NODIST -Wtrampolines"], [AC_MSG_WARN([-Wtrampolines not supported])], [-Werror])
Expand Down

0 comments on commit 5694b2d

Please sign in to comment.