diff options
-rw-r--r-- | meta-oe/recipes-support/gperftools/gperftools/0001-profile-handler-Specify-libc-specific-thread_id.patch | 38 | ||||
-rw-r--r-- | meta-oe/recipes-support/gperftools/gperftools_2.8.bb | 1 |
2 files changed, 39 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/gperftools/gperftools/0001-profile-handler-Specify-libc-specific-thread_id.patch b/meta-oe/recipes-support/gperftools/gperftools/0001-profile-handler-Specify-libc-specific-thread_id.patch new file mode 100644 index 0000000000..4029a69c5c --- /dev/null +++ b/meta-oe/recipes-support/gperftools/gperftools/0001-profile-handler-Specify-libc-specific-thread_id.patch | |||
@@ -0,0 +1,38 @@ | |||
1 | From 0a504852ed6e56620d1df26b503c4aa2b5b74760 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sat, 31 Oct 2020 16:12:36 -0700 | ||
4 | Subject: [PATCH] profile-handler: Specify libc specific thread_id | ||
5 | |||
6 | We need to know internal _sigev_un is glibc specific, add an else for | ||
7 | musl case | ||
8 | |||
9 | Fixes build issue | ||
10 | ../git/src/profile-handler.cc:275:8: error: no member named '_sigev_un' in 'sigevent' | ||
11 | sevp._sigev_un._tid = sys_gettid(); | ||
12 | ~~~~ ^ | ||
13 | |||
14 | Upstream-Status: Pending | ||
15 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
16 | --- | ||
17 | src/profile-handler.cc | 4 ++++ | ||
18 | 1 file changed, 4 insertions(+) | ||
19 | |||
20 | diff --git a/src/profile-handler.cc b/src/profile-handler.cc | ||
21 | index 7fdcb69..5867118 100644 | ||
22 | --- a/src/profile-handler.cc | ||
23 | +++ b/src/profile-handler.cc | ||
24 | @@ -272,7 +272,11 @@ static void StartLinuxThreadTimer(int timer_type, int signal_number, | ||
25 | struct itimerspec its; | ||
26 | memset(&sevp, 0, sizeof(sevp)); | ||
27 | sevp.sigev_notify = SIGEV_THREAD_ID; | ||
28 | +#ifdef __GLIBC__ | ||
29 | sevp._sigev_un._tid = sys_gettid(); | ||
30 | +#else | ||
31 | + sevp.sigev_notify_thread_id = sys_gettid(); | ||
32 | +#endif | ||
33 | sevp.sigev_signo = signal_number; | ||
34 | clockid_t clock = CLOCK_THREAD_CPUTIME_ID; | ||
35 | if (timer_type == ITIMER_REAL) { | ||
36 | -- | ||
37 | 2.29.2 | ||
38 | |||
diff --git a/meta-oe/recipes-support/gperftools/gperftools_2.8.bb b/meta-oe/recipes-support/gperftools/gperftools_2.8.bb index 662777b473..d9b310bceb 100644 --- a/meta-oe/recipes-support/gperftools/gperftools_2.8.bb +++ b/meta-oe/recipes-support/gperftools/gperftools_2.8.bb | |||
@@ -10,6 +10,7 @@ SRC_URI = "git://github.com/gperftools/gperftools \ | |||
10 | file://0001-disbale-heap-checkers-and-debug-allocator-on-musl.patch \ | 10 | file://0001-disbale-heap-checkers-and-debug-allocator-on-musl.patch \ |
11 | file://disable_libunwind_aarch64.patch \ | 11 | file://disable_libunwind_aarch64.patch \ |
12 | file://sgidef.patch \ | 12 | file://sgidef.patch \ |
13 | file://0001-profile-handler-Specify-libc-specific-thread_id.patch \ | ||
13 | " | 14 | " |
14 | 15 | ||
15 | inherit autotools | 16 | inherit autotools |