sys-libs/libcap-2.15 (2.16) fails to build with kernel headers from 2.6.29 (manually installed): gcc -O2 -Dlinux -fPIC -Wall -Wwrite-strings -Wpointer-arith -Wcast-qual -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wshadow -g -I/home/johan/src/external/libcap/libcap-2.15/progs/../libcap/include -I/home/johan/src/external/libcap/libcap-2.15/progs/../libcap/include -c capsh.c -o capsh.o In file included from /usr/include/bits/sigcontext.h:28, from /usr/include/signal.h:333, from /usr/include/sys/wait.h:31, from capsh.c:19: /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' Reproducible: Always Probably due to the following change: commit e59afe6a21dce7bb3c63ba4f894a3195ae3d5529 Author: Jaswinder Singh Rajput <jaswinderrajput@gmail.com> 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@gmail.com> diff --git a/arch/x86/include/asm/sigcontext.h b/arch/x86/include/asm/sigcontext.h index 0afcb5e..ec66649 100644 --- a/arch/x86/include/asm/sigcontext.h +++ b/arch/x86/include/asm/sigcontext.h @@ -2,7 +2,7 @@ #define _ASM_X86_SIGCONTEXT_H #include <linux/compiler.h> -#include <asm/types.h> +#include <linux/types.h> #define FP_XSTATE_MAGIC1 0x46505853U #define FP_XSTATE_MAGIC2 0x46505845U
Created attachment 187580 [details, diff] include capability.h after wait.h The attached patch makes libcap compile with 2.6.29 headers by including capability.h after wait.h.
We only support the headers included with the package linux-headers, sorry.
Ok, but this is likely to break once linux-headers hits 2.6.29...
For future reference: Simply including sys/capability.h before sys/wait.h (and likely other system headers) results in In file included from /usr/include/bits/sigcontext.h:28, from /usr/include/signal.h:333, from /usr/include/sys/wait.h:31, from capsh.c:19: /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' In particular, this is not specific to the capsh application, but rather an issue with capability.h triggered by commit e59afe6a21dce7bb3c63ba4f894a3195ae3d5529. I'm attaching a patch which removes the no longer needed user-space include guard defines from capability.h.
Created attachment 187677 [details, diff] Remove include-guard defines from capability.h Remove the no longer needed include-guard defines from capability.h (the kernel headers have been sanitized in 2.6.29).
usefull for me, thanx
not sure why this is INVALID
*** Bug 269848 has been marked as a duplicate of this bug. ***
http://bugs.gentoo.org/attachment.cgi?id=191326 tihs patch works for me with with GCC 4.3.3 and Linux headers 2.6.29 and libcap 2.16.
dropped the workarounds in 2.16-r1 http://sources.gentoo.org/sys-libs/libcap/files/libcap-2.16-drop-linux-workarounds.patch?rev=1.1