abseil.git
3 years agoMerge abseil (0~20210324.2-4) import into refs/heads/workingbranch
Benjamin Barenblat [Fri, 27 May 2022 20:58:38 +0000 (21:58 +0100)]
Merge abseil (0~20210324.2-4) import into refs/heads/workingbranch

3 years agoCheck printf format strings in str_format_convert_test
Benjamin Barenblat [Fri, 27 May 2022 20:58:38 +0000 (21:58 +0100)]
Check printf format strings in str_format_convert_test

Forwarded: yes
Applied-Upstream: https://github.com/abseil/abseil-cpp/commit/1963f10ae5cb32a7ea6d96b928f69d3c7fba0139
Bug-Debian: https://bugs.debian.org/1011294

Don’t use generator expression to build .pc Libs lines

When building pkg-config files, compute linker flags with a string
substitution rather than the JOIN generator expression. This ensures
that commas in linker flags don’t get treated as argument separators in
JOIN.

The author works at Google. Upstream applied this patch as Piper
revision 450675966 and exported it to GitHub; the Applied-Upstream URL
above points to the exported commit.

Gbp-Pq: Name pkg-config-libs-generation.diff

3 years agoCheck printf format strings in str_format_convert_test
Benjamin Barenblat [Fri, 27 May 2022 20:58:38 +0000 (21:58 +0100)]
Check printf format strings in str_format_convert_test

Forwarded: yes
Applied-Upstream: https://github.com/abseil/abseil-cpp/commit/9fed77a6fea29b8c8468bd41c6259c7f67163a65

Add ABSL_PRINTF_ATTRIBUTE to appropriate functions in
strings/internal/str_format/convert_test. Correct
TypedFormatConvertTest.Char, which was accidentally passing values of
types larger than int to StrPrint.

The author works at Google. Upstream applied this patch as Piper
revision 439388148 and exported it to GitHub; the Applied-Upstream URL
above points to the exported commit.

Gbp-Pq: Name str-format-convert-test-printf.diff

3 years agoSupport symbolization on PA-RISC
Benjamin Barenblat [Fri, 27 May 2022 20:58:38 +0000 (21:58 +0100)]
Support symbolization on PA-RISC

Forwarded: yes
Applied-Upstream: https://github.com/abseil/abseil-cpp/commit/7f850b3167fb38e6b4a9ce1824e6fabd733b5d62

Null out supervisor bits in PA-RISC addresses before symbolizing, and
handle function descriptor tables correctly.

Change symbolize_test.cc to use 32-bit aligned addresses, allowing that
test to pass on PA-RISC.

The author works at Google. Upstream applied this patch as Piper
revision 428590564 and exported it to GitHub; the Applied-Upstream URL
above points to the exported commit.

Gbp-Pq: Name hppa-symbolize.diff

3 years agoRemove the test for absl::base_internal::NominalCPUFrequency() from OSS code
Derek Mauro [Fri, 27 May 2022 20:58:38 +0000 (21:58 +0100)]
Remove the test for absl::base_internal::NominalCPUFrequency() from OSS code

Origin: upstream, https://github.com/abseil/abseil-cpp/commit/732b5580f089101ce4b8cdff55bb6461c59a6720

Remove the test for absl::base_internal::NominalCPUFrequency() from OSS code

This is an internal-only function that should never by called by OSS code.
By its nature fails on unsupported platforms.
Google code has tests for this function on supported internal platforms.

Fixes #1053

PiperOrigin-RevId: 408692861

Gbp-Pq: Name disable-nominalcpufrequency-test.diff

3 years agoFix Randen and PCG on Big Endian platforms (#1031)
Milad Fa [Fri, 27 May 2022 20:58:38 +0000 (21:58 +0100)]
Fix Randen and PCG on Big Endian platforms (#1031)

Forwarded: https://github.com/abseil/abseil-cpp/pull/1031
Origin: upstream, https://github.com/abseil/abseil-cpp/commit/022527c50e0e2bc937f9fa3c516e3e36cbba0845

Gbp-Pq: Name big-endian-random4.diff

3 years agoAlso use uint8_t golden values in randen_test.cc
Laramie Leavitt [Fri, 27 May 2022 20:58:38 +0000 (21:58 +0100)]
Also use uint8_t golden values in randen_test.cc

Forwarded: yes
Origin: upstream, https://github.com/abseil/abseil-cpp/commit/cc413f8b674d61e3aa948386432e526e051afca0

Also use uint8_t golden values in randen_test.cc

This makes randen_test, randen_slow_test, and randen_hwaes_test essentially
identical, as is the intent.

The author works at Google. Upstream applied this patch as Piper
revision 405484423 and exported it to GitHub; the Applied-Upstream URL
above points to the exported commit.

Gbp-Pq: Name big-endian-random3.diff

3 years agoMake randen_slow endian-correct
Benjamin Barenblat [Fri, 27 May 2022 20:58:38 +0000 (21:58 +0100)]
Make randen_slow endian-correct

Forwarded: yes
Applied-Upstream: https://github.com/abseil/abseil-cpp/commit/33541e751039a8c4bd3a395dd1a3a0928885814a

Pay attention to the platform endianness when pulling bytes out of each
AES block, and use platform-endian round keys.

The author works at Google. Upstream applied this patch as Piper
revision 383878281 and exported it to GitHub; the Applied-Upstream URL
above points to the exported commit.

Gbp-Pq: Name big-endian-random2.diff

3 years agoUse absl::uint128 for AES random number generator
Benjamin Barenblat [Fri, 27 May 2022 20:58:38 +0000 (21:58 +0100)]
Use absl::uint128 for AES random number generator

Forwarded: yes
Applied-Upstream: https://github.com/abseil/abseil-cpp/commit/b06e719ee985ecd63e0dffbc68499549216f817f

Replace randen’s internal 128-bit integer struct, u64x2, with
absl::uint128. This eliminates some code and improves support for
big-endian platforms.

The author works at Google. Upstream applied this patch as Piper
revision 383475671 and exported it to GitHub; the Applied-Upstream URL
above points to the exported commit.

Gbp-Pq: Name big-endian-random.diff

3 years agoFix hashing on big endian platforms (#1028)
Milad Fa [Fri, 27 May 2022 20:58:38 +0000 (21:58 +0100)]
Fix hashing on big endian platforms (#1028)

Forwarded: https://github.com/abseil/abseil-cpp/pull/1028
Origin: backport, https://github.com/abseil/abseil-cpp/commit/ae0f4c266095c9003786cd571bc1fb72544104a1
Bug-Debian: https://bugs.debian.org/977638

Avoid using libstdc++'s implementation of std::hash<std::bitset> and
std::hash<std::vector> on big endian platforms in the implementation
of absl::Hash.

This is a workaround for a buggy implementation that results in many
collisions.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102531
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98731

Gbp-Pq: Name big-endian-hash2.diff

3 years agoRestructure wyhash_test.cc to separate golden values
Benjamin Barenblat [Fri, 27 May 2022 20:58:38 +0000 (21:58 +0100)]
Restructure wyhash_test.cc to separate golden values

Forwarded: yes
Origin: backport, https://github.com/abseil/abseil-cpp/commit/a05366d851c5cb88065272f951e03955197e7c11

This patch is a subset of the referenced commit, which originally also changed
the mix function on arm64. The original message is as follows:

    Alternative bit mixer for LowLevelHash on ARM

    LowLevelHash's bit-mixer is inefficient on ARM because it calculates
    a 128-bit product of two 64-bit numbers. On ARM, this requires a
    sequence of two instructions with a high combined latency and poor
    throughput. This change provides alternative bit-mixing code for ARM
    that uses only 64-bit arithmetic (multiplication, xor, and
    left-shifts) and speeds things up considerably.

    The bit-mixing code for ARM was inspired by by Woothash[1] and
    xxh3[1]. Once I landed on a sequence of operations that provided
    good mixing, I used a test harness to search for the combination of
    shift / rotate factors that provided the best mixing, as indicated
    by SMHasher hash quality tests. The new mixing code passes 13 out of
    15 of the hash quality test suites in SMHasher, with the two
    failures being in the noise range: e.g. 1 collision vs. zero
    expected in a keyset of ~8m keys.

          [1]: https://github.com/tommyettinger/waterhash/blob/49f5cf0b63b9/woothash.h#L16-L20
          [2]: https://github.com/Cyan4973/xxHash/blob/6853ddc36e46/xxhash.h#L3240-L3265

    PiperOrigin-RevId: 391833008

This restructuring is a prerequisite for big-endian-hash2.diff.

Gbp-Pq: Name big-endian-hash.diff

3 years agoRound a double multiplication before casting it to integer
Benjamin Barenblat [Fri, 27 May 2022 20:58:38 +0000 (21:58 +0100)]
Round a double multiplication before casting it to integer

Forwarded: yes
Applied-Upstream: https://github.com/abseil/abseil-cpp/commit/60be12ed9822078970f05f3c560324184302df6b

The code

    static_cast<int>(x * y)

(for double x and y) performs a double multiplication into a temporary
that, by standard, may have excess precision. The subsequent cast to int
discards the excess precision. However, the cast may examine the excess
precision during conversion, producing surprising results like

    static_cast<int>(1.7 * 10) == 16

on certain systems. Correct this case by explicitly rounding 1.7 * 10
before casting it.

The author works at Google. Upstream applied this patch as Piper
revision 378922064 and exported it to GitHub; the Applied-Upstream URL
above points to the exported commit.

Gbp-Pq: Name missing-rint.diff

3 years agoSkip floating-point edge-case tests when using an x87
Benjamin Barenblat [Fri, 27 May 2022 20:58:38 +0000 (21:58 +0100)]
Skip floating-point edge-case tests when using an x87

Forwarded: yes
Applied-Upstream: https://github.com/abseil/abseil-cpp/commit/311bbd2e50ea35e921a08186840d3b6ca279e880

32-bit Intel CPUs use 80-bit floats for intermediate values, which can
change the results of floating point computations from what we normally
expect. Identify tests that are sensitive to the x87, and skip them when
we’re on 32-bit Intel.

The author works at Google. Upstream applied this patch as Piper
revision 378722613 and exported it to GitHub; the Applied-Upstream URL
above points to the exported commit.

Gbp-Pq: Name float-tests-disable-i386.diff

3 years agoDon’t examine irrelevant destination buckets in DiscreteDistributionTest
Benjamin Barenblat [Fri, 27 May 2022 20:58:38 +0000 (21:58 +0100)]
Don’t examine irrelevant destination buckets in DiscreteDistributionTest

Forwarded: yes
Applied-Upstream: https://github.com/abseil/abseil-cpp/commit/7ba826e50dff1878e6ecc6b9af44097c040c8968

Abseil generates discrete distributions using Walker’s aliasing
algorithm. This creates uniformly distributed buckets, each with a
probability of sending traffic to a different bucket. Abseil represents
a bucket as a pair

    (probability of retaining traffic ×
     alternate bucket if traffic is passed)

and a distribution as a vector of such pairs. For example, {(0.3, 1),
(1.0, 1)} represents a distribution with two buckets, the zeroth of
which passes 70% of its traffic to bucket 1 and the first of which holds
on to all its traffic.

This representation is not unique: When a bucket retains traffic with
probability 1, the alternate bucket is irrelevant. Continuing the
example above, {(0.3, 1), (1.0, 0)} _also_ represents a two-bucket
distribution where the zeroth bucket passes 70% of its traffic to the
first and the first hangs on to all traffic. Exactly what representation
Abseil generates for a given input is related to how much precision is
used in intermediate floating-point operations, which is an
architectural implementation detail. Remove sensitivity to that detail
by not examining the alternate bucket when the retention probability is
1.0.

The author works at Google. Upstream applied this patch as Piper
revision 372993410 and exported it to GitHub; the Applied-Upstream URL
above points to the exported commit.

Gbp-Pq: Name DiscreteDistributionTest-irrelevant-destination-buckets.diff

3 years agoRound floats using round(x), not static_cast<int>(x + 0.5)
Benjamin Barenblat [Fri, 27 May 2022 20:58:38 +0000 (21:58 +0100)]
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.

Gbp-Pq: Name float-rounding.diff

3 years agoCorrect Thumb function bound computation in the symbolizer
Benjamin Barenblat [Fri, 27 May 2022 20:58:38 +0000 (21:58 +0100)]
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.

Gbp-Pq: Name thumb-function-bounds.diff

3 years agoFix typo in CordRepRing error message
Benjamin Barenblat [Fri, 27 May 2022 20:58:38 +0000 (21:58 +0100)]
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.

Gbp-Pq: Name cordrepring-typo.diff

3 years agoEliminate libabsl_flags.so and libabsl_flags.a
Benjamin Barenblat [Fri, 27 May 2022 20:58:38 +0000 (21:58 +0100)]
Eliminate libabsl_flags.so and libabsl_flags.a

Forwarded: not-needed

The libabsl_flags library only contains code when compiling with MSVC, which
Debian doesn't use. Skip compiling absl/flags/flag.cc, and make the Abseil flags
library header-only.

Gbp-Pq: Name empty-flags-library.diff

3 years agoUse libatomic if necessary
Benjamin Barenblat [Fri, 27 May 2022 20:58:38 +0000 (21:58 +0100)]
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.

Gbp-Pq: Name latomic.diff

3 years agoSet package configuration options
Benjamin Barenblat [Fri, 27 May 2022 20:58:38 +0000 (21:58 +0100)]
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.

Gbp-Pq: Name configure.diff

3 years agoabseil (0~20210324.2-4) unstable; urgency=medium
Benjamin Barenblat [Fri, 27 May 2022 20:58:38 +0000 (21:58 +0100)]
abseil (0~20210324.2-4) unstable; urgency=medium

  * Fix "spurious -Wl flag in some pkg-config entries" by backporting a
    patch from upstream that corrects CMake pkg-config generation.
    (Closes: #1011294)

[dgit import unpatched abseil 0~20210324.2-4]

3 years agoImport abseil_0~20210324.2-4.debian.tar.xz
Benjamin Barenblat [Fri, 27 May 2022 20:58:38 +0000 (21:58 +0100)]
Import abseil_0~20210324.2-4.debian.tar.xz

[dgit import tarball abseil 0~20210324.2-4 abseil_0~20210324.2-4.debian.tar.xz]

3 years agoMerge abseil (0~20210324.2-3) import into refs/heads/workingbranch
Benjamin Barenblat [Thu, 14 Apr 2022 17:20:16 +0000 (18:20 +0100)]
Merge abseil (0~20210324.2-3) import into refs/heads/workingbranch

3 years agoCheck printf format strings in str_format_convert_test
Benjamin Barenblat [Thu, 14 Apr 2022 17:20:16 +0000 (18:20 +0100)]
Check printf format strings in str_format_convert_test

Forwarded: yes
Applied-Upstream: https://github.com/abseil/abseil-cpp/commit/9fed77a6fea29b8c8468bd41c6259c7f67163a65

Add ABSL_PRINTF_ATTRIBUTE to appropriate functions in
strings/internal/str_format/convert_test. Correct
TypedFormatConvertTest.Char, which was accidentally passing values of
types larger than int to StrPrint.

The author works at Google. Upstream applied this patch as Piper
revision 439388148 and exported it to GitHub; the Applied-Upstream URL
above points to the exported commit.

Gbp-Pq: Name str-format-convert-test-printf.diff

3 years agoSupport symbolization on PA-RISC
Benjamin Barenblat [Thu, 14 Apr 2022 17:20:16 +0000 (18:20 +0100)]
Support symbolization on PA-RISC

Forwarded: yes
Applied-Upstream: https://github.com/abseil/abseil-cpp/commit/7f850b3167fb38e6b4a9ce1824e6fabd733b5d62

Null out supervisor bits in PA-RISC addresses before symbolizing, and
handle function descriptor tables correctly.

Change symbolize_test.cc to use 32-bit aligned addresses, allowing that
test to pass on PA-RISC.

The author works at Google. Upstream applied this patch as Piper
revision 428590564 and exported it to GitHub; the Applied-Upstream URL
above points to the exported commit.

Gbp-Pq: Name hppa-symbolize.diff

3 years agoRemove the test for absl::base_internal::NominalCPUFrequency() from OSS code
Derek Mauro [Thu, 14 Apr 2022 17:20:16 +0000 (18:20 +0100)]
Remove the test for absl::base_internal::NominalCPUFrequency() from OSS code

Origin: upstream, https://github.com/abseil/abseil-cpp/commit/732b5580f089101ce4b8cdff55bb6461c59a6720

Remove the test for absl::base_internal::NominalCPUFrequency() from OSS code

This is an internal-only function that should never by called by OSS code.
By its nature fails on unsupported platforms.
Google code has tests for this function on supported internal platforms.

Fixes #1053

PiperOrigin-RevId: 408692861

Gbp-Pq: Name disable-nominalcpufrequency-test.diff

3 years agoFix Randen and PCG on Big Endian platforms (#1031)
Milad Fa [Thu, 14 Apr 2022 17:20:16 +0000 (18:20 +0100)]
Fix Randen and PCG on Big Endian platforms (#1031)

Forwarded: https://github.com/abseil/abseil-cpp/pull/1031
Origin: upstream, https://github.com/abseil/abseil-cpp/commit/022527c50e0e2bc937f9fa3c516e3e36cbba0845

Gbp-Pq: Name big-endian-random4.diff

3 years agoAlso use uint8_t golden values in randen_test.cc
Laramie Leavitt [Thu, 14 Apr 2022 17:20:16 +0000 (18:20 +0100)]
Also use uint8_t golden values in randen_test.cc

Forwarded: yes
Origin: upstream, https://github.com/abseil/abseil-cpp/commit/cc413f8b674d61e3aa948386432e526e051afca0

Also use uint8_t golden values in randen_test.cc

This makes randen_test, randen_slow_test, and randen_hwaes_test essentially
identical, as is the intent.

The author works at Google. Upstream applied this patch as Piper
revision 405484423 and exported it to GitHub; the Applied-Upstream URL
above points to the exported commit.

Gbp-Pq: Name big-endian-random3.diff

3 years agoMake randen_slow endian-correct
Benjamin Barenblat [Thu, 14 Apr 2022 17:20:16 +0000 (18:20 +0100)]
Make randen_slow endian-correct

Forwarded: yes
Applied-Upstream: https://github.com/abseil/abseil-cpp/commit/33541e751039a8c4bd3a395dd1a3a0928885814a

Pay attention to the platform endianness when pulling bytes out of each
AES block, and use platform-endian round keys.

The author works at Google. Upstream applied this patch as Piper
revision 383878281 and exported it to GitHub; the Applied-Upstream URL
above points to the exported commit.

Gbp-Pq: Name big-endian-random2.diff

3 years agoUse absl::uint128 for AES random number generator
Benjamin Barenblat [Thu, 14 Apr 2022 17:20:16 +0000 (18:20 +0100)]
Use absl::uint128 for AES random number generator

Forwarded: yes
Applied-Upstream: https://github.com/abseil/abseil-cpp/commit/b06e719ee985ecd63e0dffbc68499549216f817f

Replace randen’s internal 128-bit integer struct, u64x2, with
absl::uint128. This eliminates some code and improves support for
big-endian platforms.

The author works at Google. Upstream applied this patch as Piper
revision 383475671 and exported it to GitHub; the Applied-Upstream URL
above points to the exported commit.

Gbp-Pq: Name big-endian-random.diff

3 years agoFix hashing on big endian platforms (#1028)
Milad Fa [Thu, 14 Apr 2022 17:20:16 +0000 (18:20 +0100)]
Fix hashing on big endian platforms (#1028)

Forwarded: https://github.com/abseil/abseil-cpp/pull/1028
Origin: backport, https://github.com/abseil/abseil-cpp/commit/ae0f4c266095c9003786cd571bc1fb72544104a1
Bug-Debian: https://bugs.debian.org/977638

Avoid using libstdc++'s implementation of std::hash<std::bitset> and
std::hash<std::vector> on big endian platforms in the implementation
of absl::Hash.

This is a workaround for a buggy implementation that results in many
collisions.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102531
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98731

Gbp-Pq: Name big-endian-hash2.diff

3 years agoRestructure wyhash_test.cc to separate golden values
Benjamin Barenblat [Thu, 14 Apr 2022 17:20:16 +0000 (18:20 +0100)]
Restructure wyhash_test.cc to separate golden values

Forwarded: yes
Origin: backport, https://github.com/abseil/abseil-cpp/commit/a05366d851c5cb88065272f951e03955197e7c11

This patch is a subset of the referenced commit, which originally also changed
the mix function on arm64. The original message is as follows:

    Alternative bit mixer for LowLevelHash on ARM

    LowLevelHash's bit-mixer is inefficient on ARM because it calculates
    a 128-bit product of two 64-bit numbers. On ARM, this requires a
    sequence of two instructions with a high combined latency and poor
    throughput. This change provides alternative bit-mixing code for ARM
    that uses only 64-bit arithmetic (multiplication, xor, and
    left-shifts) and speeds things up considerably.

    The bit-mixing code for ARM was inspired by by Woothash[1] and
    xxh3[1]. Once I landed on a sequence of operations that provided
    good mixing, I used a test harness to search for the combination of
    shift / rotate factors that provided the best mixing, as indicated
    by SMHasher hash quality tests. The new mixing code passes 13 out of
    15 of the hash quality test suites in SMHasher, with the two
    failures being in the noise range: e.g. 1 collision vs. zero
    expected in a keyset of ~8m keys.

          [1]: https://github.com/tommyettinger/waterhash/blob/49f5cf0b63b9/woothash.h#L16-L20
          [2]: https://github.com/Cyan4973/xxHash/blob/6853ddc36e46/xxhash.h#L3240-L3265

    PiperOrigin-RevId: 391833008

This restructuring is a prerequisite for big-endian-hash2.diff.

Gbp-Pq: Name big-endian-hash.diff

3 years agoRound a double multiplication before casting it to integer
Benjamin Barenblat [Thu, 14 Apr 2022 17:20:16 +0000 (18:20 +0100)]
Round a double multiplication before casting it to integer

Forwarded: yes
Applied-Upstream: https://github.com/abseil/abseil-cpp/commit/60be12ed9822078970f05f3c560324184302df6b

The code

    static_cast<int>(x * y)

(for double x and y) performs a double multiplication into a temporary
that, by standard, may have excess precision. The subsequent cast to int
discards the excess precision. However, the cast may examine the excess
precision during conversion, producing surprising results like

    static_cast<int>(1.7 * 10) == 16

on certain systems. Correct this case by explicitly rounding 1.7 * 10
before casting it.

The author works at Google. Upstream applied this patch as Piper
revision 378922064 and exported it to GitHub; the Applied-Upstream URL
above points to the exported commit.

Gbp-Pq: Name missing-rint.diff

3 years agoSkip floating-point edge-case tests when using an x87
Benjamin Barenblat [Thu, 14 Apr 2022 17:20:16 +0000 (18:20 +0100)]
Skip floating-point edge-case tests when using an x87

Forwarded: yes
Applied-Upstream: https://github.com/abseil/abseil-cpp/commit/311bbd2e50ea35e921a08186840d3b6ca279e880

32-bit Intel CPUs use 80-bit floats for intermediate values, which can
change the results of floating point computations from what we normally
expect. Identify tests that are sensitive to the x87, and skip them when
we’re on 32-bit Intel.

The author works at Google. Upstream applied this patch as Piper
revision 378722613 and exported it to GitHub; the Applied-Upstream URL
above points to the exported commit.

Gbp-Pq: Name float-tests-disable-i386.diff

3 years agoDon’t examine irrelevant destination buckets in DiscreteDistributionTest
Benjamin Barenblat [Thu, 14 Apr 2022 17:20:16 +0000 (18:20 +0100)]
Don’t examine irrelevant destination buckets in DiscreteDistributionTest

Forwarded: yes
Applied-Upstream: https://github.com/abseil/abseil-cpp/commit/7ba826e50dff1878e6ecc6b9af44097c040c8968

Abseil generates discrete distributions using Walker’s aliasing
algorithm. This creates uniformly distributed buckets, each with a
probability of sending traffic to a different bucket. Abseil represents
a bucket as a pair

    (probability of retaining traffic ×
     alternate bucket if traffic is passed)

and a distribution as a vector of such pairs. For example, {(0.3, 1),
(1.0, 1)} represents a distribution with two buckets, the zeroth of
which passes 70% of its traffic to bucket 1 and the first of which holds
on to all its traffic.

This representation is not unique: When a bucket retains traffic with
probability 1, the alternate bucket is irrelevant. Continuing the
example above, {(0.3, 1), (1.0, 0)} _also_ represents a two-bucket
distribution where the zeroth bucket passes 70% of its traffic to the
first and the first hangs on to all traffic. Exactly what representation
Abseil generates for a given input is related to how much precision is
used in intermediate floating-point operations, which is an
architectural implementation detail. Remove sensitivity to that detail
by not examining the alternate bucket when the retention probability is
1.0.

The author works at Google. Upstream applied this patch as Piper
revision 372993410 and exported it to GitHub; the Applied-Upstream URL
above points to the exported commit.

Gbp-Pq: Name DiscreteDistributionTest-irrelevant-destination-buckets.diff

3 years agoRound floats using round(x), not static_cast<int>(x + 0.5)
Benjamin Barenblat [Thu, 14 Apr 2022 17:20:16 +0000 (18:20 +0100)]
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.

Gbp-Pq: Name float-rounding.diff

3 years agoCorrect Thumb function bound computation in the symbolizer
Benjamin Barenblat [Thu, 14 Apr 2022 17:20:16 +0000 (18:20 +0100)]
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.

Gbp-Pq: Name thumb-function-bounds.diff

3 years agoFix typo in CordRepRing error message
Benjamin Barenblat [Thu, 14 Apr 2022 17:20:16 +0000 (18:20 +0100)]
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.

Gbp-Pq: Name cordrepring-typo.diff

3 years agoEliminate libabsl_flags.so and libabsl_flags.a
Benjamin Barenblat [Thu, 14 Apr 2022 17:20:16 +0000 (18:20 +0100)]
Eliminate libabsl_flags.so and libabsl_flags.a

Forwarded: not-needed

The libabsl_flags library only contains code when compiling with MSVC, which
Debian doesn't use. Skip compiling absl/flags/flag.cc, and make the Abseil flags
library header-only.

Gbp-Pq: Name empty-flags-library.diff

3 years agoUse libatomic if necessary
Benjamin Barenblat [Thu, 14 Apr 2022 17:20:16 +0000 (18:20 +0100)]
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.

Gbp-Pq: Name latomic.diff

3 years agoSet package configuration options
Benjamin Barenblat [Thu, 14 Apr 2022 17:20:16 +0000 (18:20 +0100)]
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.

Gbp-Pq: Name configure.diff

3 years agoabseil (0~20210324.2-3) unstable; urgency=medium
Benjamin Barenblat [Thu, 14 Apr 2022 17:20:16 +0000 (18:20 +0100)]
abseil (0~20210324.2-3) unstable; urgency=medium

  * Backport an upstream patch to disable a problematic unit test.
    (Closes: #1007136)
  * Reenable unit tests on hppa.

[dgit import unpatched abseil 0~20210324.2-3]

3 years agoImport abseil_0~20210324.2-3.debian.tar.xz
Benjamin Barenblat [Thu, 14 Apr 2022 17:20:16 +0000 (18:20 +0100)]
Import abseil_0~20210324.2-3.debian.tar.xz

[dgit import tarball abseil 0~20210324.2-3 abseil_0~20210324.2-3.debian.tar.xz]

3 years agoMerge abseil (0~20210324.2-2) import into refs/heads/workingbranch
Benjamin Barenblat [Mon, 7 Feb 2022 16:54:21 +0000 (16:54 +0000)]
Merge abseil (0~20210324.2-2) import into refs/heads/workingbranch

3 years agoFix Randen and PCG on Big Endian platforms (#1031)
Milad Fa [Mon, 7 Feb 2022 16:54:21 +0000 (16:54 +0000)]
Fix Randen and PCG on Big Endian platforms (#1031)

Forwarded: https://github.com/abseil/abseil-cpp/pull/1031
Origin: upstream, https://github.com/abseil/abseil-cpp/commit/022527c50e0e2bc937f9fa3c516e3e36cbba0845

Gbp-Pq: Name big-endian-random4.diff

3 years agoAlso use uint8_t golden values in randen_test.cc
Laramie Leavitt [Mon, 7 Feb 2022 16:54:21 +0000 (16:54 +0000)]
Also use uint8_t golden values in randen_test.cc

Forwarded: yes
Origin: upstream, https://github.com/abseil/abseil-cpp/commit/cc413f8b674d61e3aa948386432e526e051afca0

Also use uint8_t golden values in randen_test.cc

This makes randen_test, randen_slow_test, and randen_hwaes_test essentially
identical, as is the intent.

The author works at Google. Upstream applied this patch as Piper
revision 405484423 and exported it to GitHub; the Applied-Upstream URL
above points to the exported commit.

Gbp-Pq: Name big-endian-random3.diff

3 years agoMake randen_slow endian-correct
Benjamin Barenblat [Mon, 7 Feb 2022 16:54:21 +0000 (16:54 +0000)]
Make randen_slow endian-correct

Forwarded: yes
Applied-Upstream: https://github.com/abseil/abseil-cpp/commit/33541e751039a8c4bd3a395dd1a3a0928885814a

Pay attention to the platform endianness when pulling bytes out of each
AES block, and use platform-endian round keys.

The author works at Google. Upstream applied this patch as Piper
revision 383878281 and exported it to GitHub; the Applied-Upstream URL
above points to the exported commit.

Gbp-Pq: Name big-endian-random2.diff

3 years agoUse absl::uint128 for AES random number generator
Benjamin Barenblat [Mon, 7 Feb 2022 16:54:21 +0000 (16:54 +0000)]
Use absl::uint128 for AES random number generator

Forwarded: yes
Applied-Upstream: https://github.com/abseil/abseil-cpp/commit/b06e719ee985ecd63e0dffbc68499549216f817f

Replace randen’s internal 128-bit integer struct, u64x2, with
absl::uint128. This eliminates some code and improves support for
big-endian platforms.

The author works at Google. Upstream applied this patch as Piper
revision 383475671 and exported it to GitHub; the Applied-Upstream URL
above points to the exported commit.

Gbp-Pq: Name big-endian-random.diff

3 years agoFix hashing on big endian platforms (#1028)
Milad Fa [Mon, 7 Feb 2022 16:54:21 +0000 (16:54 +0000)]
Fix hashing on big endian platforms (#1028)

Forwarded: https://github.com/abseil/abseil-cpp/pull/1028
Origin: backport, https://github.com/abseil/abseil-cpp/commit/ae0f4c266095c9003786cd571bc1fb72544104a1
Bug-Debian: https://bugs.debian.org/977638

Avoid using libstdc++'s implementation of std::hash<std::bitset> and
std::hash<std::vector> on big endian platforms in the implementation
of absl::Hash.

This is a workaround for a buggy implementation that results in many
collisions.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102531
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98731

Gbp-Pq: Name big-endian-hash2.diff

3 years agoRestructure wyhash_test.cc to separate golden values
Benjamin Barenblat [Mon, 7 Feb 2022 16:54:21 +0000 (16:54 +0000)]
Restructure wyhash_test.cc to separate golden values

Forwarded: yes
Origin: backport, https://github.com/abseil/abseil-cpp/commit/a05366d851c5cb88065272f951e03955197e7c11

This patch is a subset of the referenced commit, which originally also changed
the mix function on arm64. The original message is as follows:

    Alternative bit mixer for LowLevelHash on ARM

    LowLevelHash's bit-mixer is inefficient on ARM because it calculates
    a 128-bit product of two 64-bit numbers. On ARM, this requires a
    sequence of two instructions with a high combined latency and poor
    throughput. This change provides alternative bit-mixing code for ARM
    that uses only 64-bit arithmetic (multiplication, xor, and
    left-shifts) and speeds things up considerably.

    The bit-mixing code for ARM was inspired by by Woothash[1] and
    xxh3[1]. Once I landed on a sequence of operations that provided
    good mixing, I used a test harness to search for the combination of
    shift / rotate factors that provided the best mixing, as indicated
    by SMHasher hash quality tests. The new mixing code passes 13 out of
    15 of the hash quality test suites in SMHasher, with the two
    failures being in the noise range: e.g. 1 collision vs. zero
    expected in a keyset of ~8m keys.

          [1]: https://github.com/tommyettinger/waterhash/blob/49f5cf0b63b9/woothash.h#L16-L20
          [2]: https://github.com/Cyan4973/xxHash/blob/6853ddc36e46/xxhash.h#L3240-L3265

    PiperOrigin-RevId: 391833008

This restructuring is a prerequisite for big-endian-hash2.diff.

Gbp-Pq: Name big-endian-hash.diff

3 years agoRound a double multiplication before casting it to integer
Benjamin Barenblat [Mon, 7 Feb 2022 16:54:21 +0000 (16:54 +0000)]
Round a double multiplication before casting it to integer

Forwarded: yes
Applied-Upstream: https://github.com/abseil/abseil-cpp/commit/60be12ed9822078970f05f3c560324184302df6b

The code

    static_cast<int>(x * y)

(for double x and y) performs a double multiplication into a temporary
that, by standard, may have excess precision. The subsequent cast to int
discards the excess precision. However, the cast may examine the excess
precision during conversion, producing surprising results like

    static_cast<int>(1.7 * 10) == 16

on certain systems. Correct this case by explicitly rounding 1.7 * 10
before casting it.

The author works at Google. Upstream applied this patch as Piper
revision 378922064 and exported it to GitHub; the Applied-Upstream URL
above points to the exported commit.

Gbp-Pq: Name missing-rint.diff

3 years agoSkip floating-point edge-case tests when using an x87
Benjamin Barenblat [Mon, 7 Feb 2022 16:54:21 +0000 (16:54 +0000)]
Skip floating-point edge-case tests when using an x87

Forwarded: yes
Applied-Upstream: https://github.com/abseil/abseil-cpp/commit/311bbd2e50ea35e921a08186840d3b6ca279e880

32-bit Intel CPUs use 80-bit floats for intermediate values, which can
change the results of floating point computations from what we normally
expect. Identify tests that are sensitive to the x87, and skip them when
we’re on 32-bit Intel.

The author works at Google. Upstream applied this patch as Piper
revision 378722613 and exported it to GitHub; the Applied-Upstream URL
above points to the exported commit.

Gbp-Pq: Name float-tests-disable-i386.diff

3 years agoDon’t examine irrelevant destination buckets in DiscreteDistributionTest
Benjamin Barenblat [Mon, 7 Feb 2022 16:54:21 +0000 (16:54 +0000)]
Don’t examine irrelevant destination buckets in DiscreteDistributionTest

Forwarded: yes
Applied-Upstream: https://github.com/abseil/abseil-cpp/commit/7ba826e50dff1878e6ecc6b9af44097c040c8968

Abseil generates discrete distributions using Walker’s aliasing
algorithm. This creates uniformly distributed buckets, each with a
probability of sending traffic to a different bucket. Abseil represents
a bucket as a pair

    (probability of retaining traffic ×
     alternate bucket if traffic is passed)

and a distribution as a vector of such pairs. For example, {(0.3, 1),
(1.0, 1)} represents a distribution with two buckets, the zeroth of
which passes 70% of its traffic to bucket 1 and the first of which holds
on to all its traffic.

This representation is not unique: When a bucket retains traffic with
probability 1, the alternate bucket is irrelevant. Continuing the
example above, {(0.3, 1), (1.0, 0)} _also_ represents a two-bucket
distribution where the zeroth bucket passes 70% of its traffic to the
first and the first hangs on to all traffic. Exactly what representation
Abseil generates for a given input is related to how much precision is
used in intermediate floating-point operations, which is an
architectural implementation detail. Remove sensitivity to that detail
by not examining the alternate bucket when the retention probability is
1.0.

The author works at Google. Upstream applied this patch as Piper
revision 372993410 and exported it to GitHub; the Applied-Upstream URL
above points to the exported commit.

Gbp-Pq: Name DiscreteDistributionTest-irrelevant-destination-buckets.diff

3 years agoRound floats using round(x), not static_cast<int>(x + 0.5)
Benjamin Barenblat [Mon, 7 Feb 2022 16:54:21 +0000 (16:54 +0000)]
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.

Gbp-Pq: Name float-rounding.diff

3 years agoCorrect Thumb function bound computation in the symbolizer
Benjamin Barenblat [Mon, 7 Feb 2022 16:54:21 +0000 (16:54 +0000)]
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.

Gbp-Pq: Name thumb-function-bounds.diff

3 years agoFix typo in CordRepRing error message
Benjamin Barenblat [Mon, 7 Feb 2022 16:54:21 +0000 (16:54 +0000)]
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.

Gbp-Pq: Name cordrepring-typo.diff

3 years agoEliminate libabsl_flags.so and libabsl_flags.a
Benjamin Barenblat [Mon, 7 Feb 2022 16:54:21 +0000 (16:54 +0000)]
Eliminate libabsl_flags.so and libabsl_flags.a

Forwarded: not-needed

The libabsl_flags library only contains code when compiling with MSVC, which
Debian doesn't use. Skip compiling absl/flags/flag.cc, and make the Abseil flags
library header-only.

Gbp-Pq: Name empty-flags-library.diff

3 years agoDisable SysinfoTest.NominalCPUFrequency on armel/armhf
Benjamin Barenblat [Mon, 7 Feb 2022 16:54:21 +0000 (16:54 +0000)]
Disable SysinfoTest.NominalCPUFrequency on armel/armhf

NominalCPUFrequency has different behavior on 32-bit and 64-bit ARM
kernels. The Debian arm64 buildds assume they can build 32-bit ARM
packages, but if they do, the NominalCPUFrequency test will fail.
Disable the test when building for 32-bit ARM.

Gbp-Pq: Name arm-multiarch.diff

3 years agoUse libatomic if necessary
Benjamin Barenblat [Mon, 7 Feb 2022 16:54:21 +0000 (16:54 +0000)]
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.

Gbp-Pq: Name latomic.diff

3 years agoSet package configuration options
Benjamin Barenblat [Mon, 7 Feb 2022 16:54:21 +0000 (16:54 +0000)]
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.

Gbp-Pq: Name configure.diff

3 years agoabseil (0~20210324.2-2) unstable; urgency=medium
Benjamin Barenblat [Mon, 7 Feb 2022 16:54:21 +0000 (16:54 +0000)]
abseil (0~20210324.2-2) unstable; urgency=medium

  * Disable a test that doesn’t play well with multiarch on armel and
    armhf.

[dgit import unpatched abseil 0~20210324.2-2]

3 years agoImport abseil_0~20210324.2-2.debian.tar.xz
Benjamin Barenblat [Mon, 7 Feb 2022 16:54:21 +0000 (16:54 +0000)]
Import abseil_0~20210324.2-2.debian.tar.xz

[dgit import tarball abseil 0~20210324.2-2 abseil_0~20210324.2-2.debian.tar.xz]

3 years agoImport abseil_0~20210324.2.orig.tar.gz
Benjamin Barenblat [Fri, 4 Feb 2022 18:11:32 +0000 (18:11 +0000)]
Import abseil_0~20210324.2.orig.tar.gz

[dgit import orig abseil_0~20210324.2.orig.tar.gz]

4 years agoFix float conversion for PPC.
Samuel Benzaquen [Tue, 9 Feb 2021 19:41:06 +0000 (19:41 +0000)]
Fix float conversion for PPC.

Origin: backport, https://github.com/abseil/abseil-cpp/commit/c36d825d9a5443f81d2656685ae021d6326da90c

In PPC `long double` is a double-double representation which behaves weirdly
wrt numeric_limits. Don't take `long double` into account when we are not
handling `long double` natively anyway.

Fix the convert test to always run the conversion even if we are not going to
compare against libc's printf result. This allows exercising the code itself to
make sure we don't trigger assertions or UB found by sanitizers.

The author works at Google. Upstream applied this patch as Piper revision
355857729 and exported it to GitHub; the Applied-Upstream URL above points to
the exported commit.

Gbp-Pq: Name ppc-float-conversion.diff

4 years agoRemove endian-sensitivity from Abseil's RNG
Benjamin Barenblat [Tue, 9 Feb 2021 19:41:06 +0000 (19:41 +0000)]
Remove endian-sensitivity from Abseil's RNG

Forwarded: yes
Applied-Upstream: https://github.com/abseil/abseil-cpp/commit/c36d825d9a5443f81d2656685ae021d6326da90c

Ensure that the Abseil random number generator produces identical output
on both big- and little-endian platforms by byte-swapping appropriately
on big-endian systems.

The author works at Google. Upstream applied this patch as Piper
revision 355635051 and exported it to GitHub; the Applied-Upstream URL
above points to the exported commit.

Gbp-Pq: Name endian-random.diff

4 years agoRemove endian-sensitivity from hash slow path
Benjamin Barenblat [Tue, 9 Feb 2021 19:41:06 +0000 (19:41 +0000)]
Remove endian-sensitivity from hash slow path

Forwarded: yes
Applied-Upstream: https://github.com/abseil/abseil-cpp/commit/9c6a50fdd80bb39fabd95faeda84f04062685ff3

Prior to this commit, the Abseil hash fast path was endian-agnostic, but
the slow path assumed a little-endian platform. Change the slow path to
be endian-correct, ensuring that values produced by the fast and slow
paths are equal even on big-endian systems.

The author works at Google. Upstream applied this patch as Piper revision
355424258 and exported it to GitHub; the Applied-Upstream URL above points to
the exported commit.

Gbp-Pq: Name endian-hash.diff

4 years agoAvoid libgcc -NaN narrowing bug
Benjamin Barenblat [Tue, 9 Feb 2021 19:41:06 +0000 (19:41 +0000)]
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.

Gbp-Pq: Name nan-narrowing.diff

4 years agoIgnore missing CPU frequency on more architectures
Benjamin Barenblat [Tue, 9 Feb 2021 19:41:06 +0000 (19:41 +0000)]
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.

Gbp-Pq: Name cpu-frequency.diff

4 years agoUse libatomic if necessary
Benjamin Barenblat [Tue, 9 Feb 2021 19:41:06 +0000 (19:41 +0000)]
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.

Gbp-Pq: Name latomic.diff

4 years agoWork around broken std::hash on s390x
Benjamin Barenblat [Tue, 9 Feb 2021 19:41:06 +0000 (19:41 +0000)]
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.

Gbp-Pq: Name std-hash.diff

4 years agoFix build on hppa
John David Anglin [Tue, 9 Feb 2021 19:41:06 +0000 (19:41 +0000)]
Fix build on hppa

Bug-Debian: https://bugs.debian.org/971768
Reviewed-by: Benjamin Barenblat <bbaren@debian.org>
Gbp-Pq: Name fix-hppa.diff

4 years agoSet package configuration options
Benjamin Barenblat [Tue, 9 Feb 2021 19:41:06 +0000 (19:41 +0000)]
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.

Gbp-Pq: Name configure.diff

4 years agoabseil (0~20200923.3-2) unstable; urgency=medium
Benjamin Barenblat [Tue, 9 Feb 2021 19:41:06 +0000 (19:41 +0000)]
abseil (0~20200923.3-2) unstable; urgency=medium

  * Correct string formatting on POWER.

[dgit import unpatched abseil 0~20200923.3-2]

4 years agoImport abseil_0~20200923.3-2.debian.tar.xz
Benjamin Barenblat [Tue, 9 Feb 2021 19:41:06 +0000 (19:41 +0000)]
Import abseil_0~20200923.3-2.debian.tar.xz

[dgit import tarball abseil 0~20200923.3-2 abseil_0~20200923.3-2.debian.tar.xz]

4 years agoImport abseil_0~20200923.3.orig.tar.gz
Benjamin Barenblat [Mon, 8 Feb 2021 20:04:52 +0000 (20:04 +0000)]
Import abseil_0~20200923.3.orig.tar.gz

[dgit import orig abseil_0~20200923.3.orig.tar.gz]