diff mbox series

[meta-oe] perfetto: fix error with gcc-15

Message ID 20250409095100.1818740-1-mark.yang@lge.com
State New
Headers show
Series [meta-oe] perfetto: fix error with gcc-15 | expand

Commit Message

mark yang April 9, 2025, 9:51 a.m. UTC
From: "mark.yang" <mark.yang@lge.com>

  * Add missing cstdint include to fix build error with gcc-15

  * To fix the error with gcc-15.
  http://errors.yoctoproject.org/Errors/Details/851189/
    ../git/include/perfetto/ext/tracing/core/slice.h:47:46: error: 'uint8_t' was not declared in this scope
    47 |   static Slice TakeOwnership(std::unique_ptr<uint8_t[]> buf, size_t size) {
        |                                              ^~~~~~~
    ../git/include/perfetto/ext/tracing/core/slice.h:25:1: note: 'uint8_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
    24 | #include <string>
    +++ |+#include <cstdint>

  * See also: https://gcc.gnu.org/gcc-13/porting_to.html#header-dep-changes
  Some C++ Standard Library headers have been changed to no longer include
  other headers that were being used internally by the library.

Signed-off-by: mark.yang <mark.yang@lge.com>
---
 meta-oe/recipes-devtools/perfetto/perfetto.bb |  1 +
 ...r-due-to-missing-cstdint-with-gcc-15.patch | 39 +++++++++++++++++++
 2 files changed, 40 insertions(+)
 create mode 100644 meta-oe/recipes-devtools/perfetto/perfetto/0001-Fix-build-error-due-to-missing-cstdint-with-gcc-15.patch
diff mbox series

Patch

diff --git a/meta-oe/recipes-devtools/perfetto/perfetto.bb b/meta-oe/recipes-devtools/perfetto/perfetto.bb
index 5a5d4de899..229a5caee0 100644
--- a/meta-oe/recipes-devtools/perfetto/perfetto.bb
+++ b/meta-oe/recipes-devtools/perfetto/perfetto.bb
@@ -28,6 +28,7 @@  SRC_URI:append = " \
            \
            file://0001-Remove-check_build_deps-build-steps.patch \
            file://0002-traced-fix-missing-include.patch \
+           file://0001-Fix-build-error-due-to-missing-cstdint-with-gcc-15.patch \
            "
 
 SRCREV_bionic = "a0d0355105cb9d4a4b5384897448676133d7b8e2"
diff --git a/meta-oe/recipes-devtools/perfetto/perfetto/0001-Fix-build-error-due-to-missing-cstdint-with-gcc-15.patch b/meta-oe/recipes-devtools/perfetto/perfetto/0001-Fix-build-error-due-to-missing-cstdint-with-gcc-15.patch
new file mode 100644
index 0000000000..9f51290dcc
--- /dev/null
+++ b/meta-oe/recipes-devtools/perfetto/perfetto/0001-Fix-build-error-due-to-missing-cstdint-with-gcc-15.patch
@@ -0,0 +1,39 @@ 
+From 2413c2f7d4a96d4f6b5a5155fc35979183ddf291 Mon Sep 17 00:00:00 2001
+From: markyang92 <pllpokko@alumni.kaist.ac.kr>
+Date: Wed, 9 Apr 2025 18:25:09 +0900
+Subject: [PATCH] Fix build error due to missing cstdint with gcc-15
+
+  * Add missing cstdint include to fix build error with gcc-15
+
+  * To fix the error with gcc-15.
+  http://errors.yoctoproject.org/Errors/Details/851189/
+    ../git/include/perfetto/ext/tracing/core/slice.h:47:46: error: 'uint8_t' was not declared in this scope
+    47 |   static Slice TakeOwnership(std::unique_ptr<uint8_t[]> buf, size_t size) {
+        |                                              ^~~~~~~
+    ../git/include/perfetto/ext/tracing/core/slice.h:25:1: note: 'uint8_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
+    24 | #include <string>
+    +++ |+#include <cstdint>
+
+  * See also: https://gcc.gnu.org/gcc-13/porting_to.html#header-dep-changes
+  Some C++ Standard Library headers have been changed to no longer include
+  other headers that were being used internally by the library.
+
+Upstream-Status: Submitted [https://github.com/google/perfetto/pull/1214]
+Signed-off-by: mark.yang <mark.yang@lge.com>
+Signed-off-by: markyang92 <pllpokko@alumni.kaist.ac.kr>
+---
+ include/perfetto/ext/tracing/core/slice.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/include/perfetto/ext/tracing/core/slice.h b/include/perfetto/ext/tracing/core/slice.h
+index cdabc39465..ebbc402d49 100644
+--- a/include/perfetto/ext/tracing/core/slice.h
++++ b/include/perfetto/ext/tracing/core/slice.h
+@@ -24,6 +24,7 @@
+ #include <memory>
+ #include <string>
+ #include <vector>
++#include <cstdint>
+ 
+ #include "perfetto/base/logging.h"
+