From 945f484ae62dfc4180cfc43ba01d5ec1fc78fc0b Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Sat, 27 Aug 2022 21:39:25 -0400 Subject: [PATCH] libselinux: fix build on musl --- srcpkgs/libselinux/patches/musl.patch | 30 +++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 srcpkgs/libselinux/patches/musl.patch diff --git a/srcpkgs/libselinux/patches/musl.patch b/srcpkgs/libselinux/patches/musl.patch new file mode 100644 index 00000000000..d4199f40610 --- /dev/null +++ b/srcpkgs/libselinux/patches/musl.patch @@ -0,0 +1,30 @@ +musl defines gettid(), current glibc is >2.30 + +--- a/src/procattr.c ++++ b/src/procattr.c +@@ -22,25 +22,6 @@ + static int destructor_key_initialized = 0; + static __thread char destructor_initialized; + +-/* 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,30) +- #define OVERRIDE_GETTID 1 +-#else +- #define OVERRIDE_GETTID 0 +-#endif +- +-#if OVERRIDE_GETTID +-static pid_t gettid(void) +-{ +- return syscall(__NR_gettid); +-} +-#endif +- + static void procattr_thread_destructor(void __attribute__((unused)) *unused) + { + if (prev_current != UNSET)