aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2020-09-10 09:56:00 -0700
committerKhem Raj <raj.khem@gmail.com>2020-09-10 09:58:12 -0700
commitad26afac60921cb8b6004eaba74f110c60c7de3e (patch)
tree7c638592b0476b6adea46cec6e822d3e6f80c6af
parent14f193be821efc1aa25331a8000ead8687a83371 (diff)
downloadmeta-openembedded-contrib-ad26afac60921cb8b6004eaba74f110c60c7de3e.tar.gz
android-tools: Support libselinux to build with musl which now has gettid
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-oe/recipes-devtools/android-tools/android-tools/libselinux/0001-libselinux-Do-not-define-gettid-if-glibc-2.30-is-use.patch21
1 files changed, 9 insertions, 12 deletions
diff --git a/meta-oe/recipes-devtools/android-tools/android-tools/libselinux/0001-libselinux-Do-not-define-gettid-if-glibc-2.30-is-use.patch b/meta-oe/recipes-devtools/android-tools/android-tools/libselinux/0001-libselinux-Do-not-define-gettid-if-glibc-2.30-is-use.patch
index 8524517cb6..87771cba85 100644
--- a/meta-oe/recipes-devtools/android-tools/android-tools/libselinux/0001-libselinux-Do-not-define-gettid-if-glibc-2.30-is-use.patch
+++ b/meta-oe/recipes-devtools/android-tools/android-tools/libselinux/0001-libselinux-Do-not-define-gettid-if-glibc-2.30-is-use.patch
@@ -29,24 +29,21 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
--- a/src/procattr.c
+++ b/src/procattr.c
-@@ -8,7 +8,19 @@
+@@ -8,12 +8,16 @@
#include "selinux_internal.h"
#include "policy.h"
-#ifndef __BIONIC__
+/* Bionic and glibc >= 2.30 declare gettid() system call wrapper in unistd.h and
+ * has a definition for it */
-+#ifdef __BIONIC__
-+ #define OVERRIDE_GETTID 0
-+#elif !defined(__GLIBC_PREREQ)
-+ #define OVERRIDE_GETTID 1
-+#elif !__GLIBC_PREREQ(2,29)
-+ #define OVERRIDE_GETTID 1
-+#else
-+ #define OVERRIDE_GETTID 0
-+#endif
-+
-+#if OVERRIDE_GETTID
++#if defined(__GLIBC_)
++#if !__GLIBC_PREREQ(2,30)
static pid_t gettid(void)
{
return syscall(__NR_gettid);
+ }
+ #endif
++#endif
+
+ static int getprocattrcon(char ** context,
+ pid_t pid, const char *attr)