Skip to contentSkip to conversation

upm: Fix build with gcc13

PATCH New Khem Raj 1 participant 2 messages Jan 29, 2023

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/2 upm: Fix build with gcc13

---
 .../upm/0001-include-missing-cstdint.patch    | 43 +++++++++++++++++++
 meta-oe/recipes-extended/upm/upm_git.bb       |  1 +
 2 files changed, 44 insertions(+)
 create mode 100644 meta-oe/recipes-extended/upm/upm/0001-include-missing-cstdint.patch
meta-oe/recipes-extended/upm/upm/0001-include-missing-cstdint.patch new file +43 -0
new file mode 100644
index 0000000000..59f81bf3a2
@@ -0,0 +1,43 @@
+From 64f75806c04c2ee819cf2f92cb564ad316354823 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Sun, 29 Jan 2023 00:27:47 -0800
+Subject: [PATCH] include missing <cstdint>
+
+gcc 13 moved some includes around and as a result <cstdint> is no longer transitively included [1]. Explicitly include it for uint{32,64}_t.
+
+[1] https://gcc.gnu.org/gcc-13/porting_to.html#header-dep-changes
+
+Upstream-Status: Submitted [https://github.com/eclipse/upm/pull/704]
+Signed-off-by: Khem Raj <[email protected]>
+---
+ src/mcp9808/mcp9808.hpp | 1 +
+ src/micsv89/micsv89.hpp | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/src/mcp9808/mcp9808.hpp b/src/mcp9808/mcp9808.hpp
+index b9e138d7..2509cd30 100644
+--- a/src/mcp9808/mcp9808.hpp
++++ b/src/mcp9808/mcp9808.hpp
+@@ -13,6 +13,7 @@
+ 
+ #pragma once
+ 
++#include <cstdint>
+ #include <iostream>
+ #include <string>
+ #include <interfaces/iTemperature.hpp>
+diff --git a/src/micsv89/micsv89.hpp b/src/micsv89/micsv89.hpp
+index 2f97dbce..c6e22ad8 100644
+--- a/src/micsv89/micsv89.hpp
++++ b/src/micsv89/micsv89.hpp
+@@ -11,6 +11,7 @@
+ 
+ #pragma once
+ 
++#include <cstdint>
+ #include <iostream>
+ #include <string>
+ 
+-- 
+2.39.1
+
meta-oe/recipes-extended/upm/upm_git.bb +1 -0
index 61e2e38b05..0ae7760bd2 100644
@@ -16,6 +16,7 @@ SRC_URI = "git://github.com/eclipse/${BPN}.git;protocol=http;branch=master;proto
            file://0001-initialize-local-variables-before-use.patch \
            file://0001-cmake-Disable-Wno-misleading-indentation-with-clang-.patch \
            file://0001-cmake-Disable-using-Wno-maybe-uninitialized.patch \
+           file://0001-include-missing-cstdint.patch \
            "
 
 SRC_URI:append:toolchain-clang:x86 = " file://0001-nmea_gps-Link-with-latomic.patch "
Signature · 1 line
2.39.1
author
#1 lore raw

PATCH 2/2 openthread: Use __attribute__ ((unused)) instead of removing 't'

This helps clang to not warn about this variable

---
 .../openthread/ot-br-posix/mbedtls.patch              | 11 +----------
 .../openthread/ot-daemon/mbedtls.patch                | 11 +----------
 2 files changed, 2 insertions(+), 20 deletions(-)
meta-networking/recipes-connectivity/openthread/ot-br-posix/mbedtls.patch +1 -10
index 91b3046484..23e4368d27 100644
@@ -17,19 +17,10 @@ Signed-off-by: Khem Raj <[email protected]>
  void mpi_mul_hlp( size_t i, mbedtls_mpi_uint *s, mbedtls_mpi_uint *d, mbedtls_mpi_uint b )
  {
 -    mbedtls_mpi_uint c = 0, t = 0;
-+    mbedtls_mpi_uint c = 0;
++    mbedtls_mpi_uint c = 0, t __attribute__ ((unused)) = 0;
  
  #if defined(MULADDC_HUIT)
      for( ; i >= 8; i -= 8 )
-@@ -1595,8 +1595,6 @@ void mpi_mul_hlp( size_t i, mbedtls_mpi_
-     }
- #endif /* MULADDC_HUIT */
- 
--    t++;
--
-     do {
-         *d += c; c = ( *d < c ); d++;
-     }
 --- a/third_party/openthread/repo/third_party/mbedtls/repo/CMakeLists.txt
 +++ b/third_party/openthread/repo/third_party/mbedtls/repo/CMakeLists.txt
 @@ -192,7 +192,7 @@ if(CMAKE_COMPILER_IS_GNU)
meta-networking/recipes-connectivity/openthread/ot-daemon/mbedtls.patch +1 -10
index be26a20dad..ffaff48dd4 100644
@@ -17,19 +17,10 @@ Signed-off-by: Khem Raj <[email protected]>
  void mpi_mul_hlp( size_t i, mbedtls_mpi_uint *s, mbedtls_mpi_uint *d, mbedtls_mpi_uint b )
  {
 -    mbedtls_mpi_uint c = 0, t = 0;
-+    mbedtls_mpi_uint c = 0;
++    mbedtls_mpi_uint c = 0, t __attribute__ ((unused)) = 0;
  
  #if defined(MULADDC_HUIT)
      for( ; i >= 8; i -= 8 )
-@@ -1595,8 +1595,6 @@ void mpi_mul_hlp( size_t i, mbedtls_mpi_
-     }
- #endif /* MULADDC_HUIT */
- 
--    t++;
--
-     do {
-         *d += c; c = ( *d < c ); d++;
-     }
 --- a/third_party/mbedtls/repo/CMakeLists.txt
 +++ b/third_party/mbedtls/repo/CMakeLists.txt
 @@ -192,7 +192,7 @@ if(CMAKE_COMPILER_IS_GNU)
Signature · 1 line
2.39.1