diff options
Diffstat (limited to 'debian/patches')
-rw-r--r-- | debian/patches/configure.diff | 82 | ||||
-rw-r--r-- | debian/patches/cordz-info-statistics-test.diff | 11 | ||||
-rw-r--r-- | debian/patches/cpu-features.diff | 55 | ||||
-rw-r--r-- | debian/patches/empty-flags-library.diff | 19 | ||||
-rw-r--r-- | debian/patches/latomic.diff | 20 | ||||
-rw-r--r-- | debian/patches/pkg-config-directives.diff | 21 | ||||
-rw-r--r-- | debian/patches/series | 6 |
7 files changed, 214 insertions, 0 deletions
diff --git a/debian/patches/configure.diff b/debian/patches/configure.diff new file mode 100644 index 00000000..a5a5eef3 --- /dev/null +++ b/debian/patches/configure.diff @@ -0,0 +1,82 @@ +From: Benjamin Barenblat <bbaren@google.com> +Subject: Set package configuration options +Forwarded: not-needed + +Configure Abseil for Debian. + + - Set the SONAME appropriately. + + - To minimize the possibility of future ABI breakage, treat absl::any, + absl::optional, absl::string_view, and absl::variant as their own types + (rather than aliases for the std:: versions), and compile everything in an + inline namespace. + + - Enable upstream's hardened build mode. + +--- a/CMake/AbseilHelpers.cmake ++++ b/CMake/AbseilHelpers.cmake +@@ -298,7 +298,8 @@ + if(ABSL_ENABLE_INSTALL) + set_target_properties(${_NAME} PROPERTIES + OUTPUT_NAME "absl_${_NAME}" +- SOVERSION "2308.0.0" ++ SOVERSION 20230802 ++ VERSION "20230802.0.0" + ) + endif() + else() +--- a/absl/base/options.h ++++ b/absl/base/options.h +@@ -94,7 +94,7 @@ + // User code should not inspect this macro. To check in the preprocessor if + // absl::any is a typedef of std::any, use the feature macro ABSL_USES_STD_ANY. + +-#define ABSL_OPTION_USE_STD_ANY 2 ++#define ABSL_OPTION_USE_STD_ANY 0 + + + // ABSL_OPTION_USE_STD_OPTIONAL +@@ -121,7 +121,7 @@ + // absl::optional is a typedef of std::optional, use the feature macro + // ABSL_USES_STD_OPTIONAL. + +-#define ABSL_OPTION_USE_STD_OPTIONAL 2 ++#define ABSL_OPTION_USE_STD_OPTIONAL 0 + + + // ABSL_OPTION_USE_STD_STRING_VIEW +@@ -148,7 +148,7 @@ + // absl::string_view is a typedef of std::string_view, use the feature macro + // ABSL_USES_STD_STRING_VIEW. + +-#define ABSL_OPTION_USE_STD_STRING_VIEW 2 ++#define ABSL_OPTION_USE_STD_STRING_VIEW 0 + + // ABSL_OPTION_USE_STD_VARIANT + // +@@ -174,7 +174,7 @@ + // absl::variant is a typedef of std::variant, use the feature macro + // ABSL_USES_STD_VARIANT. + +-#define ABSL_OPTION_USE_STD_VARIANT 2 ++#define ABSL_OPTION_USE_STD_VARIANT 0 + + + // ABSL_OPTION_USE_INLINE_NAMESPACE +@@ -200,7 +200,7 @@ + // allowed. + + #define ABSL_OPTION_USE_INLINE_NAMESPACE 1 +-#define ABSL_OPTION_INLINE_NAMESPACE_NAME lts_20230802 ++#define ABSL_OPTION_INLINE_NAMESPACE_NAME debian5 + + // ABSL_OPTION_HARDENED + // +@@ -227,6 +227,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_ diff --git a/debian/patches/cordz-info-statistics-test.diff b/debian/patches/cordz-info-statistics-test.diff new file mode 100644 index 00000000..646133a1 --- /dev/null +++ b/debian/patches/cordz-info-statistics-test.diff @@ -0,0 +1,11 @@ +--- a/absl/strings/internal/cordz_info_statistics_test.cc ++++ b/absl/strings/internal/cordz_info_statistics_test.cc +@@ -468,6 +468,8 @@ + } + + TEST(CordzInfoStatisticsTest, ThreadSafety) { ++ GTEST_SKIP() << "Skipping test; see https://bugs.debian.org/1018804"; ++ + Notification stop; + static constexpr int kNumThreads = 8; + int64_t sampled_node_count = 0; diff --git a/debian/patches/cpu-features.diff b/debian/patches/cpu-features.diff new file mode 100644 index 00000000..614c7dcb --- /dev/null +++ b/debian/patches/cpu-features.diff @@ -0,0 +1,55 @@ +From: Benjamin Barenblat <bbaren@google.com> +Subject: Canonicalize supported CPU feature set +Forwarded: not-needed + +Explicitly set supported CPU features. + + - Disable Intel SSE and SSE2 on i386, since Debian supports some i386 + processors without those extensions. Keep them enabled on amd64, since all + amd64 processors have them. + + - Disable Intel SSSE3 entirely, since no i386 processor supports it and Debian + supports amd64 processors without it. + + - Disable NEON on armel and armhf, since no armel processor supports NEON and + Debian supports some armhf processors without it. Keep it enabled on arm64, + since all arm64 processors have it. + +--- a/absl/base/config.h ++++ b/absl/base/config.h +@@ -848,7 +848,7 @@ + // which architectures support the various x86 instruction sets. + #ifdef ABSL_INTERNAL_HAVE_SSE + #error ABSL_INTERNAL_HAVE_SSE cannot be directly set +-#elif defined(__SSE__) ++#elif defined(__x86_64__) + #define ABSL_INTERNAL_HAVE_SSE 1 + #elif (defined(_M_X64) || (defined(_M_IX86_FP) && _M_IX86_FP >= 1)) && \ + !defined(_M_ARM64EC) +@@ -864,7 +864,7 @@ + // which architectures support the various x86 instruction sets. + #ifdef ABSL_INTERNAL_HAVE_SSE2 + #error ABSL_INTERNAL_HAVE_SSE2 cannot be directly set +-#elif defined(__SSE2__) ++#elif defined(__x86_64__) + #define ABSL_INTERNAL_HAVE_SSE2 1 + #elif (defined(_M_X64) || (defined(_M_IX86_FP) && _M_IX86_FP >= 2)) && \ + !defined(_M_ARM64EC) +@@ -886,8 +886,6 @@ + // by the CPU. + #ifdef ABSL_INTERNAL_HAVE_SSSE3 + #error ABSL_INTERNAL_HAVE_SSSE3 cannot be directly set +-#elif defined(__SSSE3__) +-#define ABSL_INTERNAL_HAVE_SSSE3 1 + #endif + + // ABSL_INTERNAL_HAVE_ARM_NEON is used for compile-time detection of NEON (ARM +@@ -899,7 +897,7 @@ + // https://llvm.org/docs/CompileCudaWithLLVM.html#detecting-clang-vs-nvcc-from-code + #ifdef ABSL_INTERNAL_HAVE_ARM_NEON + #error ABSL_INTERNAL_HAVE_ARM_NEON cannot be directly set +-#elif defined(__ARM_NEON) && !defined(__CUDA_ARCH__) ++#elif defined(__aarch64__) + #define ABSL_INTERNAL_HAVE_ARM_NEON 1 + #endif + diff --git a/debian/patches/empty-flags-library.diff b/debian/patches/empty-flags-library.diff new file mode 100644 index 00000000..d47d44be --- /dev/null +++ b/debian/patches/empty-flags-library.diff @@ -0,0 +1,19 @@ +From: Benjamin Barenblat <bbaren@google.com> +Subject: Eliminate libabsl_flags.so and libabsl_flags.a +Forwarded: not-needed + +The libabsl_flags library only contains code when compiling with MSVC, which +Debian doesn't use. Skip compiling absl/flags/flag.cc, and make the Abseil flags +library header-only. + +--- a/absl/flags/CMakeLists.txt ++++ b/absl/flags/CMakeLists.txt +@@ -200,8 +200,6 @@ + absl_cc_library( + NAME + flags +- SRCS +- "flag.cc" + HDRS + "declare.h" + "flag.h" diff --git a/debian/patches/latomic.diff b/debian/patches/latomic.diff new file mode 100644 index 00000000..ef952275 --- /dev/null +++ b/debian/patches/latomic.diff @@ -0,0 +1,20 @@ +From: Benjamin Barenblat <bbaren@google.com> +Subject: Use libatomic if necessary +Bug-Debian: https://bugs.debian.org/973492 + +On some architectures, notably armel, Abseil needs symbols defined in +libatomic. Abseil does not currently have a well-developed system to +declare external library dependencies, so just have the linker determine +if anything needs libatomic and add the DT_NEEDED entry where necessary. + +--- a/absl/copts/AbseilConfigureCopts.cmake ++++ b/absl/copts/AbseilConfigureCopts.cmake +@@ -103,4 +103,8 @@ + set(ABSL_TEST_COPTS "") + endif() + ++list(APPEND ABSL_DEFAULT_LINKOPTS ++ "-Wl,--push-state,--as-needed" "-latomic" "-Wl,--pop-state" ++) ++ + set(ABSL_CXX_STANDARD "${CMAKE_CXX_STANDARD}") diff --git a/debian/patches/pkg-config-directives.diff b/debian/patches/pkg-config-directives.diff new file mode 100644 index 00000000..726d6aec --- /dev/null +++ b/debian/patches/pkg-config-directives.diff @@ -0,0 +1,21 @@ +From: Benjamin Barenblat <bbaren@google.com> +Subject: Do not propagate -Wno-... flags into pkg-config files +Forwarded: not-needed + +Lintian doesn't like any -W flags in pkg-config files, even if those flags +disable warnings. + +--- a/CMake/AbseilHelpers.cmake ++++ b/CMake/AbseilHelpers.cmake +@@ -187,10 +187,7 @@ + endif() + endforeach() + foreach(cflag ${ABSL_CC_LIB_COPTS}) +- if(${cflag} MATCHES "^(-Wno|/wd)") +- # These flags are needed to suppress warnings that might fire in our headers. +- set(PC_CFLAGS "${PC_CFLAGS} ${cflag}") +- elseif(${cflag} MATCHES "^(-W|/w[1234eo])") ++ if(${cflag} MATCHES "^(-W|/w[1234eo])") + # Don't impose our warnings on others. + elseif(${cflag} MATCHES "^-m") + # Don't impose CPU instruction requirements on others, as diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 00000000..29630f3c --- /dev/null +++ b/debian/patches/series @@ -0,0 +1,6 @@ +configure.diff +cpu-features.diff +latomic.diff +empty-flags-library.diff +cordz-info-statistics-test.diff +pkg-config-directives.diff |