aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-extended/sysdig/sysdig/0001-Fix-build-with-musl-backtrace-APIs-are-glibc-specifi.patch
blob: 6ba436911a89dc2798905a1588d51d49cd537b52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
From 290703a5d21f34ea5ec23efc815a9f4df241e7e8 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 23 Oct 2015 00:33:32 -0700
Subject: [PATCH] Fix build with musl, backtrace() APIs are glibc specific

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 userspace/libsinsp/utils.cpp | 4 +++-
 userspace/libsinsp/utils.h   | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

--- a/userspace/libsinsp/utils.cpp
+++ b/userspace/libsinsp/utils.cpp
@@ -22,7 +22,7 @@ limitations under the License.
 #include <limits.h>
 #include <stdlib.h>
 #include <sys/time.h>
-#ifndef CYGWING_AGENT
+#if !defined(CYGWING_AGENT) || defined(__GLIBC__)
 #include <execinfo.h>
 #endif
 #include <unistd.h>
@@ -772,6 +772,7 @@ bool sinsp_utils::glob_match(const char
 
 #ifndef CYGWING_AGENT
 #ifndef _WIN32
+#ifdef __GLIBC__
 void sinsp_utils::bt(void)
 {
 	static const char start[] = "BACKTRACE ------------";
@@ -793,6 +794,7 @@ void sinsp_utils::bt(void)
 
 	free(bt_syms);
 }
+#endif // Glibc
 #endif // _WIN32
 #endif // CYGWING_AGENT
 
--- a/userspace/libsinsp/utils.h
+++ b/userspace/libsinsp/utils.h
@@ -104,7 +104,7 @@ public:
 
 	static bool glob_match(const char *pattern, const char *string);
 
-#ifndef _WIN32
+#if not defined(_WIN32) && defined(__GLIBC__)
 	//
 	// Print the call stack
 	//