3 Commits

Author SHA1 Message Date
Abseil Team
f8c283dabf Remove support for Native Client
Native Client has been fully removed from Chromium.

PiperOrigin-RevId: 803093147
Change-Id: I7fea87a8a66b35b2f0cc3d815c23f90e5e4d2043
2025-09-04 10:54:42 -07:00
aurel32
7335a36d0b PR #1644: unscaledcycleclock: remove RISC-V support
Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/1644

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
Merge 43356a2548 into 76f8011bea

Merging this change closes #1644

COPYBARA_INTEGRATE_REVIEW=https://github.com/abseil/abseil-cpp/pull/1644 from aurel32:rv64-no-unscaledcycleclock 43356a2548
PiperOrigin-RevId: 618286262
Change-Id: Ie4120a727e7d0bb185df6e06ea145c780ebe6652
2024-03-22 14:22:03 -07:00
Abseil Team
df19c20996 Split configuration related to cycle clock into separate headers
PiperOrigin-RevId: 477043101
Change-Id: I009ea39ad61e7e78cdac51afc57a8ad5b4d8aa2d
2022-09-26 18:44:06 -07:00