diff options
| author | Khem Raj <raj.khem@gmail.com> | 2024-05-28 19:41:10 -0700 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2024-05-30 08:42:01 -0700 |
| commit | 2452baba077d399fcbbe160e30ed0cca4b658205 (patch) | |
| tree | 5190e490ab8e405394f0ad29faf3b658cb00fcbf /meta-oe/recipes-support/googlebenchmark | |
| parent | 9813fb56d22acad36d70158335b8ee9f4a05ad89 (diff) | |
| download | meta-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')
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 @@ | |||
| 1 | From db704bcc344529039d7fb28be380658625a9c08d Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Tue, 28 May 2024 19:34:43 -0700 | ||
| 4 | Subject: [PATCH] cycleclock: Fix type conversion to match function return type | ||
| 5 | |||
| 6 | fixes build with clang19 | ||
| 7 | |||
| 8 | src/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 | | ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~ | ||
| 11 | 1 error generated. | ||
| 12 | |||
| 13 | Upstream-Status: Submitted [https://github.com/google/benchmark/pull/1794] | ||
| 14 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 15 | --- | ||
| 16 | src/cycleclock.h | 2 +- | ||
| 17 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 18 | |||
| 19 | diff --git a/src/cycleclock.h b/src/cycleclock.h | ||
| 20 | index 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 | -- | ||
| 33 | 2.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" | |||
| 4 | LICENSE = "Apache-2.0" | 4 | 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 | SRCREV = "a4cf155615c63e019ae549e31703bf367df5b471" | 9 | SRCREV = "a4cf155615c63e019ae549e31703bf367df5b471" |
| 9 | 10 | ||
| 10 | S = "${WORKDIR}/git" | 11 | S = "${WORKDIR}/git" |
