diff mbox series

[meta-oe] glog: Fix build with clang on 32bit platforms

Message ID 20230218211908.1430494-1-raj.khem@gmail.com
State New
Headers show
Series [meta-oe] glog: Fix build with clang on 32bit platforms | expand

Commit Message

Khem Raj Feb. 18, 2023, 9:19 p.m. UTC
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...illiseconds-parameter-from-unsigned-.patch | 33 +++++++++++++++++++
 meta-oe/recipes-support/glog/glog_0.6.0.bb    |  1 +
 2 files changed, 34 insertions(+)
 create mode 100644 meta-oe/recipes-support/glog/glog/0001-Change-SleepForMilliseconds-parameter-from-unsigned-.patch
diff mbox series

Patch

diff --git a/meta-oe/recipes-support/glog/glog/0001-Change-SleepForMilliseconds-parameter-from-unsigned-.patch b/meta-oe/recipes-support/glog/glog/0001-Change-SleepForMilliseconds-parameter-from-unsigned-.patch
new file mode 100644
index 0000000000..3732c62cd0
--- /dev/null
+++ b/meta-oe/recipes-support/glog/glog/0001-Change-SleepForMilliseconds-parameter-from-unsigned-.patch
@@ -0,0 +1,33 @@ 
+From 176230435cb4b64ff7f2d97f77a04579ad9ca239 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 18 Feb 2023 13:14:14 -0800
+Subject: [PATCH] Change SleepForMilliseconds parameter from unsigned int -> long
+
+Fixes following error on 32bit platforms
+
+src/googletest.h:631:35: error: non-constant-expression cannot be narrowed from type 'unsigned int' to 'long' in initializer list [-Wc++11-narrowing]
+  const struct timespec req = {0, t * 1000 * 1000};
+                                  ^~~~~~~~~~~~~~~
+
+Upstream-Status: Submitted [https://github.com/google/glog/pull/894]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/googletest.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/googletest.h b/src/googletest.h
+index 5761361..836b06c 100644
+--- a/src/googletest.h
++++ b/src/googletest.h
+@@ -625,7 +625,7 @@ class Thread {
+ #endif
+ };
+ 
+-static inline void SleepForMilliseconds(unsigned t) {
++static inline void SleepForMilliseconds(long t) {
+ #ifndef GLOG_OS_WINDOWS
+ # if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 199309L
+   const struct timespec req = {0, t * 1000 * 1000};
+-- 
+2.39.2
+
diff --git a/meta-oe/recipes-support/glog/glog_0.6.0.bb b/meta-oe/recipes-support/glog/glog_0.6.0.bb
index 067e914aa2..89b7cfd184 100644
--- a/meta-oe/recipes-support/glog/glog_0.6.0.bb
+++ b/meta-oe/recipes-support/glog/glog_0.6.0.bb
@@ -9,6 +9,7 @@  LIC_FILES_CHKSUM = "file://COPYING;md5=dc9db360e0bbd4e46672f3fd91dd6c4b"
 SRC_URI = " \
     git://github.com/google/glog.git;nobranch=1;protocol=https \
     file://libexecinfo.patch \
+    file://0001-Change-SleepForMilliseconds-parameter-from-unsigned-.patch \
 "
 
 SRCREV = "b33e3bad4c46c8a6345525fd822af355e5ef9446"