mirror of
git://git.openembedded.org/meta-openembedded
synced 2026-09-30 13:30:17 +00:00
googlebenchmark: Fix build on riscv64
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
parent
8b01302835
commit
185e779bad
@ -0,0 +1,32 @@
|
|||||||
|
From 54bca09aca6ccec41f852cb1f834463bc51290d0 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Khem Raj <raj.khem@gmail.com>
|
||||||
|
Date: Mon, 10 Jun 2024 21:45:22 -0700
|
||||||
|
Subject: [PATCH] cycleclock: Fix type conversion to match function return type
|
||||||
|
on riscv64
|
||||||
|
|
||||||
|
Fixes builds with clang
|
||||||
|
|
||||||
|
src/cycleclock.h:213:10: error: implicit conversion changes signedness: 'uint64_t' (aka 'unsigned long') to 'int64_t' (aka 'long') [-Werror,-Wsign-conversion]
|
||||||
|
213 | return cycles;
|
||||||
|
| ~~~~~~ ^~~~~~
|
||||||
|
1 error generated.
|
||||||
|
|
||||||
|
Upstream-Status: Submitted [https://github.com/google/benchmark/pull/1802]
|
||||||
|
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||||
|
---
|
||||||
|
src/cycleclock.h | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/src/cycleclock.h b/src/cycleclock.h
|
||||||
|
index c657414..bd62f5d 100644
|
||||||
|
--- a/src/cycleclock.h
|
||||||
|
+++ b/src/cycleclock.h
|
||||||
|
@@ -210,7 +210,7 @@ inline BENCHMARK_ALWAYS_INLINE int64_t Now() {
|
||||||
|
#else
|
||||||
|
uint64_t cycles;
|
||||||
|
asm volatile("rdtime %0" : "=r"(cycles));
|
||||||
|
- return cycles;
|
||||||
|
+ return static_cast<int64_t>(cycles);
|
||||||
|
#endif
|
||||||
|
#elif defined(__e2k__) || defined(__elbrus__)
|
||||||
|
struct timeval tv;
|
||||||
@ -5,7 +5,8 @@ LICENSE = "Apache-2.0"
|
|||||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
|
LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
|
||||||
|
|
||||||
SRC_URI = "git://github.com/google/benchmark.git;protocol=https;branch=main \
|
SRC_URI = "git://github.com/google/benchmark.git;protocol=https;branch=main \
|
||||||
file://0001-cycleclock-Fix-type-conversion-to-match-function-ret.patch"
|
file://0001-cycleclock-Fix-type-conversion-to-match-function-ret.patch \
|
||||||
|
file://0002-cycleclock-Fix-type-conversion-to-match-function-ret.patch"
|
||||||
SRCREV = "a4cf155615c63e019ae549e31703bf367df5b471"
|
SRCREV = "a4cf155615c63e019ae549e31703bf367df5b471"
|
||||||
|
|
||||||
S = "${WORKDIR}/git"
|
S = "${WORKDIR}/git"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user