* [Buildroot] [PATCH v2, 1/1] package/hawktracer: fix build without threads
@ 2022-08-12 14:38 Fabrice Fontaine
2022-08-14 10:05 ` Thomas Petazzoni via buildroot
0 siblings, 1 reply; 2+ messages in thread
From: Fabrice Fontaine @ 2022-08-12 14:38 UTC (permalink / raw)
To: buildroot; +Cc: Gilles Talis, Fabrice Fontaine
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>
---
Changes v1 -> v2:
- Update patch to avoid a build failure on macos
...eatures.cmake-fix-DENABLE_CPU_USAGE_.patch | 38 +++++++++++++++++++
package/hawktracer/hawktracer.mk | 8 +++-
2 files changed, 44 insertions(+), 2 deletions(-)
create mode 100644 package/hawktracer/0001-cmake-platform_features.cmake-fix-DENABLE_CPU_USAGE_.patch
diff --git a/package/hawktracer/0001-cmake-platform_features.cmake-fix-DENABLE_CPU_USAGE_.patch b/package/hawktracer/0001-cmake-platform_features.cmake-fix-DENABLE_CPU_USAGE_.patch
new file mode 100644
index 0000000000..5c8e6e9e65
--- /dev/null
+++ b/package/hawktracer/0001-cmake-platform_features.cmake-fix-DENABLE_CPU_USAGE_.patch
@@ -0,0 +1,38 @@
+From 65e78e2b972e2fab76b18732941ae611ec782dee 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] cmake/platform_features.cmake: fix
+ -DENABLE_CPU_USAGE_FEATURE=OFF
+
+Fix -DENABLE_CPU_USAGE_FEATURE=OFF to allow the user to disable
+CPU_USAGE and avoid 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]
+---
+ cmake/platform_features.cmake | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cmake/platform_features.cmake b/cmake/platform_features.cmake
+index 1abbd41..8d7cfd9 100644
+--- a/cmake/platform_features.cmake
++++ b/cmake/platform_features.cmake
+@@ -18,7 +18,7 @@ macro(_validate_feature_enabled FEATURE_NAME VARIABLE)
+ endmacro(_validate_feature_enabled)
+
+ macro(define_platform_feature FEATURE_NAME FEATURE_DEFAULT_FILE DEFAULT_ENABLE)
+- if (NOT "${DEFAULT_ENABLE}" STREQUAL "OFF" OR "${ENABLE_${FEATURE_NAME}_FEATURE}" STREQUAL "ON")
++ if (NOT "${DEFAULT_ENABLE}" STREQUAL "OFF" AND NOT "${ENABLE_${FEATURE_NAME}_FEATURE}" STREQUAL "OFF")
+ set(OPTION_VALUE ON)
+ else()
+ set(OPTION_VALUE OFF)
+--
+2.35.1
+
diff --git a/package/hawktracer/hawktracer.mk b/package/hawktracer/hawktracer.mk
index f4654b2274..a14e2e2528 100644
--- a/package/hawktracer/hawktracer.mk
+++ b/package/hawktracer/hawktracer.mk
@@ -36,9 +36,13 @@ endif
# Enable threads support if supported by toolchain
ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
-HAWKTRACER_CONF_OPTS += -DENABLE_THREADS=ON
+HAWKTRACER_CONF_OPTS += \
+ -DENABLE_CPU_USAGE_FEATURE=ON \
+ -DENABLE_THREADS=ON
else
-HAWKTRACER_CONF_OPTS += -DENABLE_THREADS=OFF
+HAWKTRACER_CONF_OPTS += \
+ -DENABLE_CPU_USAGE_FEATURE=OFF \
+ -DENABLE_THREADS=OFF
endif
$(eval $(cmake-package))
--
2.35.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-08-14 10:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-12 14:38 [Buildroot] [PATCH v2, 1/1] package/hawktracer: fix build without threads Fabrice Fontaine
2022-08-14 10:05 ` Thomas Petazzoni via buildroot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox