abseil.git
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 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]