diff options
-rw-r--r-- | debian/README.Debian | 9 | ||||
-rw-r--r-- | debian/changelog | 68 | ||||
-rw-r--r-- | debian/control | 56 | ||||
-rw-r--r-- | debian/copyright | 35 | ||||
-rw-r--r-- | debian/gbp.conf | 16 | ||||
-rw-r--r-- | debian/libabsl-dev.install | 18 | ||||
-rw-r--r-- | debian/libabsl20200923.install | 74 | ||||
-rw-r--r-- | debian/libabsl20200923.lintian-overrides | 17 | ||||
-rw-r--r-- | debian/libabsl20200923.shlibs | 74 | ||||
-rw-r--r-- | debian/patches/configure.diff | 115 | ||||
-rw-r--r-- | debian/patches/cpu-frequency.diff | 54 | ||||
-rw-r--r-- | debian/patches/fix-hppa.diff | 26 | ||||
-rw-r--r-- | debian/patches/latomic.diff | 20 | ||||
-rw-r--r-- | debian/patches/nan-narrowing.diff | 25 | ||||
-rw-r--r-- | debian/patches/series | 6 | ||||
-rw-r--r-- | debian/patches/std-hash.diff | 46 | ||||
-rwxr-xr-x | debian/rules | 52 | ||||
-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 | 17 |
22 files changed, 830 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..fbf84fc7 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,68 @@ +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..3cfd969c --- /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], +Rules-Requires-Root: no +Standards-Version: 4.5.0 +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: + libabsl20200923 (= ${binary:Version}), + ${misc:Depends}, +Recommends: cmake (>= 2.6), g++ (>= 4.7) +Description: ${source:Synopsis} (development files) + ${source:Extended-Description} + . + This package contains header files and other data necessary for developing with + Abseil. + +Package: libabsl20200923 +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..78336c12 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,35 @@ +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-2020 The Abseil Authors +License: Apache-2.0 + +Files: debian/* +Copyright: 2020 Google LLC +License: Apache-2.0 + +Files: debian/patches/fix-hppa.diff +Copyright: 2020 John David Anglin <dave.anglin@bell.net> +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..22576c83 --- /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 = 20200923.2 diff --git a/debian/libabsl-dev.install b/debian/libabsl-dev.install new file mode 100644 index 00000000..db5108c6 --- /dev/null +++ b/debian/libabsl-dev.install @@ -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. + +usr/include/absl +usr/lib/*/*.a +usr/lib/*/*.so +usr/lib/*/cmake diff --git a/debian/libabsl20200923.install b/debian/libabsl20200923.install new file mode 100644 index 00000000..e5967b9d --- /dev/null +++ b/debian/libabsl20200923.install @@ -0,0 +1,74 @@ +# 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_bad_any_cast_impl.so.* +usr/lib/*/libabsl_bad_optional_access.so.* +usr/lib/*/libabsl_bad_variant_access.so.* +usr/lib/*/libabsl_base.so.* +usr/lib/*/libabsl_city.so.* +usr/lib/*/libabsl_civil_time.so.* +usr/lib/*/libabsl_cord.so.* +usr/lib/*/libabsl_debugging_internal.so.* +usr/lib/*/libabsl_demangle_internal.so.* +usr/lib/*/libabsl_examine_stack.so.* +usr/lib/*/libabsl_exponential_biased.so.* +usr/lib/*/libabsl_failure_signal_handler.so.* +usr/lib/*/libabsl_flags.so.* +usr/lib/*/libabsl_flags_commandlineflag.so.* +usr/lib/*/libabsl_flags_commandlineflag_internal.so.* +usr/lib/*/libabsl_flags_config.so.* +usr/lib/*/libabsl_flags_internal.so.* +usr/lib/*/libabsl_flags_marshalling.so.* +usr/lib/*/libabsl_flags_parse.so.* +usr/lib/*/libabsl_flags_private_handle_accessor.so.* +usr/lib/*/libabsl_flags_program_name.so.* +usr/lib/*/libabsl_flags_reflection.so.* +usr/lib/*/libabsl_flags_usage.so.* +usr/lib/*/libabsl_flags_usage_internal.so.* +usr/lib/*/libabsl_graphcycles_internal.so.* +usr/lib/*/libabsl_hash.so.* +usr/lib/*/libabsl_hashtablez_sampler.so.* +usr/lib/*/libabsl_int128.so.* +usr/lib/*/libabsl_leak_check.so.* +usr/lib/*/libabsl_leak_check_disable.so.* +usr/lib/*/libabsl_log_severity.so.* +usr/lib/*/libabsl_malloc_internal.so.* +usr/lib/*/libabsl_periodic_sampler.so.* +usr/lib/*/libabsl_random_distributions.so.* +usr/lib/*/libabsl_random_internal_distribution_test_util.so.* +usr/lib/*/libabsl_random_internal_platform.so.* +usr/lib/*/libabsl_random_internal_pool_urbg.so.* +usr/lib/*/libabsl_random_internal_randen.so.* +usr/lib/*/libabsl_random_internal_randen_hwaes.so.* +usr/lib/*/libabsl_random_internal_randen_hwaes_impl.so.* +usr/lib/*/libabsl_random_internal_randen_slow.so.* +usr/lib/*/libabsl_random_internal_seed_material.so.* +usr/lib/*/libabsl_random_seed_gen_exception.so.* +usr/lib/*/libabsl_random_seed_sequences.so.* +usr/lib/*/libabsl_raw_hash_set.so.* +usr/lib/*/libabsl_raw_logging_internal.so.* +usr/lib/*/libabsl_scoped_set_env.so.* +usr/lib/*/libabsl_spinlock_wait.so.* +usr/lib/*/libabsl_stacktrace.so.* +usr/lib/*/libabsl_status.so.* +usr/lib/*/libabsl_statusor.so.* +usr/lib/*/libabsl_str_format_internal.so.* +usr/lib/*/libabsl_strerror.so.* +usr/lib/*/libabsl_strings.so.* +usr/lib/*/libabsl_strings_internal.so.* +usr/lib/*/libabsl_symbolize.so.* +usr/lib/*/libabsl_synchronization.so.* +usr/lib/*/libabsl_throw_delegate.so.* +usr/lib/*/libabsl_time.so.* +usr/lib/*/libabsl_time_zone.so.* diff --git a/debian/libabsl20200923.lintian-overrides b/debian/libabsl20200923.lintian-overrides new file mode 100644 index 00000000..1fed50f7 --- /dev/null +++ b/debian/libabsl20200923.lintian-overrides @@ -0,0 +1,17 @@ +# 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. + +libabsl20200923: no-symbols-control-file usr/lib/*/libabsl_* +libabsl20200923: package-name-doesnt-match-sonames libabsl-* +libabsl20200923: spelling-error-in-binary usr/lib/*/libabsl_flags_usage_internal.so* helpfull helpful diff --git a/debian/libabsl20200923.shlibs b/debian/libabsl20200923.shlibs new file mode 100644 index 00000000..e84201fb --- /dev/null +++ b/debian/libabsl20200923.shlibs @@ -0,0 +1,74 @@ +# 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 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_bad_optional_access 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_bad_variant_access 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_base 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_city 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_civil_time 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_cord 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_debugging_internal 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_demangle_internal 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_examine_stack 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_exponential_biased 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_failure_signal_handler 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_flags 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_flags_commandlineflag 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_flags_commandlineflag_internal 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_flags_config 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_flags_internal 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_flags_marshalling 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_flags_parse 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_flags_private_handle_accessor 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_flags_program_name 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_flags_reflection 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_flags_usage 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_flags_usage_internal 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_graphcycles_internal 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_hash 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_hashtablez_sampler 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_int128 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_leak_check 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_leak_check_disable 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_log_severity 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_malloc_internal 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_periodic_sampler 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_random_distributions 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_random_internal_distribution_test_util 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_random_internal_platform 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_random_internal_pool_urbg 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_random_internal_randen 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_random_internal_randen_hwaes 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_random_internal_randen_hwaes_impl 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_random_internal_randen_slow 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_random_internal_seed_material 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_random_seed_gen_exception 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_random_seed_sequences 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_raw_hash_set 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_raw_logging_internal 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_scoped_set_env 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_spinlock_wait 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_stacktrace 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_status 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_statusor 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_str_format_internal 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_strerror 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_strings 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_strings_internal 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_symbolize 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_synchronization 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_throw_delegate 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_time 20200923 libabsl20200923 (>= 0~20200923-1) +libabsl_time_zone 20200923 libabsl20200923 (>= 0~20200923-1) diff --git a/debian/patches/configure.diff b/debian/patches/configure.diff new file mode 100644 index 00000000..5c47b152 --- /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 +@@ -217,6 +217,9 @@ + OUTPUT_NAME "absl_${_NAME}" + ) + endif() ++ ++ set_property(TARGET ${_NAME} PROPERTY SOVERSION 20200923) ++ set_property(TARGET ${_NAME} PROPERTY VERSION "20200923.0.1") + else() + # Generating header-only library + add_library(${_NAME} INTERFACE) +--- 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_2020_09_23 ++#define ABSL_OPTION_INLINE_NAMESPACE_NAME debian1 + + // 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/cpu-frequency.diff b/debian/patches/cpu-frequency.diff new file mode 100644 index 00000000..adfba7e0 --- /dev/null +++ b/debian/patches/cpu-frequency.diff @@ -0,0 +1,54 @@ +From: Benjamin Barenblat <bbaren@google.com> +Subject: Ignore missing CPU frequency on more architectures +Forwarded: yes +Applied-Upstream: https://github.com/abseil/abseil-cpp/commit/1918ad2ae38aa32c74b558b322479a8efdd76363 + +Linux on MIPS, PA-RISC, RISC-V, and SystemZ doesn’t expose the nominal CPU +frequency via /sys, so don’t worry if `NominalCPUFrequency` returns 1.0 on those +platforms. + +Some POWER machines expose the CPU frequency; others do not. Since we can’t +predict which type of machine the tests will run on, simply disable testing for +`NominalCPUFrequency` on POWER. + +The author works at Google. Upstream applied this patch as Piper revision +347079873 and exported it to GitHub; the Applied-Upstream URL above points to +the exported commit. + +--- a/absl/base/internal/sysinfo_test.cc ++++ b/absl/base/internal/sysinfo_test.cc +@@ -37,17 +37,28 @@ TEST(SysinfoTest, NumCPUs) { + << "NumCPUs() should not have the default value of 0"; + } + ++// Ensure that NominalCPUFrequency returns a reasonable value, or 1.00 on ++// platforms where the CPU frequency is not available through sysfs. ++// ++// POWER is particularly problematic here; some Linux kernels expose the CPU ++// frequency, while others do not. Since we can't predict a priori what a given ++// machine is going to do, just disable this test on POWER on Linux. ++#if !(defined(__linux) && (defined(__ppc64__) || defined(__PPC64__))) + TEST(SysinfoTest, NominalCPUFrequency) { +-#if !(defined(__aarch64__) && defined(__linux__)) && !defined(__EMSCRIPTEN__) +- EXPECT_GE(NominalCPUFrequency(), 1000.0) +- << "NominalCPUFrequency() did not return a reasonable value"; +-#else +- // Aarch64 cannot read the CPU frequency from sysfs, so we get back 1.0. +- // Emscripten does not have a sysfs to read from at all. ++ // Linux only exposes the CPU frequency on certain architectures, and ++ // Emscripten doesn't expose it at all. ++#if defined(__linux__) && \ ++ (defined(__aarch64__) || defined(__hppa__) || defined(__mips__) || \ ++ defined(__riscv) || defined(__s390x__)) || \ ++ defined(__EMSCRIPTEN__) + EXPECT_EQ(NominalCPUFrequency(), 1.0) + << "CPU frequency detection was fixed! Please update unittest."; ++#else ++ EXPECT_GE(NominalCPUFrequency(), 1000.0) ++ << "NominalCPUFrequency() did not return a reasonable value"; + #endif + } ++#endif + + TEST(SysinfoTest, GetTID) { + EXPECT_EQ(GetTID(), GetTID()); // Basic compile and equality test. diff --git a/debian/patches/fix-hppa.diff b/debian/patches/fix-hppa.diff new file mode 100644 index 00000000..915efff4 --- /dev/null +++ b/debian/patches/fix-hppa.diff @@ -0,0 +1,26 @@ +From: John David Anglin <dave.anglin@bell.net> +Subject: Fix build on hppa +Bug-Debian: https://bugs.debian.org/971768 +Reviewed-by: Benjamin Barenblat <bbaren@debian.org> + +--- a/absl/base/internal/direct_mmap.h ++++ b/absl/base/internal/direct_mmap.h +@@ -74,6 +74,7 @@ + inline void* DirectMmap(void* start, size_t length, int prot, int flags, int fd, + off64_t offset) noexcept { + #if defined(__i386__) || defined(__ARM_ARCH_3__) || defined(__ARM_EABI__) || \ ++ (defined(__hppa__) && !defined(__LP64__)) || \ + (defined(__mips__) && _MIPS_SIM == _MIPS_SIM_ABI32) || \ + (defined(__PPC__) && !defined(__PPC64__)) || \ + (defined(__riscv) && __riscv_xlen == 32) || \ +--- a/absl/debugging/internal/examine_stack.cc ++++ b/absl/debugging/internal/examine_stack.cc +@@ -48,6 +48,8 @@ + return reinterpret_cast<void*>(context->uc_mcontext.pc); + #elif defined(__arm__) + return reinterpret_cast<void*>(context->uc_mcontext.arm_pc); ++#elif defined(__hppa__) ++ return reinterpret_cast<void*>(context->uc_mcontext.sc_iaoq[0]); + #elif defined(__i386__) + if (14 < ABSL_ARRAYSIZE(context->uc_mcontext.gregs)) + return reinterpret_cast<void*>(context->uc_mcontext.gregs[14]); diff --git a/debian/patches/latomic.diff b/debian/patches/latomic.diff new file mode 100644 index 00000000..d78c7469 --- /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 +@@ -64,4 +64,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/nan-narrowing.diff b/debian/patches/nan-narrowing.diff new file mode 100644 index 00000000..c7ec9325 --- /dev/null +++ b/debian/patches/nan-narrowing.diff @@ -0,0 +1,25 @@ +From: Benjamin Barenblat <bbaren@google.com> +Subject: Avoid libgcc -NaN narrowing bug +Forwarded: yes +Applied-Upstream: https://github.com/abseil/abseil-cpp/commit/1bae23e32ba1f1af7c7d1488a69a351ec96dc98d + +When testing -NaN parsing, avoid narrowing -NaN from double to float. This +avoids a bug in libgcc (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98251). + +The author works at Google. Upstream applied this patch as Piper revision +347654751 and exported it to GitHub; the Applied-Upstream URL above points to +the exported commit. + +--- a/absl/strings/charconv_test.cc ++++ b/absl/strings/charconv_test.cc +@@ -653,7 +653,9 @@ TEST(FromChars, NaNFloats) { + negative_from_chars_float); + EXPECT_TRUE(std::signbit(negative_from_chars_float)); + EXPECT_FALSE(Identical(negative_from_chars_float, from_chars_float)); +- from_chars_float = std::copysign(from_chars_float, -1.0); ++ // Use the (float, float) overload of std::copysign to prevent narrowing; ++ // see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98251. ++ from_chars_float = std::copysign(from_chars_float, -1.0f); + EXPECT_TRUE(Identical(negative_from_chars_float, from_chars_float)); + } + } diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 00000000..9c73d904 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1,6 @@ +configure.diff +fix-hppa.diff +std-hash.diff +latomic.diff +cpu-frequency.diff +nan-narrowing.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/rules b/debian/rules new file mode 100755 index 00000000..03e1a00d --- /dev/null +++ b/debian/rules @@ -0,0 +1,52 @@ +#!/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. + +export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow reproducible=+fixfilepath + +# Unit tests aren't working on all platforms yet. +ifeq ($(shell dpkg-architecture -qDEB_HOST_ARCH),amd64) +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 -DABSL_RUN_TESTS=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..4337b538 --- /dev/null +++ b/debian/watch @@ -0,0 +1,17 @@ +# 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\S+)\.tar\.gz/abseil-$1\.tar\.gz/ \ + https://github.com/abseil/abseil-cpp/releases .*/v?(\d\S+)\.tar\.gz |