diff --git a/libselinux-fedora.patch b/libselinux-fedora.patch index c87da41..ffd6458 100644 --- a/libselinux-fedora.patch +++ b/libselinux-fedora.patch @@ -184,6 +184,34 @@ index 1d3b28a..ea6d70b 100644 if (rc < 0 && errno == ENOTSUP) { char * ccontext = NULL; int err = errno; +diff --git libselinux-2.9-rc2/src/procattr.c libselinux-2.9-rc2/src/procattr.c +index 48dd8af..cbb6824 100644 +--- libselinux-2.9-rc2/src/procattr.c ++++ libselinux-2.9-rc2/src/procattr.c +@@ -22,8 +22,21 @@ static pthread_key_t destructor_key; + static int destructor_key_initialized = 0; + static __thread char destructor_initialized; + +-#ifndef __BIONIC__ +-/* Bionic declares this in unistd.h and has a definition for it */ ++/* Bionic and glibc >= 2.30 declare gettid() system call wrapper in unistd.h and ++ * has a definition for it */ ++#ifndef OVERRIDE_GETTID ++#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 ++#endif ++ ++#if OVERRIDE_GETTID + static pid_t gettid(void) + { + return syscall(__NR_gettid); diff --git libselinux-2.9-rc2/src/setfilecon.c libselinux-2.9-rc2/src/setfilecon.c index d05969c..3f0200e 100644 --- libselinux-2.9-rc2/src/setfilecon.c diff --git a/libselinux.spec b/libselinux.spec index a0363ae..17ab5ce 100644 --- a/libselinux.spec +++ b/libselinux.spec @@ -14,7 +14,7 @@ Url: https://github.com/SELinuxProject/selinux/wiki # download https://raw.githubusercontent.com/fedora-selinux/scripts/master/selinux/make-fedora-selinux-patch.sh # run: # $ VERSION=2.9-rc2 ./make-fedora-selinux-patch.sh libselinux -# HEAD https://github.com/fedora-selinux/selinux/commit/6bd6bf8f31effadb9ee8bfec701afdf9a7e9ea3b +# HEAD https://github.com/fedora-selinux/selinux/commit/cb42e1bf324698875492f6f8f7adf9c5f7778aab Patch1: libselinux-fedora.patch BuildRequires: gcc BuildRequires: python2 python2-devel ruby-devel ruby libsepol-static >= %{libsepolver} swig pcre2-devel xz-devel @@ -106,6 +106,8 @@ export USE_PCRE2="y" %set_build_flags +export CFLAGS="$CFLAGS -DOVERRIDE_GETTID=0" + # To support building the Python wrapper against multiple Python runtimes # Define a function, for how to perform a "build" of the python wrapper against # a specific runtime: