diff mbox series

[1/1] package/hawktracer: fix build without threads

Message ID 20220812130331.98237-1-fontaine.fabrice@gmail.com
State Superseded
Headers show
Series [1/1] package/hawktracer: fix build without threads | expand

Commit Message

Fabrice Fontaine Aug. 12, 2022, 1:03 p.m. UTC
Fix the following build failure without threads raised since the
addition of the package in commit
94d8764ef938936aa5432f1f13bd1b2d8b62a159:

/home/giuliobenetti/autobuild/run/instance-2/output-1/build/hawktracer-e53b07bc812c4cfe8f6253ddb48ac43de8fa74a8/lib/platform/linux/cpu_usage.c:5:10: fatal error: pthread.h: No such file or directory
    5 | #include <pthread.h>
      |          ^~~~~~~~~~~

Fixes:
 - http://autobuild.buildroot.org/results/7edc29e21e441e66ad7c4df1673e506950930913

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 ...eLists.txt-fix-build-without-threads.patch | 36 +++++++++++++++++++
 1 file changed, 36 insertions(+)
 create mode 100644 package/hawktracer/0001-CMakeLists.txt-fix-build-without-threads.patch
diff mbox series

Patch

diff --git a/package/hawktracer/0001-CMakeLists.txt-fix-build-without-threads.patch b/package/hawktracer/0001-CMakeLists.txt-fix-build-without-threads.patch
new file mode 100644
index 0000000000..bb7146da5c
--- /dev/null
+++ b/package/hawktracer/0001-CMakeLists.txt-fix-build-without-threads.patch
@@ -0,0 +1,36 @@ 
+From a6aeacbef008ef7e4b014c028430e52c2e2f9361 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Fri, 12 Aug 2022 14:51:33 +0200
+Subject: [PATCH] CMakeLists.txt: fix build without threads
+
+Fix the following build failure without threads:
+
+/home/giuliobenetti/autobuild/run/instance-2/output-1/build/hawktracer-e53b07bc812c4cfe8f6253ddb48ac43de8fa74a8/lib/platform/linux/cpu_usage.c:5:10: fatal error: pthread.h: No such file or directory
+    5 | #include <pthread.h>
+      |          ^~~~~~~~~~~
+
+Fixes:
+ - http://autobuild.buildroot.org/results/7edc29e21e441e66ad7c4df1673e506950930913
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+[Upstream status: https://github.com/amzn/hawktracer/pull/86]
+---
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index dbbdc2f..a38ff8f 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -35,7 +35,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
+ 
+ # PLATFORM FEATURES
+ include(platform_features)
+-define_platform_feature(CPU_USAGE "cpu_usage.c" DEFAULT)
++define_platform_feature(CPU_USAGE "cpu_usage.c" ${ENABLE_THREADS})
+ define_platform_feature(MEMORY_USAGE "memory_usage.c" DEFAULT)
+ define_platform_feature(ALLOC_HOOKS "alloc_hooks.c" OFF)
+ 
+-- 
+2.35.1
+