Bug 483548

Summary: <sys/capability.h> is a complete disaster of a header
Product: [Fedora] Fedora Reporter: Kamil Dudka <kdudka>
Component: libcapAssignee: Karsten Hopp <karsten>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: high    
Version: rawhideCC: karsten, kernel-maint, kmcmartin, mlichvar, ovasik, quentin, quintela, suckfish
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-03-22 17:15:34 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Kamil Dudka 2009-02-02 11:48:50 UTC
Description of problem:
In file included from /usr/include/bits/sigcontext.h:28,
                 from /usr/include/signal.h:333,
                 from ../lib/signal.h:32,
                 from ls.c:66:
/usr/include/asm/sigcontext.h:28: error: expected specifier-qualifier-list before '__u64'
/usr/include/asm/sigcontext.h:191: error: expected specifier-qualifier-list before '__u64'

Version-Release number of selected component (if applicable):
kernel-headers-2.6.29-0.74.rc3.git3.fc11

Actual results:
http://koji.fedoraproject.org/koji/getfile?taskID=1098835&name=build.log

Expected results:
http://kojipkgs.fedoraproject.org/packages/coreutils/7.0/7.fc11/data/logs/i386/build.log

Additional info:
works with kernel-headers-2.6.29-0.53.rc2.git1.fc11

Comment 1 Quentin Armitage 2009-02-04 14:58:09 UTC
The problem is introduced at rc3.git3 (i.e. rc3.git2 does not exhibit the problem).

The problem is caused by the following change:
--- 73/usr/include/asm/sigcontext.h	2009-01-31 02:40:27.000000000 +0000
+++ 74/usr/include/asm/sigcontext.h	2009-02-01 01:56:00.000000000 +0000
@@ -2,7 +2,7 @@
 #define _ASM_X86_SIGCONTEXT_H
 
 
-#include <asm/types.h>
+#include <linux/types.h>
 
 #define FP_XSTATE_MAGIC1	0x46505853U
 #define FP_XSTATE_MAGIC2	0x46505845U

which is referenced in the changelog as:
commit e59afe6a21dce7bb3c63ba4f894a3195ae3d5529
Author: Jaswinder Singh Rajput <jaswinderrajput>
Date:   Fri Jan 30 22:53:49 2009 +0530

    headers_check fix: x86, sigcontext.h
    
    fix the following 'make headers_check' warnings:
    
      usr/include/asm/sigcontext.h:5: include of <linux/types.h> is preferred over <asm/types.h>
      usr/include/asm/sigcontext.h:24: found __[us]{8,16,32,64} type without #include <linux/types.h>
    
    Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput>

Comment 2 Ondrej Vasik 2009-02-24 17:00:22 UTC
Raising priority to high - this bug/regression still blocks coreutils builds in rawhide.

Comment 3 Kyle McMartin 2009-02-24 23:43:00 UTC
This is almost certainly a bug in the games coreutils is playing with signal.h, I'm looking at the preprocessed source (gcc -E) now, and __u64 isn't getting included. Why? I'm guessing because a header guard is duplicated.

Comment 4 Kyle McMartin 2009-02-25 00:08:15 UTC
Nope, bug in libcap-devel, which is just stupendously horrendously broken. It's defining header guards when it shouldn't be, which prevents the correct _LINUX_TYPES_H_ from being included.

In the meantime, coreutils can likely be fixed by moving the <sys/capability.h> include further down, or explicitly including <linux/types.h> early.

http://kyle.fedoraproject.org/libcap-sanitized-for-userspace.diff

Comment 5 Kyle McMartin 2009-02-25 00:23:00 UTC
Sorry, meant http://kyle.fedorapeople.org/libcap-sanitized-for-userspace.diff

Comment 6 Miroslav Lichvar 2009-02-27 10:41:24 UTC
This bug prevents also chrony package to build. Reversing the order of the signal.h and capability.h includes helps, but still would be nice to have this fixed properly.

Comment 7 Karsten Hopp 2009-03-22 17:15:34 UTC
please try again with libcap-2.16-2.fc11 and reopen if the problem still exists.
I was able to build the latest chrony vom cvs without the -cap patch.

Comment 8 Ralph Loader 2009-04-12 02:36:51 UTC
Still breaks for me trying to compile VirtualBox, or a small test program.  [I don't seem to have perms to re-open the bug, could someone else do it?]


$ cat temp.c
#include <sys/capability.h>

$ gcc -c temp.c
In file included from /usr/include/sys/capability.h:23,
                 from temp.c:1:
/usr/include/stdint.h:41: error: conflicting types for ‘int64_t’
/usr/include/linux/types.h:98: note: previous declaration of ‘int64_t’ was here
/usr/include/stdint.h:56: error: conflicting types for ‘uint64_t’
/usr/include/linux/types.h:96: note: previous declaration of ‘uint64_t’ was here

Comment 9 Ralph Loader 2009-04-12 02:48:34 UTC
Looks like: (a) including linux/types.h then stdint.h is broken (kernel-headers / glibc problem).
(b) unistd.h or similar is needed for ssize_t