aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/gperftools/gperftools/0001-profile-handler-Specify-libc-specific-thread_id.patch
blob: 4029a69c5c42ed888ca44a0c6dd739c1d8aa590b (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
From 0a504852ed6e56620d1df26b503c4aa2b5b74760 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 31 Oct 2020 16:12:36 -0700
Subject: [PATCH] profile-handler: Specify libc specific thread_id

We need to know internal _sigev_un is glibc specific, add an else for
musl case

Fixes build issue
../git/src/profile-handler.cc:275:8: error: no member named '_sigev_un' in 'sigevent'
  sevp._sigev_un._tid = sys_gettid();
  ~~~~ ^

Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 src/profile-handler.cc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/profile-handler.cc b/src/profile-handler.cc
index 7fdcb69..5867118 100644
--- a/src/profile-handler.cc
+++ b/src/profile-handler.cc
@@ -272,7 +272,11 @@ static void StartLinuxThreadTimer(int timer_type, int signal_number,
   struct itimerspec its;
   memset(&sevp, 0, sizeof(sevp));
   sevp.sigev_notify = SIGEV_THREAD_ID;
+#ifdef __GLIBC__
   sevp._sigev_un._tid = sys_gettid();
+#else
+  sevp.sigev_notify_thread_id = sys_gettid();
+#endif
   sevp.sigev_signo = signal_number;
   clockid_t clock = CLOCK_THREAD_CPUTIME_ID;
   if (timer_type == ITIMER_REAL) {
-- 
2.29.2