dev-ml/core_unix: fix build adding a dummy rdtsc

Closes: https://bugs.gentoo.org/959873
Signed-off-by: Alfredo Tupone <tupone@gentoo.org>
This commit is contained in:
Alfredo Tupone
2025-07-12 23:26:32 +02:00
parent 06f865e258
commit 1adb1df2b7
2 changed files with 17 additions and 0 deletions

View File

@@ -34,6 +34,7 @@ BDEPEND=">=dev-ml/dune-3.11"
PATCHES=(
"${FILESDIR}"/${PN}-0.17.0-musl.patch
"${FILESDIR}"/${P}-riscv.patch
)
src_prepare() {

View File

@@ -0,0 +1,16 @@
--- a/time_stamp_counter/src/time_stamp_counter_stubs.c 2025-07-12 22:31:10.112736714 +0200
+++ b/time_stamp_counter/src/time_stamp_counter_stubs.c 2025-07-12 22:34:08.599793338 +0200
@@ -44,6 +44,13 @@
asm volatile("mrs %0, cntvct_el0" : "=r" (tsc));
return tsc;
}
+#elif defined(__riscv)
+static uint64_t rdtsc()
+{
+ uint64_t tsc;
+ tsc = 0;
+ return tsc;
+}
#endif
CAMLprim CAMLweakdef uint64_t caml_rdtsc_unboxed(value unit) {