From 9662b20acc4d5dddfe455e27748bd4d34efec50e Mon Sep 17 00:00:00 2001 From: Benjamin Barenblat Date: Fri, 25 Sep 2020 17:47:43 -0400 Subject: Enable upstream’s hardened build mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Abseil now includes an option to insert extra runtime checks to detect invariant violations. While not free, these checks are relatively lightweight and detect serious problems including undefined behavior. Enable them. --- debian/patches/configure.diff | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/debian/patches/configure.diff b/debian/patches/configure.diff index dc1ed9e7..2bdfc027 100644 --- a/debian/patches/configure.diff +++ b/debian/patches/configure.diff @@ -11,6 +11,8 @@ Configure Abseil for Debian. (rather than aliases for the std:: versions), and compile everything in an inline namespace. + - Enable upstream's hardened build mode. + - Disable Intel SSE2 on i386, since Debian supports some i386 processors without that extension. Keep it enabled on amd64, since all amd64 processors have it. @@ -77,6 +79,14 @@ Configure Abseil for Debian. // ABSL_OPTION_HARDENED // +@@ -233,6 +233,6 @@ + // checks enabled by this option may abort the program in a different way and + // log additional information when `NDEBUG` is not defined. + +-#define ABSL_OPTION_HARDENED 0 ++#define ABSL_OPTION_HARDENED 1 + + #endif // ABSL_BASE_OPTIONS_H_ --- a/absl/container/internal/have_sse.h +++ b/absl/container/internal/have_sse.h @@ -17,22 +17,14 @@ -- cgit v1.2.3