diff mbox series

[2/2] lttng-tools: Fix build with glibc 2.30

Message ID 20190727155849.38385-2-raj.khem@gmail.com
State Accepted
Commit 5abaf2a5c1e8707189c5f607a19170e031e1c480
Headers show
Series [1/2] ltp: Fix build with glibc 2.30 | expand

Commit Message

Khem Raj July 27, 2019, 3:58 p.m. UTC
Signed-off-by: Khem Raj <raj.khem@gmail.com>

---
 ...heck-for-gettid-API-during-configure.patch | 55 +++++++++++++++++++
 .../lttng/lttng-tools_2.10.7.bb               |  1 +
 2 files changed, 56 insertions(+)
 create mode 100644 meta/recipes-kernel/lttng/lttng-tools/0001-check-for-gettid-API-during-configure.patch

-- 
2.22.0

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
diff mbox series

Patch

diff --git a/meta/recipes-kernel/lttng/lttng-tools/0001-check-for-gettid-API-during-configure.patch b/meta/recipes-kernel/lttng/lttng-tools/0001-check-for-gettid-API-during-configure.patch
new file mode 100644
index 0000000000..c494cee604
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-tools/0001-check-for-gettid-API-during-configure.patch
@@ -0,0 +1,55 @@ 
+From 69c62f5f3cc424b7dd0c8e4097743b39a9c48306 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 27 Jul 2019 08:48:13 -0700
+Subject: [lttng-tools][PATCH] check for gettid API during configure
+
+Add support for gettid() provided by glibc 2.30+
+
+Since version 2.30 glibc provides gettid and it causes conflicts with
+locally defined gettid(). Use the local definition of
+gettid only if system gettid is not available.
+
+https://sourceware.org/git/?p=glibc.git;a=blob_plain;f=NEWS;hb=HEAD<Paste>
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure.ac            | 2 +-
+ src/common/compat/tid.h | 3 ++-
+ 2 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 7b99f5c..e4bd82c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -190,7 +190,7 @@ AC_CHECK_HEADERS([ \
+ # Basic functions check
+ AC_CHECK_FUNCS([ \
+ 	atexit bzero clock_gettime dup2 fdatasync fls ftruncate \
+-	gethostbyname gethostname getpagesize localtime_r memchr memset \
++	gethostbyname gethostname getpagesize gettid localtime_r memchr memset \
+ 	mkdir munmap putenv realpath rmdir socket strchr strcspn strdup \
+ 	strncasecmp strndup strnlen strpbrk strrchr strstr strtol strtoul \
+ 	strtoull dirfd gethostbyname2 getipnodebyname epoll_create1 \
+diff --git a/src/common/compat/tid.h b/src/common/compat/tid.h
+index 40f562f..aa07a85 100644
+--- a/src/common/compat/tid.h
++++ b/src/common/compat/tid.h
+@@ -25,6 +25,7 @@
+ #ifndef LTTNG_TID_H
+ #define LTTNG_TID_H
+ 
++#if !HAVE_GETTID
+ #ifdef __linux__
+ #include <syscall.h>
+ #endif
+@@ -47,5 +48,5 @@ static inline pid_t gettid(void)
+ 	return getpid();
+ }
+ #endif
+-
++#endif /* HAVE_GETTID */
+ #endif /* LTTNG_TID_H */
+-- 
+2.22.0
+
diff --git a/meta/recipes-kernel/lttng/lttng-tools_2.10.7.bb b/meta/recipes-kernel/lttng/lttng-tools_2.10.7.bb
index 469ad111c4..aa6d19d0fa 100644
--- a/meta/recipes-kernel/lttng/lttng-tools_2.10.7.bb
+++ b/meta/recipes-kernel/lttng/lttng-tools_2.10.7.bb
@@ -34,6 +34,7 @@  SRC_URI = "https://lttng.org/files/lttng-tools/lttng-tools-${PV}.tar.bz2 \
            file://lttng-sessiond.service \
            file://0001-Skip-when-testapp-is-not-present.patch \
            file://0002-Fix-check-for-lttng-modules-presence-before-testing.patch \
+           file://0001-check-for-gettid-API-during-configure.patch \
            "
 
 SRC_URI[md5sum] = "e7804d10e4cade381e241601f6047373"