Description of problem: Package libselinux fails to build from source in Fedora rawhide. BUILDSTDERR: procattr.c:27:14: error: static declaration of 'gettid' follows non-static declaration BUILDSTDERR: 27 | static pid_t gettid(void) BUILDSTDERR: | ^~~~~~ BUILDSTDERR: In file included from /usr/include/unistd.h:1170, BUILDSTDERR: from procattr.c:2: BUILDSTDERR: /usr/include/bits/unistd_ext.h:34:16: note: previous declaration of 'gettid' was here BUILDSTDERR: 34 | extern __pid_t gettid (void) __THROW; BUILDSTDERR: | ^~~~~~ BUILDSTDERR: make[1]: *** [Makefile:171: procattr.o] Error 1 BUILDSTDERR: make[1]: *** Waiting for unfinished jobs.... make[1]: Leaving directory '/builddir/build/BUILD/libselinux-2.9-rc1/src' BUILDSTDERR: make: *** [Makefile:44: all] Error 1 Steps to Reproduce: koji build --scratch f31 libselinux-2.9-0.rc1.1.fc30.1.src.rpm Additional info: This package is tracked by Koschei. See: http://apps.fedoraproject.org/koschei/package/libselinux Dependency changes from last successful build can be found here: https://apps.fedoraproject.org/koschei/build/6164337
glibc-2.29.9000-1 added gettid system call wrapper (swbz#6399) which is supposed to be in glibc-2.30. I'd use __GLIBC_PREREQ(2,30) but features.h still defines #define __GLIBC__ 2 #define __GLIBC_MINOR__ 29 How can I fix it now? Do I need to wait for glibc-2.30 ?
Just call your implementation something else, not gettid. Then you won't need any preprocessor check at all. Does this answer your question? Thanks.
I'm not sure. There's an upstrem code: https://github.com/SELinuxProject/selinux/blob/5e33a44c666b966de50121b2e93198d6da65d696/libselinux/src/procattr.c#L25 It works with glibc < 2.29.9000-1. It could work with 2.30 with a correct usage of __GLIBC_PREREQ(2,30). But now we have 2.29 with gettid() wrapper. Do I get it right that you suggest to use something else than gettid() syscall, resp the new gettid() glibc wrapper?
There is no reason to call this function in libselinux “gettid”. If you use any other name, the name conflict goes away.
Given that the shared library is already built with "gettid@@GLIBC_2.30" could be possibly glibc version updated to something like glibc-2.30-0.X [1] with "__GLIBC_MINOR__ 30"? [1] https://docs.fedoraproject.org/en-US/packaging-guidelines/Versioning/#_prerelease_versions
https://src.fedoraproject.org/rpms/libselinux/c/f3c6251fc2100c809b1f7db0482881d3ddcd1228?branch=master