diff options
| -rw-r--r-- | meta-oe/recipes-support/googlebenchmark/googlebenchmark/0001-cycleclock-Fix-type-conversion-to-match-function-ret.patch | 21 |
1 files changed, 10 insertions, 11 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 index d514cf192b..3017314abe 100644 --- 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 | |||
| @@ -1,7 +1,8 @@ | |||
| 1 | From db704bcc344529039d7fb28be380658625a9c08d Mon Sep 17 00:00:00 2001 | 1 | From 7f0e99af540a333108b92d792923ec7fc9e9fad9 Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> | 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Tue, 28 May 2024 19:34:43 -0700 | 3 | Date: Tue, 28 May 2024 20:14:54 -0700 |
| 4 | Subject: [PATCH] cycleclock: Fix type conversion to match function return type | 4 | Subject: [PATCH] cycleclock: Fix type conversion to match function return type |
| 5 | (#1794) | ||
| 5 | 6 | ||
| 6 | fixes build with clang19 | 7 | fixes build with clang19 |
| 7 | 8 | ||
| @@ -10,25 +11,23 @@ src/cycleclock.h:208:52: error: implicit conversion changes signedness: 'uint64_ | |||
| 10 | | ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~ | 11 | | ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~ |
| 11 | 1 error generated. | 12 | 1 error generated. |
| 12 | 13 | ||
| 13 | Upstream-Status: Submitted [https://github.com/google/benchmark/pull/1794] | 14 | Upstream-Status: Backport [https://github.com/google/benchmark/commit/7f0e99af540a333108b92d792923ec7fc9e9fad9] |
| 14 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | 15 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 15 | --- | 16 | --- |
| 16 | src/cycleclock.h | 2 +- | 17 | src/cycleclock.h | 3 ++- |
| 17 | 1 file changed, 1 insertion(+), 1 deletion(-) | 18 | 1 file changed, 2 insertions(+), 1 deletion(-) |
| 18 | 19 | ||
| 19 | diff --git a/src/cycleclock.h b/src/cycleclock.h | 20 | diff --git a/src/cycleclock.h b/src/cycleclock.h |
| 20 | index a2584376..f96801c5 100644 | 21 | index a25843760..c657414e5 100644 |
| 21 | --- a/src/cycleclock.h | 22 | --- a/src/cycleclock.h |
| 22 | +++ b/src/cycleclock.h | 23 | +++ b/src/cycleclock.h |
| 23 | @@ -205,7 +205,7 @@ inline BENCHMARK_ALWAYS_INLINE int64_t Now() { | 24 | @@ -205,7 +205,8 @@ inline BENCHMARK_ALWAYS_INLINE int64_t Now() { |
| 24 | "sub %0, zero, %0\n" | 25 | "sub %0, zero, %0\n" |
| 25 | "and %1, %1, %0\n" | 26 | "and %1, %1, %0\n" |
| 26 | : "=r"(cycles_hi0), "=r"(cycles_lo), "=r"(cycles_hi1)); | 27 | : "=r"(cycles_hi0), "=r"(cycles_lo), "=r"(cycles_hi1)); |
| 27 | - return (static_cast<uint64_t>(cycles_hi1) << 32) | cycles_lo; | 28 | - 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 | + return static_cast<int64_t>((static_cast<uint64_t>(cycles_hi1) << 32) | |
| 30 | + cycles_lo); | ||
| 29 | #else | 31 | #else |
| 30 | uint64_t cycles; | 32 | uint64_t cycles; |
| 31 | asm volatile("rdtime %0" : "=r"(cycles)); | 33 | asm volatile("rdtime %0" : "=r"(cycles)); |
| 32 | -- | ||
| 33 | 2.45.1 | ||
| 34 | |||
