diff options
2 files changed, 34 insertions, 1 deletions
diff --git a/meta-oe/recipes-support/googlebenchmark/googlebenchmark/0002-cycleclock-Fix-type-conversion-to-match-function-ret.patch b/meta-oe/recipes-support/googlebenchmark/googlebenchmark/0002-cycleclock-Fix-type-conversion-to-match-function-ret.patch new file mode 100644 index 0000000000..cc22a7e8a9 --- /dev/null +++ b/meta-oe/recipes-support/googlebenchmark/googlebenchmark/0002-cycleclock-Fix-type-conversion-to-match-function-ret.patch | |||
@@ -0,0 +1,32 @@ | |||
1 | From 54bca09aca6ccec41f852cb1f834463bc51290d0 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Mon, 10 Jun 2024 21:45:22 -0700 | ||
4 | Subject: [PATCH] cycleclock: Fix type conversion to match function return type | ||
5 | on riscv64 | ||
6 | |||
7 | Fixes builds with clang | ||
8 | |||
9 | src/cycleclock.h:213:10: error: implicit conversion changes signedness: 'uint64_t' (aka 'unsigned long') to 'int64_t' (aka 'long') [-Werror,-Wsign-conversion] | ||
10 | 213 | return cycles; | ||
11 | | ~~~~~~ ^~~~~~ | ||
12 | 1 error generated. | ||
13 | |||
14 | Upstream-Status: Submitted [https://github.com/google/benchmark/pull/1802] | ||
15 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
16 | --- | ||
17 | src/cycleclock.h | 2 +- | ||
18 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
19 | |||
20 | diff --git a/src/cycleclock.h b/src/cycleclock.h | ||
21 | index c657414..bd62f5d 100644 | ||
22 | --- a/src/cycleclock.h | ||
23 | +++ b/src/cycleclock.h | ||
24 | @@ -210,7 +210,7 @@ inline BENCHMARK_ALWAYS_INLINE int64_t Now() { | ||
25 | #else | ||
26 | uint64_t cycles; | ||
27 | asm volatile("rdtime %0" : "=r"(cycles)); | ||
28 | - return cycles; | ||
29 | + return static_cast<int64_t>(cycles); | ||
30 | #endif | ||
31 | #elif defined(__e2k__) || defined(__elbrus__) | ||
32 | struct timeval tv; | ||
diff --git a/meta-oe/recipes-support/googlebenchmark/googlebenchmark_1.8.4.bb b/meta-oe/recipes-support/googlebenchmark/googlebenchmark_1.8.4.bb index 34732b42d9..706862f24a 100644 --- a/meta-oe/recipes-support/googlebenchmark/googlebenchmark_1.8.4.bb +++ b/meta-oe/recipes-support/googlebenchmark/googlebenchmark_1.8.4.bb | |||
@@ -5,7 +5,8 @@ LICENSE = "Apache-2.0" | |||
5 | LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" | 5 | LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" |
6 | 6 | ||
7 | SRC_URI = "git://github.com/google/benchmark.git;protocol=https;branch=main \ | 7 | SRC_URI = "git://github.com/google/benchmark.git;protocol=https;branch=main \ |
8 | file://0001-cycleclock-Fix-type-conversion-to-match-function-ret.patch" | 8 | file://0001-cycleclock-Fix-type-conversion-to-match-function-ret.patch \ |
9 | file://0002-cycleclock-Fix-type-conversion-to-match-function-ret.patch" | ||
9 | SRCREV = "a4cf155615c63e019ae549e31703bf367df5b471" | 10 | SRCREV = "a4cf155615c63e019ae549e31703bf367df5b471" |
10 | 11 | ||
11 | S = "${WORKDIR}/git" | 12 | S = "${WORKDIR}/git" |