From 94b8e998a4c04e3bd78202d429c1b804f77198ea Mon Sep 17 00:00:00 2001 From: Benjamin Barenblat Date: Thu, 7 Sep 2023 13:26:18 -0400 Subject: Update patches and bump internal namespace --- debian/patches/configure.diff | 12 +- debian/patches/cpu-features.diff | 16 +- debian/patches/empty-flags-library.diff | 2 +- debian/patches/latomic.diff | 2 +- debian/patches/series | 2 - debian/patches/split-hash-tests.diff | 677 -------------------------------- debian/patches/symbolize-ppc64.diff | 118 ------ 7 files changed, 16 insertions(+), 813 deletions(-) delete mode 100644 debian/patches/split-hash-tests.diff delete mode 100644 debian/patches/symbolize-ppc64.diff diff --git a/debian/patches/configure.diff b/debian/patches/configure.diff index 9d1fe736..a5a5eef3 100644 --- a/debian/patches/configure.diff +++ b/debian/patches/configure.diff @@ -15,13 +15,13 @@ Configure Abseil for Debian. --- a/CMake/AbseilHelpers.cmake +++ b/CMake/AbseilHelpers.cmake -@@ -309,7 +309,8 @@ +@@ -298,7 +298,8 @@ if(ABSL_ENABLE_INSTALL) set_target_properties(${_NAME} PROPERTIES OUTPUT_NAME "absl_${_NAME}" -- SOVERSION "2301.0.0" -+ SOVERSION 20230125 -+ VERSION "20230125.0.0" +- SOVERSION "2308.0.0" ++ SOVERSION 20230802 ++ VERSION "20230802.0.0" ) endif() else() @@ -67,8 +67,8 @@ Configure Abseil for Debian. // allowed. #define ABSL_OPTION_USE_INLINE_NAMESPACE 1 --#define ABSL_OPTION_INLINE_NAMESPACE_NAME lts_20230125 -+#define ABSL_OPTION_INLINE_NAMESPACE_NAME debian4 +-#define ABSL_OPTION_INLINE_NAMESPACE_NAME lts_20230802 ++#define ABSL_OPTION_INLINE_NAMESPACE_NAME debian5 // ABSL_OPTION_HARDENED // diff --git a/debian/patches/cpu-features.diff b/debian/patches/cpu-features.diff index 2f462e39..614c7dcb 100644 --- a/debian/patches/cpu-features.diff +++ b/debian/patches/cpu-features.diff @@ -17,25 +17,25 @@ Explicitly set supported CPU features. --- a/absl/base/config.h +++ b/absl/base/config.h -@@ -887,7 +887,7 @@ +@@ -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) - // MSVC only defines _M_IX86_FP for x86 32-bit code, and _M_IX86_FP >= 1 -@@ -902,7 +902,7 @@ + #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) - // MSVC only defines _M_IX86_FP for x86 32-bit code, and _M_IX86_FP >= 2 -@@ -923,8 +923,6 @@ + #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 @@ -44,7 +44,7 @@ Explicitly set supported CPU features. #endif // ABSL_INTERNAL_HAVE_ARM_NEON is used for compile-time detection of NEON (ARM -@@ -936,7 +934,7 @@ +@@ -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 diff --git a/debian/patches/empty-flags-library.diff b/debian/patches/empty-flags-library.diff index 8c26a6d7..d47d44be 100644 --- a/debian/patches/empty-flags-library.diff +++ b/debian/patches/empty-flags-library.diff @@ -8,7 +8,7 @@ library header-only. --- a/absl/flags/CMakeLists.txt +++ b/absl/flags/CMakeLists.txt -@@ -199,8 +199,6 @@ +@@ -200,8 +200,6 @@ absl_cc_library( NAME flags diff --git a/debian/patches/latomic.diff b/debian/patches/latomic.diff index 92b4f30c..ef952275 100644 --- a/debian/patches/latomic.diff +++ b/debian/patches/latomic.diff @@ -9,7 +9,7 @@ if anything needs libatomic and add the DT_NEEDED entry where necessary. --- a/absl/copts/AbseilConfigureCopts.cmake +++ b/absl/copts/AbseilConfigureCopts.cmake -@@ -93,4 +93,8 @@ +@@ -103,4 +103,8 @@ set(ABSL_TEST_COPTS "") endif() diff --git a/debian/patches/series b/debian/patches/series index 000d6558..29630f3c 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -4,5 +4,3 @@ latomic.diff empty-flags-library.diff cordz-info-statistics-test.diff pkg-config-directives.diff -split-hash-tests.diff -symbolize-ppc64.diff diff --git a/debian/patches/split-hash-tests.diff b/debian/patches/split-hash-tests.diff deleted file mode 100644 index ae0d066f..00000000 --- a/debian/patches/split-hash-tests.diff +++ /dev/null @@ -1,677 +0,0 @@ -From: Benjamin Barenblat -Subject: Split absl/hash/hash_test.cc into two files -Origin: backport, https://github.com/abseil/abseil-cpp/commit/c154d20abce2f1ae6bd35bd774313e351493219b - -hash_test.cc leans heavily on INSTANTIATE_TYPED_TEST_SUITE_P, which is quite -memory- and CPU-hungry. Split a few heavyweight tests into a new -hash_instantiated_test.cc, reducing peak RAM consumption (or, on multicore -systems, compilation time). - ---- a/absl/hash/BUILD.bazel -+++ b/absl/hash/BUILD.bazel -@@ -68,13 +68,17 @@ - - cc_test( - name = "hash_test", -- srcs = ["hash_test.cc"], -+ srcs = [ -+ "hash_test.cc", -+ "internal/hash_test.h", -+ ], - copts = ABSL_TEST_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - ":hash", - ":hash_testing", - ":spy_hash_state", -+ "//absl/base:config", - "//absl/base:core_headers", - "//absl/container:btree", - "//absl/container:flat_hash_map", -@@ -87,6 +91,27 @@ - "@com_google_googletest//:gtest_main", - ], - ) -+ -+cc_test( -+ name = "hash_instantiated_test", -+ srcs = [ -+ "hash_instantiated_test.cc", -+ "internal/hash_test.h", -+ ], -+ copts = ABSL_TEST_COPTS, -+ linkopts = ABSL_DEFAULT_LINKOPTS, -+ deps = [ -+ ":hash", -+ ":hash_testing", -+ "//absl/base:config", -+ "//absl/container:btree", -+ "//absl/container:flat_hash_map", -+ "//absl/container:flat_hash_set", -+ "//absl/container:node_hash_map", -+ "//absl/container:node_hash_set", -+ "@com_google_googletest//:gtest_main", -+ ], -+) - - cc_binary( - name = "hash_benchmark", ---- a/absl/hash/CMakeLists.txt -+++ b/absl/hash/CMakeLists.txt -@@ -64,6 +64,7 @@ - hash_test - SRCS - "hash_test.cc" -+ "internal/hash_test.h" - COPTS - ${ABSL_TEST_COPTS} - DEPS -@@ -82,6 +83,26 @@ - GTest::gmock_main - ) - -+absl_cc_test( -+ NAME -+ hash_instantiated_test -+ SRCS -+ "hash_test.cc" -+ "internal/hash_test.h" -+ COPTS -+ ${ABSL_TEST_COPTS} -+ DEPS -+ absl::hash -+ absl::hash_testing -+ absl::config -+ absl::btree -+ absl::flat_hash_map -+ absl::flat_hash_set -+ absl::node_hash_map -+ absl::node_hash_set -+ GTest::gtest_main -+) -+ - # Internal-only target, do not depend on directly. - # - # Note: Even though external code should not depend on this target ---- /dev/null -+++ b/absl/hash/hash_instantiated_test.cc -@@ -0,0 +1,224 @@ -+// Copyright 2018 The Abseil Authors. -+// -+// Licensed under the Apache License, Version 2.0 (the "License"); -+// you may not use this file except in compliance with the License. -+// You may obtain a copy of the License at -+// -+// https://www.apache.org/licenses/LICENSE-2.0 -+// -+// Unless required by applicable law or agreed to in writing, software -+// distributed under the License is distributed on an "AS IS" BASIS, -+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+// See the License for the specific language governing permissions and -+// limitations under the License. -+ -+// This file contains a few select absl::Hash tests that, due to their reliance -+// on INSTANTIATE_TYPED_TEST_SUITE_P, require a large amount of memory to -+// compile. Put new tests in hash_test.cc, not this file. -+ -+#include "absl/hash/hash.h" -+ -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include "gtest/gtest.h" -+#include "absl/container/btree_map.h" -+#include "absl/container/btree_set.h" -+#include "absl/container/flat_hash_map.h" -+#include "absl/container/flat_hash_set.h" -+#include "absl/container/node_hash_map.h" -+#include "absl/container/node_hash_set.h" -+#include "absl/hash/hash_testing.h" -+#include "absl/hash/internal/hash_test.h" -+ -+namespace { -+ -+using ::absl::hash_test_internal::is_hashable; -+using ::absl::hash_test_internal::TypeErasedContainer; -+ -+// Dummy type with unordered equality and hashing semantics. This preserves -+// input order internally, and is used below to ensure we get test coverage -+// for equal sequences with different iteraton orders. -+template -+class UnorderedSequence { -+ public: -+ UnorderedSequence() = default; -+ template -+ UnorderedSequence(std::initializer_list l) -+ : values_(l.begin(), l.end()) {} -+ template ::value, -+ bool>::type = true> -+ UnorderedSequence(ForwardIterator begin, ForwardIterator end) -+ : values_(begin, end) {} -+ // one-argument constructor of value type T, to appease older toolchains that -+ // get confused by one-element initializer lists in some contexts -+ explicit UnorderedSequence(const T& v) : values_(&v, &v + 1) {} -+ -+ using value_type = T; -+ -+ size_t size() const { return values_.size(); } -+ typename std::vector::const_iterator begin() const { -+ return values_.begin(); -+ } -+ typename std::vector::const_iterator end() const { return values_.end(); } -+ -+ friend bool operator==(const UnorderedSequence& lhs, -+ const UnorderedSequence& rhs) { -+ return lhs.size() == rhs.size() && -+ std::is_permutation(lhs.begin(), lhs.end(), rhs.begin()); -+ } -+ friend bool operator!=(const UnorderedSequence& lhs, -+ const UnorderedSequence& rhs) { -+ return !(lhs == rhs); -+ } -+ template -+ friend H AbslHashValue(H h, const UnorderedSequence& u) { -+ return H::combine(H::combine_unordered(std::move(h), u.begin(), u.end()), -+ u.size()); -+ } -+ -+ private: -+ std::vector values_; -+}; -+ -+template -+class HashValueSequenceTest : public testing::Test {}; -+TYPED_TEST_SUITE_P(HashValueSequenceTest); -+ -+TYPED_TEST_P(HashValueSequenceTest, BasicUsage) { -+ EXPECT_TRUE((is_hashable::value)); -+ -+ using IntType = typename TypeParam::value_type; -+ auto a = static_cast(0); -+ auto b = static_cast(23); -+ auto c = static_cast(42); -+ -+ std::vector exemplars = { -+ TypeParam(), TypeParam(), TypeParam{a, b, c}, -+ TypeParam{a, c, b}, TypeParam{c, a, b}, TypeParam{a}, -+ TypeParam{a, a}, TypeParam{a, a, a}, TypeParam{a, a, b}, -+ TypeParam{a, b, a}, TypeParam{b, a, a}, TypeParam{a, b}, -+ TypeParam{b, c}}; -+ EXPECT_TRUE(absl::VerifyTypeImplementsAbslHashCorrectly(exemplars)); -+} -+ -+REGISTER_TYPED_TEST_SUITE_P(HashValueSequenceTest, BasicUsage); -+using IntSequenceTypes = testing::Types< -+ std::deque, std::forward_list, std::list, std::vector, -+ std::vector, TypeErasedContainer>, std::set, -+ std::multiset, UnorderedSequence, -+ TypeErasedContainer>, std::unordered_set, -+ std::unordered_multiset, absl::flat_hash_set, -+ absl::node_hash_set, absl::btree_set>; -+INSTANTIATE_TYPED_TEST_SUITE_P(My, HashValueSequenceTest, IntSequenceTypes); -+ -+template -+class HashValueNestedSequenceTest : public testing::Test {}; -+TYPED_TEST_SUITE_P(HashValueNestedSequenceTest); -+ -+TYPED_TEST_P(HashValueNestedSequenceTest, BasicUsage) { -+ using T = TypeParam; -+ using V = typename T::value_type; -+ std::vector exemplars = { -+ // empty case -+ T{}, -+ // sets of empty sets -+ T{V{}}, T{V{}, V{}}, T{V{}, V{}, V{}}, -+ // multisets of different values -+ T{V{1}}, T{V{1, 1}, V{1, 1}}, T{V{1, 1, 1}, V{1, 1, 1}, V{1, 1, 1}}, -+ // various orderings of same nested sets -+ T{V{}, V{1, 2}}, T{V{}, V{2, 1}}, T{V{1, 2}, V{}}, T{V{2, 1}, V{}}, -+ // various orderings of various nested sets, case 2 -+ T{V{1, 2}, V{3, 4}}, T{V{1, 2}, V{4, 3}}, T{V{1, 3}, V{2, 4}}, -+ T{V{1, 3}, V{4, 2}}, T{V{1, 4}, V{2, 3}}, T{V{1, 4}, V{3, 2}}, -+ T{V{2, 3}, V{1, 4}}, T{V{2, 3}, V{4, 1}}, T{V{2, 4}, V{1, 3}}, -+ T{V{2, 4}, V{3, 1}}, T{V{3, 4}, V{1, 2}}, T{V{3, 4}, V{2, 1}}}; -+ EXPECT_TRUE(absl::VerifyTypeImplementsAbslHashCorrectly(exemplars)); -+} -+ -+REGISTER_TYPED_TEST_SUITE_P(HashValueNestedSequenceTest, BasicUsage); -+template -+using TypeErasedSet = TypeErasedContainer>; -+ -+using NestedIntSequenceTypes = testing::Types< -+ std::vector>, std::vector>, -+ std::vector>, UnorderedSequence>, -+ UnorderedSequence>, -+ UnorderedSequence>, TypeErasedSet>, -+ TypeErasedSet>, TypeErasedSet>>; -+INSTANTIATE_TYPED_TEST_SUITE_P(My, HashValueNestedSequenceTest, -+ NestedIntSequenceTypes); -+ -+template -+class HashValueAssociativeMapTest : public testing::Test {}; -+TYPED_TEST_SUITE_P(HashValueAssociativeMapTest); -+ -+TYPED_TEST_P(HashValueAssociativeMapTest, BasicUsage) { -+ using M = TypeParam; -+ using V = typename M::value_type; -+ std::vector exemplars{M{}, -+ M{V{0, "foo"}}, -+ M{V{1, "foo"}}, -+ M{V{0, "bar"}}, -+ M{V{1, "bar"}}, -+ M{V{0, "foo"}, V{42, "bar"}}, -+ M{V{42, "bar"}, V{0, "foo"}}, -+ M{V{1, "foo"}, V{42, "bar"}}, -+ M{V{1, "foo"}, V{43, "bar"}}, -+ M{V{1, "foo"}, V{43, "baz"}}}; -+ EXPECT_TRUE(absl::VerifyTypeImplementsAbslHashCorrectly(exemplars)); -+} -+ -+REGISTER_TYPED_TEST_SUITE_P(HashValueAssociativeMapTest, BasicUsage); -+using AssociativeMapTypes = testing::Types< -+ std::map, std::unordered_map, -+ absl::flat_hash_map, -+ absl::node_hash_map, absl::btree_map, -+ UnorderedSequence>>; -+INSTANTIATE_TYPED_TEST_SUITE_P(My, HashValueAssociativeMapTest, -+ AssociativeMapTypes); -+ -+template -+class HashValueAssociativeMultimapTest : public testing::Test {}; -+TYPED_TEST_SUITE_P(HashValueAssociativeMultimapTest); -+ -+TYPED_TEST_P(HashValueAssociativeMultimapTest, BasicUsage) { -+ using MM = TypeParam; -+ using V = typename MM::value_type; -+ std::vector exemplars{MM{}, -+ MM{V{0, "foo"}}, -+ MM{V{1, "foo"}}, -+ MM{V{0, "bar"}}, -+ MM{V{1, "bar"}}, -+ MM{V{0, "foo"}, V{0, "bar"}}, -+ MM{V{0, "bar"}, V{0, "foo"}}, -+ MM{V{0, "foo"}, V{42, "bar"}}, -+ MM{V{1, "foo"}, V{42, "bar"}}, -+ MM{V{1, "foo"}, V{1, "foo"}, V{43, "bar"}}, -+ MM{V{1, "foo"}, V{43, "bar"}, V{1, "foo"}}, -+ MM{V{1, "foo"}, V{43, "baz"}}}; -+ EXPECT_TRUE(absl::VerifyTypeImplementsAbslHashCorrectly(exemplars)); -+} -+ -+REGISTER_TYPED_TEST_SUITE_P(HashValueAssociativeMultimapTest, BasicUsage); -+using AssociativeMultimapTypes = -+ testing::Types, -+ std::unordered_multimap>; -+INSTANTIATE_TYPED_TEST_SUITE_P(My, HashValueAssociativeMultimapTest, -+ AssociativeMultimapTypes); -+ -+} // namespace ---- a/absl/hash/hash_test.cc -+++ b/absl/hash/hash_test.cc -@@ -47,6 +47,7 @@ - #include "absl/container/node_hash_map.h" - #include "absl/container/node_hash_set.h" - #include "absl/hash/hash_testing.h" -+#include "absl/hash/internal/hash_test.h" - #include "absl/hash/internal/spy_hash_state.h" - #include "absl/meta/type_traits.h" - #include "absl/numeric/int128.h" -@@ -54,52 +55,9 @@ - - namespace { - --// Utility wrapper of T for the purposes of testing the `AbslHash` type erasure --// mechanism. `TypeErasedValue` can be constructed with a `T`, and can --// be compared and hashed. However, all hashing goes through the hashing --// type-erasure framework. --template --class TypeErasedValue { -- public: -- TypeErasedValue() = default; -- TypeErasedValue(const TypeErasedValue&) = default; -- TypeErasedValue(TypeErasedValue&&) = default; -- explicit TypeErasedValue(const T& n) : n_(n) {} -- -- template -- friend H AbslHashValue(H hash_state, const TypeErasedValue& v) { -- v.HashValue(absl::HashState::Create(&hash_state)); -- return hash_state; -- } -- -- void HashValue(absl::HashState state) const { -- absl::HashState::combine(std::move(state), n_); -- } -- -- bool operator==(const TypeErasedValue& rhs) const { return n_ == rhs.n_; } -- bool operator!=(const TypeErasedValue& rhs) const { return !(*this == rhs); } -- -- private: -- T n_; --}; -- --// A TypeErasedValue refinement, for containers. It exposes the wrapped --// `value_type` and is constructible from an initializer list. --template --class TypeErasedContainer : public TypeErasedValue { -- public: -- using value_type = typename T::value_type; -- TypeErasedContainer() = default; -- TypeErasedContainer(const TypeErasedContainer&) = default; -- TypeErasedContainer(TypeErasedContainer&&) = default; -- explicit TypeErasedContainer(const T& n) : TypeErasedValue(n) {} -- TypeErasedContainer(std::initializer_list init_list) -- : TypeErasedContainer(T(init_list.begin(), init_list.end())) {} -- // one-argument constructor of value type T, to appease older toolchains that -- // get confused by one-element initializer lists in some contexts -- explicit TypeErasedContainer(const value_type& v) -- : TypeErasedContainer(T(&v, &v + 1)) {} --}; -+using ::absl::hash_test_internal::is_hashable; -+using ::absl::hash_test_internal::TypeErasedContainer; -+using ::absl::hash_test_internal::TypeErasedValue; - - template - using TypeErasedVector = TypeErasedContainer>; -@@ -117,11 +75,6 @@ - return SpyHashState::combine(SpyHashState(), value); - } - --// Helper trait to verify if T is hashable. We use absl::Hash's poison status to --// detect it. --template --using is_hashable = std::is_default_constructible>; -- - TYPED_TEST_P(HashValueIntTest, BasicUsage) { - EXPECT_TRUE((is_hashable::value)); - -@@ -520,121 +473,6 @@ - std::bitset(bit_strings[5].c_str())})); - } // namespace - --// Dummy type with unordered equality and hashing semantics. This preserves --// input order internally, and is used below to ensure we get test coverage --// for equal sequences with different iteraton orders. --template --class UnorderedSequence { -- public: -- UnorderedSequence() = default; -- template -- UnorderedSequence(std::initializer_list l) -- : values_(l.begin(), l.end()) {} -- template ::value, -- bool>::type = true> -- UnorderedSequence(ForwardIterator begin, ForwardIterator end) -- : values_(begin, end) {} -- // one-argument constructor of value type T, to appease older toolchains that -- // get confused by one-element initializer lists in some contexts -- explicit UnorderedSequence(const T& v) : values_(&v, &v + 1) {} -- -- using value_type = T; -- -- size_t size() const { return values_.size(); } -- typename std::vector::const_iterator begin() const { -- return values_.begin(); -- } -- typename std::vector::const_iterator end() const { return values_.end(); } -- -- friend bool operator==(const UnorderedSequence& lhs, -- const UnorderedSequence& rhs) { -- return lhs.size() == rhs.size() && -- std::is_permutation(lhs.begin(), lhs.end(), rhs.begin()); -- } -- friend bool operator!=(const UnorderedSequence& lhs, -- const UnorderedSequence& rhs) { -- return !(lhs == rhs); -- } -- template -- friend H AbslHashValue(H h, const UnorderedSequence& u) { -- return H::combine(H::combine_unordered(std::move(h), u.begin(), u.end()), -- u.size()); -- } -- -- private: -- std::vector values_; --}; -- --template --class HashValueSequenceTest : public testing::Test { --}; --TYPED_TEST_SUITE_P(HashValueSequenceTest); -- --TYPED_TEST_P(HashValueSequenceTest, BasicUsage) { -- EXPECT_TRUE((is_hashable::value)); -- -- using IntType = typename TypeParam::value_type; -- auto a = static_cast(0); -- auto b = static_cast(23); -- auto c = static_cast(42); -- -- std::vector exemplars = { -- TypeParam(), TypeParam(), TypeParam{a, b, c}, -- TypeParam{a, c, b}, TypeParam{c, a, b}, TypeParam{a}, -- TypeParam{a, a}, TypeParam{a, a, a}, TypeParam{a, a, b}, -- TypeParam{a, b, a}, TypeParam{b, a, a}, TypeParam{a, b}, -- TypeParam{b, c}}; -- EXPECT_TRUE(absl::VerifyTypeImplementsAbslHashCorrectly(exemplars)); --} -- --REGISTER_TYPED_TEST_SUITE_P(HashValueSequenceTest, BasicUsage); --using IntSequenceTypes = testing::Types< -- std::deque, std::forward_list, std::list, std::vector, -- std::vector, TypeErasedContainer>, std::set, -- std::multiset, UnorderedSequence, -- TypeErasedContainer>, std::unordered_set, -- std::unordered_multiset, absl::flat_hash_set, -- absl::node_hash_set, absl::btree_set>; --INSTANTIATE_TYPED_TEST_SUITE_P(My, HashValueSequenceTest, IntSequenceTypes); -- --template --class HashValueNestedSequenceTest : public testing::Test {}; --TYPED_TEST_SUITE_P(HashValueNestedSequenceTest); -- --TYPED_TEST_P(HashValueNestedSequenceTest, BasicUsage) { -- using T = TypeParam; -- using V = typename T::value_type; -- std::vector exemplars = { -- // empty case -- T{}, -- // sets of empty sets -- T{V{}}, T{V{}, V{}}, T{V{}, V{}, V{}}, -- // multisets of different values -- T{V{1}}, T{V{1, 1}, V{1, 1}}, T{V{1, 1, 1}, V{1, 1, 1}, V{1, 1, 1}}, -- // various orderings of same nested sets -- T{V{}, V{1, 2}}, T{V{}, V{2, 1}}, T{V{1, 2}, V{}}, T{V{2, 1}, V{}}, -- // various orderings of various nested sets, case 2 -- T{V{1, 2}, V{3, 4}}, T{V{1, 2}, V{4, 3}}, T{V{1, 3}, V{2, 4}}, -- T{V{1, 3}, V{4, 2}}, T{V{1, 4}, V{2, 3}}, T{V{1, 4}, V{3, 2}}, -- T{V{2, 3}, V{1, 4}}, T{V{2, 3}, V{4, 1}}, T{V{2, 4}, V{1, 3}}, -- T{V{2, 4}, V{3, 1}}, T{V{3, 4}, V{1, 2}}, T{V{3, 4}, V{2, 1}}}; -- EXPECT_TRUE(absl::VerifyTypeImplementsAbslHashCorrectly(exemplars)); --} -- --REGISTER_TYPED_TEST_SUITE_P(HashValueNestedSequenceTest, BasicUsage); --template --using TypeErasedSet = TypeErasedContainer>; -- --using NestedIntSequenceTypes = testing::Types< -- std::vector>, std::vector>, -- std::vector>, UnorderedSequence>, -- UnorderedSequence>, -- UnorderedSequence>, TypeErasedSet>, -- TypeErasedSet>, TypeErasedSet>>; --INSTANTIATE_TYPED_TEST_SUITE_P(My, HashValueNestedSequenceTest, -- NestedIntSequenceTypes); -- - // Private type that only supports AbslHashValue to make sure our chosen hash - // implementation is recursive within absl::Hash. - // It uses std::abs() on the value to provide different bitwise representations -@@ -793,64 +631,6 @@ - #endif - } - --template --class HashValueAssociativeMapTest : public testing::Test {}; --TYPED_TEST_SUITE_P(HashValueAssociativeMapTest); -- --TYPED_TEST_P(HashValueAssociativeMapTest, BasicUsage) { -- using M = TypeParam; -- using V = typename M::value_type; -- std::vector exemplars{M{}, -- M{V{0, "foo"}}, -- M{V{1, "foo"}}, -- M{V{0, "bar"}}, -- M{V{1, "bar"}}, -- M{V{0, "foo"}, V{42, "bar"}}, -- M{V{42, "bar"}, V{0, "foo"}}, -- M{V{1, "foo"}, V{42, "bar"}}, -- M{V{1, "foo"}, V{43, "bar"}}, -- M{V{1, "foo"}, V{43, "baz"}}}; -- EXPECT_TRUE(absl::VerifyTypeImplementsAbslHashCorrectly(exemplars)); --} -- --REGISTER_TYPED_TEST_SUITE_P(HashValueAssociativeMapTest, BasicUsage); --using AssociativeMapTypes = testing::Types< -- std::map, std::unordered_map, -- absl::flat_hash_map, -- absl::node_hash_map, absl::btree_map, -- UnorderedSequence>>; --INSTANTIATE_TYPED_TEST_SUITE_P(My, HashValueAssociativeMapTest, -- AssociativeMapTypes); -- --template --class HashValueAssociativeMultimapTest : public testing::Test {}; --TYPED_TEST_SUITE_P(HashValueAssociativeMultimapTest); -- --TYPED_TEST_P(HashValueAssociativeMultimapTest, BasicUsage) { -- using MM = TypeParam; -- using V = typename MM::value_type; -- std::vector exemplars{MM{}, -- MM{V{0, "foo"}}, -- MM{V{1, "foo"}}, -- MM{V{0, "bar"}}, -- MM{V{1, "bar"}}, -- MM{V{0, "foo"}, V{0, "bar"}}, -- MM{V{0, "bar"}, V{0, "foo"}}, -- MM{V{0, "foo"}, V{42, "bar"}}, -- MM{V{1, "foo"}, V{42, "bar"}}, -- MM{V{1, "foo"}, V{1, "foo"}, V{43, "bar"}}, -- MM{V{1, "foo"}, V{43, "bar"}, V{1, "foo"}}, -- MM{V{1, "foo"}, V{43, "baz"}}}; -- EXPECT_TRUE(absl::VerifyTypeImplementsAbslHashCorrectly(exemplars)); --} -- --REGISTER_TYPED_TEST_SUITE_P(HashValueAssociativeMultimapTest, BasicUsage); --using AssociativeMultimapTypes = -- testing::Types, -- std::unordered_multimap>; --INSTANTIATE_TYPED_TEST_SUITE_P(My, HashValueAssociativeMultimapTest, -- AssociativeMultimapTypes); -- - TEST(HashValueTest, ReferenceWrapper) { - EXPECT_TRUE(is_hashable>::value); - ---- /dev/null -+++ b/absl/hash/internal/hash_test.h -@@ -0,0 +1,87 @@ -+// Copyright 2023 The Abseil Authors. -+// -+// Licensed under the Apache License, Version 2.0 (the "License"); -+// you may not use this file except in compliance with the License. -+// You may obtain a copy of the License at -+// -+// https://www.apache.org/licenses/LICENSE-2.0 -+// -+// Unless required by applicable law or agreed to in writing, software -+// distributed under the License is distributed on an "AS IS" BASIS, -+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+// See the License for the specific language governing permissions and -+// limitations under the License. -+ -+// Common code shared between absl/hash/hash_test.cc and -+// absl/hash/hash_instantiated_test.cc. -+ -+#ifndef ABSL_HASH_INTERNAL_HASH_TEST_H_ -+#define ABSL_HASH_INTERNAL_HASH_TEST_H_ -+ -+#include -+#include -+ -+#include "absl/base/config.h" -+#include "absl/hash/hash.h" -+ -+namespace absl { -+ABSL_NAMESPACE_BEGIN -+namespace hash_test_internal { -+ -+// Utility wrapper of T for the purposes of testing the `AbslHash` type erasure -+// mechanism. `TypeErasedValue` can be constructed with a `T`, and can -+// be compared and hashed. However, all hashing goes through the hashing -+// type-erasure framework. -+template -+class TypeErasedValue { -+ public: -+ TypeErasedValue() = default; -+ TypeErasedValue(const TypeErasedValue&) = default; -+ TypeErasedValue(TypeErasedValue&&) = default; -+ explicit TypeErasedValue(const T& n) : n_(n) {} -+ -+ template -+ friend H AbslHashValue(H hash_state, const TypeErasedValue& v) { -+ v.HashValue(absl::HashState::Create(&hash_state)); -+ return hash_state; -+ } -+ -+ void HashValue(absl::HashState state) const { -+ absl::HashState::combine(std::move(state), n_); -+ } -+ -+ bool operator==(const TypeErasedValue& rhs) const { return n_ == rhs.n_; } -+ bool operator!=(const TypeErasedValue& rhs) const { return !(*this == rhs); } -+ -+ private: -+ T n_; -+}; -+ -+// A TypeErasedValue refinement, for containers. It exposes the wrapped -+// `value_type` and is constructible from an initializer list. -+template -+class TypeErasedContainer : public TypeErasedValue { -+ public: -+ using value_type = typename T::value_type; -+ TypeErasedContainer() = default; -+ TypeErasedContainer(const TypeErasedContainer&) = default; -+ TypeErasedContainer(TypeErasedContainer&&) = default; -+ explicit TypeErasedContainer(const T& n) : TypeErasedValue(n) {} -+ TypeErasedContainer(std::initializer_list init_list) -+ : TypeErasedContainer(T(init_list.begin(), init_list.end())) {} -+ // one-argument constructor of value type T, to appease older toolchains that -+ // get confused by one-element initializer lists in some contexts -+ explicit TypeErasedContainer(const value_type& v) -+ : TypeErasedContainer(T(&v, &v + 1)) {} -+}; -+ -+// Helper trait to verify if T is hashable. We use absl::Hash's poison status to -+// detect it. -+template -+using is_hashable = std::is_default_constructible>; -+ -+} // namespace hash_test_internal -+ABSL_NAMESPACE_END -+} // namespace absl -+ -+#endif // ABSL_HASH_INTERNAL_HASH_TEST_H_ diff --git a/debian/patches/symbolize-ppc64.diff b/debian/patches/symbolize-ppc64.diff deleted file mode 100644 index a11c27d4..00000000 --- a/debian/patches/symbolize-ppc64.diff +++ /dev/null @@ -1,118 +0,0 @@ -From: Benjamin Barenblat -Subject: Fix symbolization on PowerPC ELF v1 -Origin: backport, https://github.com/abseil/abseil-cpp/commit/372bfc86105728732fc115af46223d7a4e49f8d9 - -The big-endian PowerPC ELF ABI (ppc64 in Debian) relies on function descriptors -mapped in a non-executable segment. Make sure that segment is scanned during -symbolization. Also correct bounds computation for that segment. - ---- a/absl/debugging/symbolize_elf.inc -+++ b/absl/debugging/symbolize_elf.inc -@@ -648,8 +648,10 @@ - } - - // Return true if an address is inside a section. --static bool InSection(const void *address, const ElfW(Shdr) * section) { -- const char *start = reinterpret_cast(section->sh_addr); -+static bool InSection(const void *address, ptrdiff_t relocation, -+ const ElfW(Shdr) * section) { -+ const char *start = reinterpret_cast( -+ section->sh_addr + static_cast(relocation)); - size_t size = static_cast(section->sh_size); - return start <= address && address < (start + size); - } -@@ -689,8 +691,8 @@ - // starting address. However, we do not always want to use the real - // starting address because we sometimes want to symbolize a function - // pointer into the .opd section, e.g. FindSymbol(&foo,...). -- const bool pc_in_opd = -- kPlatformUsesOPDSections && opd != nullptr && InSection(pc, opd); -+ const bool pc_in_opd = kPlatformUsesOPDSections && opd != nullptr && -+ InSection(pc, relocation, opd); - const bool deref_function_descriptor_pointer = - kPlatformUsesOPDSections && opd != nullptr && !pc_in_opd; - -@@ -730,7 +732,7 @@ - #endif - - if (deref_function_descriptor_pointer && -- InSection(original_start_address, opd)) { -+ InSection(original_start_address, /*relocation=*/0, opd)) { - // The opd section is mapped into memory. Just dereference - // start_address to get the first double word, which points to the - // function entry. -@@ -1326,7 +1328,7 @@ - const int phnum = obj->elf_header.e_phnum; - const int phentsize = obj->elf_header.e_phentsize; - auto phoff = static_cast(obj->elf_header.e_phoff); -- size_t num_executable_load_segments = 0; -+ size_t num_interesting_load_segments = 0; - for (int j = 0; j < phnum; j++) { - ElfW(Phdr) phdr; - if (!ReadFromOffsetExact(obj->fd, &phdr, sizeof(phdr), phoff)) { -@@ -1335,23 +1337,35 @@ - return false; - } - phoff += phentsize; -- constexpr int rx = PF_X | PF_R; -- if (phdr.p_type != PT_LOAD || (phdr.p_flags & rx) != rx) { -- // Not a LOAD segment, or not executable code. -+ -+#if defined(__powerpc__) && !(_CALL_ELF > 1) -+ // On the PowerPC ELF v1 ABI, function pointers actually point to function -+ // descriptors. These descriptors are stored in an .opd section, which is -+ // mapped read-only. We thus need to look at all readable segments, not -+ // just the executable ones. -+ constexpr int interesting = PF_R; -+#else -+ constexpr int interesting = PF_X | PF_R; -+#endif -+ -+ if (phdr.p_type != PT_LOAD -+ || (phdr.p_flags & interesting) != interesting) { -+ // Not a LOAD segment, not executable code, and not a function -+ // descriptor. - continue; - } -- if (num_executable_load_segments < obj->phdr.size()) { -- memcpy(&obj->phdr[num_executable_load_segments++], &phdr, sizeof(phdr)); -+ if (num_interesting_load_segments < obj->phdr.size()) { -+ memcpy(&obj->phdr[num_interesting_load_segments++], &phdr, sizeof(phdr)); - } else { - ABSL_RAW_LOG( -- WARNING, "%s: too many executable LOAD segments: %zu >= %zu", -- obj->filename, num_executable_load_segments, obj->phdr.size()); -+ WARNING, "%s: too many interesting LOAD segments: %zu >= %zu", -+ obj->filename, num_interesting_load_segments, obj->phdr.size()); - break; - } - } -- if (num_executable_load_segments == 0) { -- // This object has no "r-x" LOAD segments. That's unexpected. -- ABSL_RAW_LOG(WARNING, "%s: no executable LOAD segments", obj->filename); -+ if (num_interesting_load_segments == 0) { -+ // This object has no interesting LOAD segments. That's unexpected. -+ ABSL_RAW_LOG(WARNING, "%s: no interesting LOAD segments", obj->filename); - return false; - } - } -@@ -1379,8 +1393,8 @@ - // X in the file will have a start address of [true relocation]+X. - relocation = static_cast(start_addr - obj->offset); - -- // Note: some binaries have multiple "rx" LOAD segments. We must -- // find the right one. -+ // Note: some binaries have multiple LOAD segments that can contain -+ // function pointers. We must find the right one. - ElfW(Phdr) *phdr = nullptr; - for (size_t j = 0; j < obj->phdr.size(); j++) { - ElfW(Phdr) &p = obj->phdr[j]; -@@ -1390,7 +1404,7 @@ - ABSL_RAW_CHECK(p.p_type == PT_NULL, "unexpected p_type"); - break; - } -- if (pc < reinterpret_cast(start_addr + p.p_memsz)) { -+ if (pc < reinterpret_cast(start_addr + p.p_vaddr + p.p_memsz)) { - phdr = &p; - break; - } -- cgit v1.2.3