Bug 1685594 - libselinux: FTBFS in Fedora rawhide
Summary: libselinux: FTBFS in Fedora rawhide
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: libselinux
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Petr Lautrbach
QA Contact: Fedora Extras Quality Assurance
URL: http://apps.fedoraproject.org/koschei...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-03-05 15:20 UTC by Jitka Plesnikova
Modified: 2019-03-18 12:50 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-03-18 12:50:48 UTC
Type: Bug


Attachments (Terms of Use)

Description Jitka Plesnikova 2019-03-05 15:20:19 UTC
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

Comment 1 Petr Lautrbach 2019-03-08 13:02:58 UTC
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 ?

Comment 2 Florian Weimer 2019-03-08 13:26:32 UTC
Just call your implementation something else, not gettid.  Then you won't need any preprocessor check at all.

Does this answer your question?  Thanks.

Comment 3 Petr Lautrbach 2019-03-08 13:59:22 UTC
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?

Comment 4 Florian Weimer 2019-03-08 14:17:44 UTC
There is no reason to call this function in libselinux “gettid”.  If you use any other name, the name conflict goes away.

Comment 5 Petr Lautrbach 2019-03-08 15:33:09 UTC
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


Note You need to log in before you can comment on or make changes to this bug.