summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/googlebenchmark
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2024-05-28 19:41:10 -0700
committerKhem Raj <raj.khem@gmail.com>2024-05-30 08:42:01 -0700
commit2452baba077d399fcbbe160e30ed0cca4b658205 (patch)
tree5190e490ab8e405394f0ad29faf3b658cb00fcbf /meta-oe/recipes-support/googlebenchmark
parent9813fb56d22acad36d70158335b8ee9f4a05ad89 (diff)
downloadmeta-openembedded-2452baba077d399fcbbe160e30ed0cca4b658205.tar.gz
googlebenchmark: Fix type conversion errors found with clang
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-support/googlebenchmark')
-rw-r--r--meta-oe/recipes-support/googlebenchmark/googlebenchmark/0001-cycleclock-Fix-type-conversion-to-match-function-ret.patch34
-rw-r--r--meta-oe/recipes-support/googlebenchmark/googlebenchmark_1.8.4.bb3
2 files changed, 36 insertions, 1 deletions
diff --git a/meta-oe/recipes-support/googlebenchmark/googlebenchmark/0001-cycleclock-Fix-type-conversion-to-match-function-ret.patch b/meta-oe/recipes-support/googlebenchmark/googlebenchmark/0001-cycleclock-Fix-type-conversion-to-match-function-ret.patch
new file mode 100644
index 0000000000..d514cf192b
--- /dev/null
+++ b/meta-oe/recipes-support/googlebenchmark/googlebenchmark/0001-cycleclock-Fix-type-conversion-to-match-function-ret.patch
@@ -0,0 +1,34 @@
1From db704bcc344529039d7fb28be380658625a9c08d Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 28 May 2024 19:34:43 -0700
4Subject: [PATCH] cycleclock: Fix type conversion to match function return type
5
6fixes build with clang19
7
8src/cycleclock.h:208:52: error: implicit conversion changes signedness: 'uint64_t' (aka 'unsigned long long') to 'int64_t' (aka 'long long') [-Werror,-Wsign-conversion]
9 208 | return (static_cast<uint64_t>(cycles_hi1) << 32) | cycles_lo;
10 | ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
111 error generated.
12
13Upstream-Status: Submitted [https://github.com/google/benchmark/pull/1794]
14Signed-off-by: Khem Raj <raj.khem@gmail.com>
15---
16 src/cycleclock.h | 2 +-
17 1 file changed, 1 insertion(+), 1 deletion(-)
18
19diff --git a/src/cycleclock.h b/src/cycleclock.h
20index a2584376..f96801c5 100644
21--- a/src/cycleclock.h
22+++ b/src/cycleclock.h
23@@ -205,7 +205,7 @@ inline BENCHMARK_ALWAYS_INLINE int64_t Now() {
24 "sub %0, zero, %0\n"
25 "and %1, %1, %0\n"
26 : "=r"(cycles_hi0), "=r"(cycles_lo), "=r"(cycles_hi1));
27- return (static_cast<uint64_t>(cycles_hi1) << 32) | cycles_lo;
28+ return static_cast<int64_t>((static_cast<uint64_t>(cycles_hi1) << 32) | cycles_lo);
29 #else
30 uint64_t cycles;
31 asm volatile("rdtime %0" : "=r"(cycles));
32--
332.45.1
34
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 ffb57942ee..34732b42d9 100644
--- a/meta-oe/recipes-support/googlebenchmark/googlebenchmark_1.8.4.bb
+++ b/meta-oe/recipes-support/googlebenchmark/googlebenchmark_1.8.4.bb
@@ -4,7 +4,8 @@ SECTION = "libs"
4LICENSE = "Apache-2.0" 4LICENSE = "Apache-2.0"
5LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" 5LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
6 6
7SRC_URI = "git://github.com/google/benchmark.git;protocol=https;branch=main" 7SRC_URI = "git://github.com/google/benchmark.git;protocol=https;branch=main \
8 file://0001-cycleclock-Fix-type-conversion-to-match-function-ret.patch"
8SRCREV = "a4cf155615c63e019ae549e31703bf367df5b471" 9SRCREV = "a4cf155615c63e019ae549e31703bf367df5b471"
9 10
10S = "${WORKDIR}/git" 11S = "${WORKDIR}/git"