diff options
| author | Khem Raj <raj.khem@gmail.com> | 2020-09-10 09:56:00 -0700 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2020-09-10 09:58:12 -0700 |
| commit | ad26afac60921cb8b6004eaba74f110c60c7de3e (patch) | |
| tree | 7c638592b0476b6adea46cec6e822d3e6f80c6af | |
| parent | 14f193be821efc1aa25331a8000ead8687a83371 (diff) | |
| download | meta-openembedded-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.patch | 21 |
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> | |||
| 29 | 29 | ||
| 30 | --- a/src/procattr.c | 30 | --- a/src/procattr.c |
| 31 | +++ b/src/procattr.c | 31 | +++ b/src/procattr.c |
| 32 | @@ -8,7 +8,19 @@ | 32 | @@ -8,12 +8,16 @@ |
| 33 | #include "selinux_internal.h" | 33 | #include "selinux_internal.h" |
| 34 | #include "policy.h" | 34 | #include "policy.h" |
| 35 | 35 | ||
| 36 | -#ifndef __BIONIC__ | 36 | -#ifndef __BIONIC__ |
| 37 | +/* Bionic and glibc >= 2.30 declare gettid() system call wrapper in unistd.h and | 37 | +/* Bionic and glibc >= 2.30 declare gettid() system call wrapper in unistd.h and |
| 38 | + * has a definition for it */ | 38 | + * has a definition for it */ |
| 39 | +#ifdef __BIONIC__ | 39 | +#if defined(__GLIBC_) |
| 40 | + #define OVERRIDE_GETTID 0 | 40 | +#if !__GLIBC_PREREQ(2,30) |
| 41 | +#elif !defined(__GLIBC_PREREQ) | ||
| 42 | + #define OVERRIDE_GETTID 1 | ||
| 43 | +#elif !__GLIBC_PREREQ(2,29) | ||
| 44 | + #define OVERRIDE_GETTID 1 | ||
| 45 | +#else | ||
| 46 | + #define OVERRIDE_GETTID 0 | ||
| 47 | +#endif | ||
| 48 | + | ||
| 49 | +#if OVERRIDE_GETTID | ||
| 50 | static pid_t gettid(void) | 41 | static pid_t gettid(void) |
| 51 | { | 42 | { |
| 52 | return syscall(__NR_gettid); | 43 | return syscall(__NR_gettid); |
| 44 | } | ||
| 45 | #endif | ||
| 46 | +#endif | ||
| 47 | |||
| 48 | static int getprocattrcon(char ** context, | ||
| 49 | pid_t pid, const char *attr) | ||
