diff options
-rw-r--r-- | debian/changelog | 27 | ||||
-rw-r--r-- | debian/control | 4 | ||||
-rw-r--r-- | debian/copyright | 4 | ||||
-rw-r--r-- | debian/gbp.conf | 2 | ||||
-rw-r--r-- | debian/patches/configure.diff | 2 | ||||
-rw-r--r-- | debian/patches/riscv-nan-formatting.diff | 20 | ||||
-rw-r--r-- | debian/patches/riscv-rdcycle.diff | 71 | ||||
-rw-r--r-- | debian/patches/series | 2 | ||||
-rwxr-xr-x | debian/rules | 6 |
9 files changed, 129 insertions, 9 deletions
diff --git a/debian/changelog b/debian/changelog index 2d26b2f5..055d7182 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,30 @@ +abseil (20230802.1-4) unstable; urgency=medium + + * Add extra build dependencies to prevent premature migration (see + https://bugs.debian.org/1059535#39) and to ensure tests have access to + tzdata. + + -- Benjamin Barenblat <bbaren@debian.org> Mon, 01 Apr 2024 17:50:22 -0400 + +abseil (20230802.1-3) unstable; urgency=medium + + * Apply an upstream patch to prevent SIGILLs on RISC-V. (Closes: + #1059532) + + -- Benjamin Barenblat <bbaren@debian.org> Sun, 31 Mar 2024 21:05:37 -0400 + +abseil (20230802.1-2) experimental; urgency=medium + + * Disable a unit test to work around https://bugs.debian.org/1059340. + + -- Benjamin Barenblat <bbaren@debian.org> Fri, 22 Dec 2023 15:46:28 -0500 + +abseil (20230802.1-1) experimental; urgency=medium + + * New upstream release. + + -- Benjamin Barenblat <bbaren@debian.org> Tue, 19 Sep 2023 11:38:43 -0400 + abseil (20230802.0-1) experimental; urgency=medium * New upstream release. diff --git a/debian/control b/debian/control index 23ad8b9e..f0efdbcc 100644 --- a/debian/control +++ b/debian/control @@ -18,7 +18,9 @@ Maintainer: Benjamin Barenblat <bbaren@debian.org> Build-Depends: cmake (>= 3.13), debhelper-compat (= 12), + dpkg-dev (>= 1.22.5), googletest (>= 1.12), + tzdata, Rules-Requires-Root: no Standards-Version: 4.6.2 Section: libs @@ -40,7 +42,7 @@ Depends: libabsl20230802 (= ${binary:Version}), ${misc:Depends}, Recommends: - cmake (>= 3.13) | pkg-config, + cmake (>= 3.13) | pkgconf, g++ (>= 7.3.1), libgmock-dev (>= 1.12), Description: ${source:Synopsis} (development files) diff --git a/debian/copyright b/debian/copyright index 19a3388c..50743e9c 100644 --- a/debian/copyright +++ b/debian/copyright @@ -15,6 +15,10 @@ Files: debian/* Copyright: 2020-2022 Google LLC License: Apache-2.0 +Files: debian/patches/riscv-nan-formatting.diff +Copyright: 2024 aurel32 <aurelien@aurel32.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 diff --git a/debian/gbp.conf b/debian/gbp.conf index e024d6bb..fa55234f 100644 --- a/debian/gbp.conf +++ b/debian/gbp.conf @@ -13,4 +13,4 @@ # the License. [DEFAULT] -upstream-tag = 20230802.0 +upstream-tag = 20230802.1 diff --git a/debian/patches/configure.diff b/debian/patches/configure.diff index a5a5eef3..3cd575f0 100644 --- a/debian/patches/configure.diff +++ b/debian/patches/configure.diff @@ -21,7 +21,7 @@ Configure Abseil for Debian. OUTPUT_NAME "absl_${_NAME}" - SOVERSION "2308.0.0" + SOVERSION 20230802 -+ VERSION "20230802.0.0" ++ VERSION "20230802.0.1" ) endif() else() diff --git a/debian/patches/riscv-nan-formatting.diff b/debian/patches/riscv-nan-formatting.diff new file mode 100644 index 00000000..8ad9b629 --- /dev/null +++ b/debian/patches/riscv-nan-formatting.diff @@ -0,0 +1,20 @@ +From: Benjamin Barenblat <bbaren@google.com> +Subject: riscv64: Disable negative NaN float ostream format checking +Bug-Debian: https://bugs.debian.org/1059340 + +Streaming a negative NaN float with libstdc++ on riscv64 produces an +optimization-dependent result. Don't require that logging such a float with +Abseil produce the same result as libstdc++ streaming. + +--- a/absl/log/log_format_test.cc ++++ b/absl/log/log_format_test.cc +@@ -611,7 +611,9 @@ + EXPECT_CALL( + test_sink, + Send(AllOf( ++#ifndef __riscv // see https://bugs.debian.org/1059340 + TextMessage(MatchesOstream(comparison_stream)), ++#endif + TextMessage(AnyOf(Eq("-nan"), Eq("nan"), Eq("NaN"), Eq("-nan(ind)"))), + ENCODED_MESSAGE( + AnyOf(EqualsProto(R"pb(value { str: "-nan" })pb"), diff --git a/debian/patches/riscv-rdcycle.diff b/debian/patches/riscv-rdcycle.diff new file mode 100644 index 00000000..24682c93 --- /dev/null +++ b/debian/patches/riscv-rdcycle.diff @@ -0,0 +1,71 @@ +From: aurel32 <aurelien@aurel32.net> +Subject: unscaledcycleclock: remove RISC-V support +Bug-Debian: https://bugs.debian.org/1059532 +Origin: upstream, https://github.com/abseil/abseil-cpp/commit/7335a36d0b5c1c597566f9aa3f458a5b6817c3b4 + +Starting with Linux 6.6 [1], RDCYCLE is a privileged instruction on +RISC-V and can't be used directly from userland. There is a sysctl +option to change that as a transition period, but it will eventually +disappear. + +The RDTIME instruction is another less accurate alternative, however its +frequency varies from board to board, and there is currently now way to +get its frequency from userland [2]. + +Therefore this patch just removes the code for unscaledcycleclock on +RISC-V. Without processor specific implementation, abseil relies on +std::chrono::steady_clock::now().time_since_epoch() which is basically a +wrapper around clock_gettime (CLOCK_MONOTONIC), which in turns use +__vdso_clock_gettime(). On RISC-V this VDSO is just a wrapper around +RDTIME correctly scaled to use nanoseconds units. + +This fixes the testsuite on riscv64, tested on a VisionFive 2 board. + +[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=cc4c07c89aada16229084eeb93895c95b7eabaa3 +[2] https://github.com/abseil/abseil-cpp/pull/1631 + +--- a/absl/base/internal/unscaledcycleclock.cc ++++ b/absl/base/internal/unscaledcycleclock.cc +@@ -121,18 +121,6 @@ + return aarch64_timer_frequency; + } + +-#elif defined(__riscv) +- +-int64_t UnscaledCycleClock::Now() { +- int64_t virtual_timer_value; +- asm volatile("rdcycle %0" : "=r"(virtual_timer_value)); +- return virtual_timer_value; +-} +- +-double UnscaledCycleClock::Frequency() { +- return base_internal::NominalCPUFrequency(); +-} +- + #elif defined(_M_IX86) || defined(_M_X64) + + #pragma intrinsic(__rdtsc) +--- a/absl/base/internal/unscaledcycleclock_config.h ++++ b/absl/base/internal/unscaledcycleclock_config.h +@@ -21,8 +21,8 @@ + + // The following platforms have an implementation of a hardware counter. + #if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__) || \ +- defined(__powerpc__) || defined(__ppc__) || defined(__riscv) || \ +- defined(_M_IX86) || (defined(_M_X64) && !defined(_M_ARM64EC)) ++ defined(__powerpc__) || defined(__ppc__) || defined(_M_IX86) || \ ++ (defined(_M_X64) && !defined(_M_ARM64EC)) + #define ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION 1 + #else + #define ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION 0 +@@ -53,8 +53,8 @@ + #if ABSL_USE_UNSCALED_CYCLECLOCK + // This macro can be used to test if UnscaledCycleClock::Frequency() + // is NominalCPUFrequency() on a particular platform. +-#if (defined(__i386__) || defined(__x86_64__) || defined(__riscv) || \ +- defined(_M_IX86) || defined(_M_X64)) ++#if (defined(__i386__) || defined(__x86_64__) || defined(_M_IX86) || \ ++ defined(_M_X64)) + #define ABSL_INTERNAL_UNSCALED_CYCLECLOCK_FREQUENCY_IS_CPU_FREQUENCY + #endif + #endif diff --git a/debian/patches/series b/debian/patches/series index 29630f3c..ee48fdd3 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -4,3 +4,5 @@ latomic.diff empty-flags-library.diff cordz-info-statistics-test.diff pkg-config-directives.diff +riscv-nan-formatting.diff +riscv-rdcycle.diff diff --git a/debian/rules b/debian/rules index 7f76c033..16a2e263 100755 --- a/debian/rules +++ b/debian/rules @@ -28,12 +28,6 @@ else ABSL_RUN_TESTS=ON endif -# Debian's RISC-V builders don't have enough resources to run tests in parallel. -# See https://bugs.debian.org/1025221. -ifneq ($(filter $(DEB_HOST_ARCH),riscv64),) -ABSL_TEST_EXTRA_ARGS=--no-parallel -endif - %: dh $@ |