From 185e779bad07596d0c7f404ad55794b0a062549f Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Mon, 10 Jun 2024 21:55:41 -0700 Subject: googlebenchmark: Fix build on riscv64 Signed-off-by: Khem Raj --- ...Fix-type-conversion-to-match-function-ret.patch | 32 ++++++++++++++++++++++ .../googlebenchmark/googlebenchmark_1.8.4.bb | 3 +- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 meta-oe/recipes-support/googlebenchmark/googlebenchmark/0002-cycleclock-Fix-type-conversion-to-match-function-ret.patch (limited to 'meta-oe/recipes-support') 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 @@ +From 54bca09aca6ccec41f852cb1f834463bc51290d0 Mon Sep 17 00:00:00 2001 +From: Khem Raj +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 +--- + 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(cycles); + #endif + #elif defined(__e2k__) || defined(__elbrus__) + 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" LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" 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" S = "${WORKDIR}/git" -- cgit v1.2.3-54-g00ecf