diff options
-rw-r--r-- | debian/README.Debian | 9 | ||||
-rw-r--r-- | debian/changelog | 101 | ||||
-rw-r--r-- | debian/control | 56 | ||||
-rw-r--r-- | debian/copyright | 31 | ||||
-rw-r--r-- | debian/gbp.conf | 16 | ||||
-rw-r--r-- | debian/libabsl-dev.install | 19 | ||||
-rw-r--r-- | debian/libabsl20210324.install | 15 | ||||
-rw-r--r-- | debian/libabsl20210324.lintian-overrides | 16 | ||||
-rw-r--r-- | debian/libabsl20210324.shlibs | 75 | ||||
-rw-r--r-- | debian/patches/configure.diff | 115 | ||||
-rw-r--r-- | debian/patches/cordrepring-typo.diff | 20 | ||||
-rw-r--r-- | debian/patches/float-rounding.diff | 46 | ||||
-rw-r--r-- | debian/patches/latomic.diff | 20 | ||||
-rw-r--r-- | debian/patches/series | 6 | ||||
-rw-r--r-- | debian/patches/std-hash.diff | 46 | ||||
-rw-r--r-- | debian/patches/thumb-function-bounds.diff | 96 | ||||
-rwxr-xr-x | debian/rules | 54 | ||||
-rw-r--r-- | debian/source/format | 1 | ||||
-rwxr-xr-x | debian/tests/cmake | 45 | ||||
-rw-r--r-- | debian/tests/control | 19 | ||||
-rwxr-xr-x | debian/tests/smoke | 37 | ||||
-rw-r--r-- | debian/watch | 18 |
22 files changed, 861 insertions, 0 deletions
diff --git a/debian/README.Debian b/debian/README.Debian new file mode 100644 index 00000000..7c0dd3c0 --- /dev/null +++ b/debian/README.Debian @@ -0,0 +1,9 @@ +Abseil for Debian +----------------- + +libabsl-dev installs a number of files to 'internal' directories. In general, +your project should not directly include any files from these directories; they +may change without warning. If you think you need something from one of those +files, please report a bug with reportbug(1). + + -- Benjamin Barenblat <bbaren@debian.org> Thu, 07 May 2020 11:35:28 -0400 diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 00000000..5705cdaf --- /dev/null +++ b/debian/changelog @@ -0,0 +1,101 @@ +abseil (0~20210324.1-1) UNRELEASED; urgency=medium + + * New upstream release. + * Correct debian/watch search URLs to avoid picking up rc versions. + * Mangle upstream version in debian/watch to match manual mangling in + debian/changelog. + * Compute Thumb function bounds correctly. (Closes: #987314) + * Reenable unit tests on arm64. + + -- Benjamin Barenblat <bbaren@debian.org> Thu, 08 Apr 2021 10:28:01 -0400 + +abseil (0~20200923.3-3) unstable; urgency=medium + + * Fix "ftbfs with -march=x86-64-v3" by correcting the relevant unit + tests. (Closes: #983936) + * Disable double-double unit tests due to compiler bugs. + * Reenable unit tests on ppc64el. + + -- Benjamin Barenblat <bbaren@debian.org> Fri, 05 Mar 2021 15:57:38 -0500 + +abseil (0~20200923.3-2) unstable; urgency=medium + + * Correct string formatting on POWER. + + -- Benjamin Barenblat <bbaren@debian.org> Tue, 09 Feb 2021 14:41:06 -0500 + +abseil (0~20200923.3-1) unstable; urgency=medium + + * New upstream release. + * Correct endianness issues in hash functions and RNG. + + -- Benjamin Barenblat <bbaren@debian.org> Mon, 08 Feb 2021 15:04:52 -0500 + +abseil (0~20200923.2-3) unstable; urgency=medium + + * Fix some issues in unit tests. + * Re-disable unit tests on most platforms until they’re working + everywhere. + + -- Benjamin Barenblat <bbaren@debian.org> Sun, 31 Jan 2021 15:13:51 -0500 + +abseil (0~20200923.2-2) unstable; urgency=medium + + * Reenable unit tests. + + -- Benjamin Barenblat <bbaren@debian.org> Tue, 01 Dec 2020 12:37:56 -0500 + +abseil (0~20200923.2-1) unstable; urgency=medium + + * New upstream release. + * Fix build on hppa via patch. (Closes: #971768) + * Link libatomic where necessary to prevent issues with load-time + symbol resolution. (Closes: #973492) + + -- Benjamin Barenblat <bbaren@debian.org> Fri, 06 Nov 2020 16:51:39 -0500 + +abseil (0~20200923.1-1) unstable; urgency=medium + + * New upstream release. + + -- Benjamin Barenblat <bbaren@debian.org> Mon, 12 Oct 2020 12:40:50 -0400 + +abseil (0~20200923-2) unstable; urgency=medium + + * Release for unstable. + + -- Benjamin Barenblat <bbaren@debian.org> Tue, 06 Oct 2020 10:00:02 -0400 + +abseil (0~20200923-1) experimental; urgency=medium + + * New upstream release. + + -- Benjamin Barenblat <bbaren@debian.org> Fri, 25 Sep 2020 17:57:31 -0400 + +abseil (0~20200225.2-4) unstable; urgency=medium + + * Fix "autopkgtest needs update for new version of cmake: warning on + stderr" by applying a patch from upstream. (Closes: #970333) + + -- Benjamin Barenblat <bbaren@debian.org> Mon, 14 Sep 2020 17:40:05 -0400 + +abseil (0~20200225.2-3) unstable; urgency=medium + + * Replace symbols file with shlibs infrastructure. (Closes: #966183) + + -- Benjamin Barenblat <bbaren@debian.org> Fri, 24 Jul 2020 09:42:03 -0400 + +abseil (0~20200225.2-2) unstable; urgency=medium + + * Rebuild for unstable. + * Rework symbols file using pkg-kde-tools for increased robustness. + * Avoid SSSE3 on amd64 and SSE2 on i386 for greater processor + compatibility. + + -- Benjamin Barenblat <bbaren@debian.org> Thu, 23 Jul 2020 17:23:57 -0400 + +abseil (0~20200225.2-1) experimental; urgency=medium + + * Initial release. (Closes: #888705) + + -- Benjamin Barenblat <bbaren@debian.org> Thu, 18 Jun 2020 16:27:49 -0400 diff --git a/debian/control b/debian/control new file mode 100644 index 00000000..6573b8af --- /dev/null +++ b/debian/control @@ -0,0 +1,56 @@ +# Copyright 2020 Google LLC +# +# 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. + +Source: abseil +Priority: optional +Maintainer: Benjamin Barenblat <bbaren@debian.org> +Build-Depends: + cmake (>= 3.5), + debhelper-compat (= 12), + googletest (>= 1.10.0.20200926) [amd64 arm64 ppc64el], +Rules-Requires-Root: no +Standards-Version: 4.5.1 +Section: libs +Homepage: https://abseil.io/ +Vcs-Browser: https://salsa.debian.org/debian/abseil +Vcs-Git: https://salsa.debian.org/debian/abseil.git +Description: extensions to the C++ standard library + Abseil is an open-source collection of C++ library code designed to augment the + C++ standard library. The Abseil library code is collected from Google's C++ + codebase and has been extensively tested and used in production. In some cases, + Abseil provides pieces missing from the C++ standard; in others, Abseil + provides alternatives to the standard for special needs. + +Package: libabsl-dev +Architecture: any +Multi-Arch: same +Section: libdevel +Depends: + libabsl20210324 (= ${binary:Version}), + ${misc:Depends}, +Recommends: cmake (>= 2.6) | pkg-config, g++ (>= 5.1) +Description: ${source:Synopsis} (development files) + ${source:Extended-Description} + . + This package contains header files and other data necessary for developing with + Abseil. + +Package: libabsl20210324 +Architecture: any +Multi-Arch: same +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: ${source:Synopsis} + ${source:Extended-Description} + . + This package contains Abseil's shared libraries. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 00000000..986a4261 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,31 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: Abseil +Upstream-Contact: abseil-io@googlegroups.com +Source: https://github.com/abseil/abseil-cpp/ +Copyright: 2017 The Abseil Authors +License: Apache-2.0 + +Files: * +Copyright: + 2000-2017 Google Inc. + 2017-2021 The Abseil Authors +License: Apache-2.0 + +Files: debian/* +Copyright: 2020 Google LLC +License: Apache-2.0 + +License: Apache-2.0 + 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. + . + On Debian systems, the complete text of the Apache License, Version 2.0, can be + found in "/usr/share/common-licenses/Apache-2.0". diff --git a/debian/gbp.conf b/debian/gbp.conf new file mode 100644 index 00000000..f54fc37e --- /dev/null +++ b/debian/gbp.conf @@ -0,0 +1,16 @@ +# Copyright 2020 Google LLC +# +# 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. + +[DEFAULT] +upstream-tag = 20210324.1 diff --git a/debian/libabsl-dev.install b/debian/libabsl-dev.install new file mode 100644 index 00000000..9e2cb20e --- /dev/null +++ b/debian/libabsl-dev.install @@ -0,0 +1,19 @@ +# Copyright 2020 Google LLC +# +# 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. + +usr/include/absl +usr/lib/*/*.a +usr/lib/*/*.so +usr/lib/*/cmake +usr/lib/*/pkgconfig/*.pc diff --git a/debian/libabsl20210324.install b/debian/libabsl20210324.install new file mode 100644 index 00000000..ab3017e5 --- /dev/null +++ b/debian/libabsl20210324.install @@ -0,0 +1,15 @@ +# Copyright 2020 Google LLC +# +# 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. + +usr/lib/*/libabsl_*.so.* diff --git a/debian/libabsl20210324.lintian-overrides b/debian/libabsl20210324.lintian-overrides new file mode 100644 index 00000000..7557abac --- /dev/null +++ b/debian/libabsl20210324.lintian-overrides @@ -0,0 +1,16 @@ +# Copyright 2020 Google LLC +# +# 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. + +libabsl20210324: no-symbols-control-file usr/lib/*/libabsl_* +libabsl20210324: package-name-doesnt-match-sonames libabsl-* diff --git a/debian/libabsl20210324.shlibs b/debian/libabsl20210324.shlibs new file mode 100644 index 00000000..64ae93f1 --- /dev/null +++ b/debian/libabsl20210324.shlibs @@ -0,0 +1,75 @@ +# Copyright 2020 Google LLC +# +# 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. +# +libabsl_bad_any_cast_impl 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_bad_optional_access 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_bad_variant_access 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_base 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_city 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_civil_time 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_cord 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_debugging_internal 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_demangle_internal 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_examine_stack 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_exponential_biased 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_failure_signal_handler 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_flags 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_flags_commandlineflag 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_flags_commandlineflag_internal 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_flags_config 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_flags_internal 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_flags_marshalling 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_flags_parse 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_flags_private_handle_accessor 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_flags_program_name 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_flags_reflection 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_flags_usage 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_flags_usage_internal 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_graphcycles_internal 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_hash 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_hashtablez_sampler 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_int128 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_leak_check 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_leak_check_disable 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_log_severity 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_malloc_internal 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_periodic_sampler 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_random_distributions 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_random_internal_distribution_test_util 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_random_internal_platform 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_random_internal_pool_urbg 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_random_internal_randen 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_random_internal_randen_hwaes 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_random_internal_randen_hwaes_impl 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_random_internal_randen_slow 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_random_internal_seed_material 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_random_seed_gen_exception 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_random_seed_sequences 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_raw_hash_set 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_raw_logging_internal 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_scoped_set_env 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_spinlock_wait 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_stacktrace 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_status 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_statusor 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_str_format_internal 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_strerror 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_strings 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_strings_internal 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_symbolize 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_synchronization 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_throw_delegate 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_time 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_time_zone 20210324 libabsl20210324 (>= 0~20210324.1-1) +libabsl_wyhash 20210324 libabsl20210324 (>= 0~20210324.1-1) diff --git a/debian/patches/configure.diff b/debian/patches/configure.diff new file mode 100644 index 00000000..8138899f --- /dev/null +++ b/debian/patches/configure.diff @@ -0,0 +1,115 @@ +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. + + - 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. + + - Disable Intel SSSE3 entirely, since no i386 processor supports it and Debian + supports amd64 processors without it. + +--- a/CMake/AbseilHelpers.cmake ++++ b/CMake/AbseilHelpers.cmake +@@ -263,7 +263,8 @@ + if(ABSL_ENABLE_INSTALL) + set_target_properties(${_NAME} PROPERTIES + OUTPUT_NAME "absl_${_NAME}" +- SOVERSION "2103.0.1" ++ SOVERSION 20210324 ++ VERSION "20210324.0.0" + ) + endif() + else() +--- a/absl/base/options.h ++++ b/absl/base/options.h +@@ -100,7 +100,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 +@@ -127,7 +127,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 +@@ -154,7 +154,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 + // +@@ -180,7 +180,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 +@@ -206,7 +206,7 @@ + // allowed. + + #define ABSL_OPTION_USE_INLINE_NAMESPACE 1 +-#define ABSL_OPTION_INLINE_NAMESPACE_NAME lts_20210324 ++#define ABSL_OPTION_INLINE_NAMESPACE_NAME debian2 + + // 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 @@ + #define ABSL_CONTAINER_INTERNAL_HAVE_SSE_H_ + + #ifndef ABSL_INTERNAL_RAW_HASH_SET_HAVE_SSE2 +-#if defined(__SSE2__) || \ +- (defined(_MSC_VER) && \ +- (defined(_M_X64) || (defined(_M_IX86) && _M_IX86_FP >= 2))) ++#if defined(__x86_64__) || (defined(_MSC_VER) && defined(_M_X64)) + #define ABSL_INTERNAL_RAW_HASH_SET_HAVE_SSE2 1 + #else + #define ABSL_INTERNAL_RAW_HASH_SET_HAVE_SSE2 0 + #endif + #endif + +-#ifndef ABSL_INTERNAL_RAW_HASH_SET_HAVE_SSSE3 +-#ifdef __SSSE3__ +-#define ABSL_INTERNAL_RAW_HASH_SET_HAVE_SSSE3 1 +-#else + #define ABSL_INTERNAL_RAW_HASH_SET_HAVE_SSSE3 0 +-#endif +-#endif + + #if ABSL_INTERNAL_RAW_HASH_SET_HAVE_SSSE3 && \ + !ABSL_INTERNAL_RAW_HASH_SET_HAVE_SSE2 diff --git a/debian/patches/cordrepring-typo.diff b/debian/patches/cordrepring-typo.diff new file mode 100644 index 00000000..6f21896b --- /dev/null +++ b/debian/patches/cordrepring-typo.diff @@ -0,0 +1,20 @@ +From: Benjamin Barenblat <bbaren@google.com> +Subject: Fix typo in CordRepRing error message +Forwarded: yes +Applied-Upstream: https://github.com/abseil/abseil-cpp/commit/b97a1ecda869ca8754d467a56c50275cebfeb328 + +The author works at Google. Upstream applied this patch as Piper +revision 367481280 and exported it to GitHub; the Applied-Upstream URL +above points to the exported commit. + +--- a/absl/strings/internal/cord_rep_ring.cc ++++ b/absl/strings/internal/cord_rep_ring.cc +@@ -301,7 +301,7 @@ + if (offset >= child->length || entry_length > child->length - offset) { + output << "entry[" << head << "] has offset " << offset + << " and entry length " << entry_length +- << " which are outside of the childs length of " << child->length; ++ << " which are outside of the child's length of " << child->length; + return false; + } + diff --git a/debian/patches/float-rounding.diff b/debian/patches/float-rounding.diff new file mode 100644 index 00000000..005e08be --- /dev/null +++ b/debian/patches/float-rounding.diff @@ -0,0 +1,46 @@ +From: Benjamin Barenblat <bbaren@google.com> +Subject: Round floats using round(x), not static_cast<int>(x + 0.5) +Forwarded: yes +Applied-Upstream: https://github.com/abseil/abseil-cpp/commit/d96e287417766deddbff2d01b96321288c59491e + +Adding 0.5 to an IEEE float may cause one bit of precision loss, which +is enough to change the result in certain cases. For example, + + static_cast<int>(std::round(0.49999999999999994)) == 0 + static_cast<int>(0.49999999999999994 + 0.5) == 1 + +The author works at Google. Upstream applied this patch as Piper +revision 369926519 and exported it to GitHub; the Applied-Upstream URL +above points to the exported commit. + +--- a/absl/time/duration_test.cc ++++ b/absl/time/duration_test.cc +@@ -1320,7 +1320,7 @@ TEST(Duration, SmallConversions) { + + EXPECT_EQ(absl::ZeroDuration(), absl::Seconds(0)); + // TODO(bww): Is the next one OK? +- EXPECT_EQ(absl::ZeroDuration(), absl::Seconds(0.124999999e-9)); ++ EXPECT_EQ(absl::ZeroDuration(), absl::Seconds(std::nextafter(0.125e-9, 0))); + EXPECT_EQ(absl::Nanoseconds(1) / 4, absl::Seconds(0.125e-9)); + EXPECT_EQ(absl::Nanoseconds(1) / 4, absl::Seconds(0.250e-9)); + EXPECT_EQ(absl::Nanoseconds(1) / 2, absl::Seconds(0.375e-9)); +@@ -1330,7 +1330,7 @@ TEST(Duration, SmallConversions) { + EXPECT_EQ(absl::Nanoseconds(1), absl::Seconds(0.875e-9)); + EXPECT_EQ(absl::Nanoseconds(1), absl::Seconds(1.000e-9)); + +- EXPECT_EQ(absl::ZeroDuration(), absl::Seconds(-0.124999999e-9)); ++ EXPECT_EQ(absl::ZeroDuration(), absl::Seconds(std::nextafter(-0.125e-9, 0))); + EXPECT_EQ(-absl::Nanoseconds(1) / 4, absl::Seconds(-0.125e-9)); + EXPECT_EQ(-absl::Nanoseconds(1) / 4, absl::Seconds(-0.250e-9)); + EXPECT_EQ(-absl::Nanoseconds(1) / 2, absl::Seconds(-0.375e-9)); +--- a/absl/time/time.h ++++ b/absl/time/time.h +@@ -1352,7 +1352,7 @@ + inline Duration MakePosDoubleDuration(double n) { + const int64_t int_secs = static_cast<int64_t>(n); + const uint32_t ticks = static_cast<uint32_t>( +- (n - static_cast<double>(int_secs)) * kTicksPerSecond + 0.5); ++ std::round((n - static_cast<double>(int_secs)) * kTicksPerSecond)); + return ticks < kTicksPerSecond + ? MakeDuration(int_secs, ticks) + : MakeDuration(int_secs + 1, ticks - kTicksPerSecond); diff --git a/debian/patches/latomic.diff b/debian/patches/latomic.diff new file mode 100644 index 00000000..404144e2 --- /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 +@@ -62,4 +62,8 @@ + set(ABSL_TEST_COPTS "") + endif() + ++list(APPEND ABSL_DEFAULT_LINKOPTS ++ "-Wl,--as-needed" "-latomic" "-Wl,--no-as-needed" ++) ++ + set(ABSL_CXX_STANDARD "${CMAKE_CXX_STANDARD}") diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 00000000..4e55e401 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1,6 @@ +configure.diff +std-hash.diff +latomic.diff +cordrepring-typo.diff +thumb-function-bounds.diff +float-rounding.diff diff --git a/debian/patches/std-hash.diff b/debian/patches/std-hash.diff new file mode 100644 index 00000000..52096742 --- /dev/null +++ b/debian/patches/std-hash.diff @@ -0,0 +1,46 @@ +From: Benjamin Barenblat <bbaren@google.com> +Subject: Work around broken std::hash on s390x +Forwarded: no +Bug-Debian: https://bugs.debian.org/977638 + +On s390x, std::hash hashes large classes of data to the same value, which +violates assumptions made by the Abseil tests. #ifdef out the test code that +depends on those assumptions. + +--- a/absl/hash/hash_test.cc ++++ b/absl/hash/hash_test.cc +@@ -358,6 +358,8 @@ + TEST(HashValueTest, StdBitset) { + EXPECT_TRUE((is_hashable<std::bitset<257>>::value)); + ++ // The following assertions fail on s390x (https://bugs.debian.org/977638). ++#ifndef __s390x__ + EXPECT_TRUE(absl::VerifyTypeImplementsAbslHashCorrectly( + {std::bitset<2>("00"), std::bitset<2>("01"), std::bitset<2>("10"), + std::bitset<2>("11")})); +@@ -379,6 +381,7 @@ + std::bitset<kNumBits>(bit_strings[3].c_str()), + std::bitset<kNumBits>(bit_strings[4].c_str()), + std::bitset<kNumBits>(bit_strings[5].c_str())})); ++#endif + } // namespace + + template <typename T> +@@ -400,10 +403,15 @@ + } + + REGISTER_TYPED_TEST_CASE_P(HashValueSequenceTest, BasicUsage); ++// std::vector<bool> tests fail on s390x, so exclude them. See ++// https://bugs.debian.org/977638. + using IntSequenceTypes = + testing::Types<std::deque<int>, std::forward_list<int>, std::list<int>, +- std::vector<int>, std::vector<bool>, std::set<int>, +- std::multiset<int>>; ++ std::vector<int>, ++#ifndef __s390x__ ++ std::vector<bool>, ++#endif ++ std::set<int>, std::multiset<int>>; + INSTANTIATE_TYPED_TEST_CASE_P(My, HashValueSequenceTest, IntSequenceTypes); + + // Private type that only supports AbslHashValue to make sure our chosen hash diff --git a/debian/patches/thumb-function-bounds.diff b/debian/patches/thumb-function-bounds.diff new file mode 100644 index 00000000..1fd8c729 --- /dev/null +++ b/debian/patches/thumb-function-bounds.diff @@ -0,0 +1,96 @@ +From: Benjamin Barenblat <bbaren@google.com> +Subject: Correct Thumb function bound computation in the symbolizer +Forwarded: yes +Applied-Upstream: https://github.com/abseil/abseil-cpp/commit/1ae9b71c474628d60eb251a3f62967fe64151bb2 + +On 32-bit ARM, all functions are aligned to multiples of two bytes, and +the lowest-order bit in a function’s address is ignored by the CPU when +computing branch targets. That bit is still present in instructions and +ELF symbol tables, though; it’s repurposed to indicate whether the +function contains ARM or Thumb code. If the symbolizer doesn’t ignore +that bit, it will believe Thumb functions have boundaries that are off +by one byte, so instruct the symbolizer to null out the lowest-order bit +after retrieving it from the symbol table. + +The author works at Google. Upstream applied this patch as Piper +revision 369254082 and exported it to GitHub; the Applied-Upstream URL +above points to the exported commit. + +--- a/absl/debugging/symbolize_elf.inc ++++ b/absl/debugging/symbolize_elf.inc +@@ -701,6 +701,16 @@ + const char *start_address = + ComputeOffset(original_start_address, relocation); + ++#ifdef __arm__ ++ // ARM functions are always aligned to multiples of two bytes; the ++ // lowest-order bit in start_address is ignored by the CPU and indicates ++ // whether the function contains ARM (0) or Thumb (1) code. We don't care ++ // about what encoding is being used; we just want the real start address ++ // of the function. ++ start_address = reinterpret_cast<const char *>( ++ reinterpret_cast<uintptr_t>(start_address) & ~1); ++#endif ++ + if (deref_function_descriptor_pointer && + InSection(original_start_address, opd)) { + // The opd section is mapped into memory. Just dereference +--- a/absl/debugging/symbolize_test.cc ++++ b/absl/debugging/symbolize_test.cc +@@ -477,6 +477,46 @@ + #endif + } + ++#if defined(__arm__) && ABSL_HAVE_ATTRIBUTE(target) ++// Test that we correctly identify bounds of Thumb functions on ARM. ++// ++// Thumb functions have the lowest-order bit set in their addresses in the ELF ++// symbol table. This requires some extra logic to properly compute function ++// bounds. To test this logic, nudge a Thumb function right up against an ARM ++// function and try to symbolize the ARM function. ++// ++// A naive implementation will simply use the Thumb function's entry point as ++// written in the symbol table and will therefore treat the Thumb function as ++// extending one byte further in the instruction stream than it actually does. ++// When asked to symbolize the start of the ARM function, it will identify an ++// overlap between the Thumb and ARM functions, and it will return the name of ++// the Thumb function. ++// ++// A correct implementation, on the other hand, will null out the lowest-order ++// bit in the Thumb function's entry point. It will correctly compute the end of ++// the Thumb function, it will find no overlap between the Thumb and ARM ++// functions, and it will return the name of the ARM function. ++ ++__attribute__((target("thumb"))) int ArmThumbOverlapThumb(int x) { ++ return x * x * x; ++} ++ ++__attribute__((target("arm"))) int ArmThumbOverlapArm(int x) { ++ return x * x * x; ++} ++ ++void ABSL_ATTRIBUTE_NOINLINE TestArmThumbOverlap() { ++#if defined(ABSL_HAVE_ATTRIBUTE_NOINLINE) ++ const char *symbol = TrySymbolize((void *)&ArmThumbOverlapArm); ++ ABSL_RAW_CHECK(symbol != nullptr, "TestArmThumbOverlap failed"); ++ ABSL_RAW_CHECK(strcmp("ArmThumbOverlapArm()", symbol) == 0, ++ "TestArmThumbOverlap failed"); ++ std::cout << "TestArmThumbOverlap passed" << std::endl; ++#endif ++} ++ ++#endif // defined(__arm__) && ABSL_HAVE_ATTRIBUTE(target) ++ + #elif defined(_WIN32) + #if !defined(ABSL_CONSUME_DLL) + +@@ -551,6 +591,9 @@ + TestWithPCInsideInlineFunction(); + TestWithPCInsideNonInlineFunction(); + TestWithReturnAddress(); ++#if defined(__arm__) && ABSL_HAVE_ATTRIBUTE(target) ++ TestArmThumbOverlap(); ++#endif + #endif + + return RUN_ALL_TESTS(); diff --git a/debian/rules b/debian/rules new file mode 100755 index 00000000..d9a52e99 --- /dev/null +++ b/debian/rules @@ -0,0 +1,54 @@ +#!/usr/bin/make -f +# Copyright 2020 Google LLC +# +# 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. + +include /usr/share/dpkg/architecture.mk + +export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow reproducible=+fixfilepath + +# Unit tests aren't working on all platforms yet. +ifneq ($(filter $(DEB_HOST_ARCH),amd64 arm64 ppc64el),) +ABSL_RUN_TESTS=ON +else +ABSL_RUN_TESTS=OFF +endif + +%: + dh $@ + +override_dh_auto_clean: + $(RM) -r $(CURDIR)/static + $(RM) -r $(CURDIR)/shared + +override_dh_auto_configure: + dh_auto_configure -Bstatic -- -DCMAKE_CXX_STANDARD=14 -DBUILD_SHARED_LIBS=OFF +ifeq ($(ABSL_RUN_TESTS),ON) + dh_auto_configure -Bshared -- -DCMAKE_CXX_STANDARD=14 -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=ON -DABSL_USE_GOOGLETEST_HEAD=OFF +else + dh_auto_configure -Bshared -- -DCMAKE_CXX_STANDARD=14 -DBUILD_SHARED_LIBS=ON +endif + +override_dh_auto_build: + dh_auto_build -Bstatic + dh_auto_build -Bshared + +ifeq ($(ABSL_RUN_TESTS),ON) +override_dh_auto_test: + dh_auto_test -Bshared +endif + +override_dh_auto_install: + dh_auto_install -Bstatic + dh_auto_install -Bshared + find debian/tmp -type d -empty -delete diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 00000000..163aaf8d --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/tests/cmake b/debian/tests/cmake new file mode 100755 index 00000000..1eb04de9 --- /dev/null +++ b/debian/tests/cmake @@ -0,0 +1,45 @@ +#!/bin/sh -eu +# Copyright 2020 Google LLC +# +# 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. + +readonly TMP="$(mktemp -d)" +trap "rm -rf \"$TMP\"" EXIT +cd "$TMP" + +cat >test.cc <<EOF +#include <absl/strings/numbers.h> + +int main(int argc, char* argv[]) { + int n; + if (!absl::SimpleAtoi(argv[1], &n)) { + return 1; + } + return n; +} +EOF + +cat >CMakeLists.txt <<EOF +cmake_minimum_required(VERSION 3.5) +project(test CXX) +set(CMAKE_CXX_STANDARD 14) +add_executable(test test.cc) +find_package(absl REQUIRED) +target_link_libraries(test absl::strings) +EOF + +mkdir build +cd build +cmake .. +make +./test 0 diff --git a/debian/tests/control b/debian/tests/control new file mode 100644 index 00000000..43dc87cb --- /dev/null +++ b/debian/tests/control @@ -0,0 +1,19 @@ +# Copyright 2020 Google LLC +# +# 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. + +Tests: smoke +Depends: @, g++, libgtest-dev + +Tests: cmake +Depends: @, cmake (>= 3.5), g++, make diff --git a/debian/tests/smoke b/debian/tests/smoke new file mode 100755 index 00000000..7c4b66fa --- /dev/null +++ b/debian/tests/smoke @@ -0,0 +1,37 @@ +#!/bin/sh -eu +# Copyright 2020 Google LLC +# +# 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. + +readonly TMP="$(mktemp -d)" +trap "rm -rf \"$TMP\"" EXIT +cd "$TMP" + +cat >smoke.cc <<EOF +#include <absl/strings/str_join.h> +#include <gtest/gtest.h> + +#include <vector> + +namespace { + +TEST(AbseilTest, StrJoinWorks) { + std::vector<std::string> v = {"foo", "bar", "baz"}; + EXPECT_EQ(absl::StrJoin(v, "-"), "foo-bar-baz"); +} + +} // namespace +EOF + +g++ -o smoke smoke.cc -labsl_strings -lgtest -lgtest_main -pthread +./smoke diff --git a/debian/watch b/debian/watch new file mode 100644 index 00000000..e621a589 --- /dev/null +++ b/debian/watch @@ -0,0 +1,18 @@ +# Copyright 2020 Google LLC +# +# 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. + +version=4 +opts="filenamemangle=s%(?:.*?)?v?(\d[\d.]*)\.tar\.gz%@PACKAGE@-$1.tar.gz%, uversionmangle=s/^/0~/" \ + https://github.com/abseil/abseil-cpp/releases \ + (?:.*?/)?v?(\d[\d.]*)\.tar\.gz |