diff options
author | Khem Raj <raj.khem@gmail.com> | 2020-10-31 16:17:51 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2020-11-02 09:00:52 -0800 |
commit | f3b1dd6a45c16b36aa8ee6ba94da60267a798757 (patch) | |
tree | b55382fd9649a722c76609e277187447d0299ce9 | |
parent | 0500b364b284b694a75e4fe7df2482950502eddc (diff) | |
download | meta-openembedded-contrib-f3b1dd6a45c16b36aa8ee6ba94da60267a798757.tar.gz |
gperftools: Fix build with new musl updates
Latest musl shows build failures e.g.
../git/src/profile-handler.cc:275:8: error: no member named '_sigev_un' in 'sigevent'
sevp._sigev_un._tid = sys_gettid();
~~~~ ^
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-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 @@ +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 + 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 \ file://0001-disbale-heap-checkers-and-debug-allocator-on-musl.patch \ file://disable_libunwind_aarch64.patch \ file://sgidef.patch \ + file://0001-profile-handler-Specify-libc-specific-thread_id.patch \ " inherit autotools |