fakeroot: fix build when libcap-dev is installed
PATCH 1/1 fakeroot: fix build when libcap-dev is installed
On an Ubuntu host, and probably several other build hosts, host-fakeroot fails building when libcap-dev is installed.
Error message:
libfakeroot.c:1646:9: error: conflicting types for 'setxattr'
ssize_t setxattr(const char *path, const char *name, void *value, size_t size, int flags)
^
In file included from /usr/include/sys/capability.h:30:0,
from libfakeroot.c:131:
/usr/include/x86_64-linux-gnu/sys/xattr.h:39:12: note: previous declaration of 'setxattr' was here
extern int setxattr (const char *__path, const char *__name,
^To reproduce the bug:
make defconfig && make host-fakeroot
This is a fakeroot bug fixed in Debian since 1.20.1-1 [0]. Apply the patch [1] to Buildroot as well.
Buildroot bug reported by aborniak [2] on Ubuntu 15.04 x86_64. Verified on Ubuntu 14.04 x86_64.
[0] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=758406
[1] https://sources.debian.net/patches/patch/fakeroot/1.20.2-1/glibc-xattr-types/
[2] https://bugs.busybox.net/show_bug.cgi?id=8541
--- .../fakeroot/0001-Fix-xattr-type-mismatch.patch | 108 +++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 package/fakeroot/0001-Fix-xattr-type-mismatch.patch
package/fakeroot/0001-Fix-xattr-type-mismatch.patch new file +108 -0
@@ -0,0 +1,108 @@ +Fix the type of xattr functions to match the glibc headers. + +--- a/libfakeroot.c ++++ b/libfakeroot.c +@@ -1570,7 +1570,7 @@ + #endif /* HAVE_CAPSET */ + + #if defined(HAVE_SETXATTR) || defined(HAVE_LSETXATTR) || defined(HAVE_FSETXATTR) +-static size_t common_setxattr(INT_STRUCT_STAT *st, const char *name, void * value, size_t size, int flags) ++static int common_setxattr(INT_STRUCT_STAT *st, const char *name, const void * value, size_t size, int flags) + { + xattr_args xattr; + xattr.name = name; +@@ -1625,7 +1625,7 @@ + #endif /* defined(HAVE_LISTXATTR) || defined(HAVE_LLISTXATTR) || defined(HAVE_FLISTXATTR) */ + + #if defined(HAVE_REMOVEXATTR) || defined(HAVE_LREMOVEXATTR) || defined(HAVE_FREMOVEXATTR) +-static size_t common_removexattr(INT_STRUCT_STAT *st, const char *name) ++static int common_removexattr(INT_STRUCT_STAT *st, const char *name) + { + xattr_args xattr; + xattr.name = name; +@@ -1643,7 +1643,7 @@ + #endif /* defined(HAVE_REMOVEXATTR) || defined(HAVE_LREMOVEXATTR) || defined(HAVE_FREMOVEXATTR) */ + + #ifdef HAVE_SETXATTR +-ssize_t setxattr(const char *path, const char *name, void *value, size_t size, int flags) ++int setxattr(const char *path, const char *name, const void *value, size_t size, int flags) + { + INT_STRUCT_STAT st; + int r; +@@ -1664,7 +1664,7 @@ + #endif /* HAVE_SETXATTR */ + + #ifdef HAVE_LSETXATTR +-ssize_t lsetxattr(const char *path, const char *name, void *value, size_t size, int flags) ++int lsetxattr(const char *path, const char *name, const void *value, size_t size, int flags) + { + INT_STRUCT_STAT st; + int r; +@@ -1685,7 +1685,7 @@ + #endif /* HAVE_LSETXATTR */ + + #ifdef HAVE_FSETXATTR +-ssize_t fsetxattr(int fd, const char *name, void *value, size_t size, int flags) ++int fsetxattr(int fd, const char *name, const void *value, size_t size, int flags) + { + INT_STRUCT_STAT st; + int r; +@@ -1832,7 +1832,7 @@ + #endif /* HAVE_FLISTXATTR */ + + #ifdef HAVE_REMOVEXATTR +-ssize_t removexattr(const char *path, const char *name) ++int removexattr(const char *path, const char *name) + { + INT_STRUCT_STAT st; + int r; +@@ -1853,7 +1853,7 @@ + #endif /* HAVE_REMOVEXATTR */ + + #ifdef HAVE_LREMOVEXATTR +-ssize_t lremovexattr(const char *path, const char *name) ++int lremovexattr(const char *path, const char *name) + { + INT_STRUCT_STAT st; + int r; +@@ -1874,7 +1874,7 @@ + #endif /* HAVE_LREMOVEXATTR */ + + #ifdef HAVE_FREMOVEXATTR +-ssize_t fremovexattr(int fd, const char *name) ++int fremovexattr(int fd, const char *name) + { + INT_STRUCT_STAT st; + int r; +--- a/wrapfunc.inp ++++ b/wrapfunc.inp +@@ -168,22 +168,22 @@ + fgetxattr;ssize_t;(int fd, const char *name, void *value, size_t size);(fd, name, value, size) + #endif /* HAVE_FGETXATTR */ + #ifdef HAVE_SETXATTR +-setxattr;ssize_t;(const char *path, const char *name, void *value, size_t size, int flags);(path, name, value, size, flags) ++setxattr;int;(const char *path, const char *name, const void *value, size_t size, int flags);(path, name, value, size, flags) + #endif /* HAVE_SETXATTR */ + #ifdef HAVE_LSETXATTR +-lsetxattr;ssize_t;(const char *path, const char *name, void *value, size_t size, int flags);(path, name, value, size, flags) ++lsetxattr;int;(const char *path, const char *name, const void *value, size_t size, int flags);(path, name, value, size, flags) + #endif /* HAVE_LSETXATTR */ + #ifdef HAVE_FSETXATTR +-fsetxattr;ssize_t;(int fd, const char *name, void *value, size_t size, int flags);(fd, name, value, size, flags) ++fsetxattr;int;(int fd, const char *name, const void *value, size_t size, int flags);(fd, name, value, size, flags) + #endif /* HAVE_FSETXATTR */ + #ifdef HAVE_REMOVEXATTR +-removexattr;ssize_t;(const char *path, const char *name);(path, name) ++removexattr;int;(const char *path, const char *name);(path, name) + #endif /* HAVE_REMOVEXATTR */ + #ifdef HAVE_LREMOVEXATTR +-lremovexattr;ssize_t;(const char *path, const char *name);(path, name) ++lremovexattr;int;(const char *path, const char *name);(path, name) + #endif /* HAVE_LREMOVEXATTR */ + #ifdef HAVE_FREMOVEXATTR +-fremovexattr;ssize_t;(int fd, const char *name);(fd, name) ++fremovexattr;int;(int fd, const char *name);(fd, name) + #endif /* HAVE_FREMOVEXATTR */ + + #ifdef HAVE_FSTATAT +
Signature · 1 line
1.9.1
PATCH 1/1 fakeroot: fix build when libcap-dev is installed
Hi Luca,
Quoted 14 lines · Luca Ceresoli
On an Ubuntu host, and probably several other build hosts, host-fakeroot fails building when libcap-dev is installed.
Error message:
libfakeroot.c:1646:9: error: conflicting types for 'setxattr'
ssize_tsetxattr(const char *path, const char *name, void *value, size_t size, int flags)^ In file included from /usr/include/sys/capability.h:30:0, from libfakeroot.c:131: /usr/include/x86_64-linux-gnu/sys/xattr.h:39:12: note: previous declaration of 'setxattr' was here extern int setxattr (const char *__path, const char *__name, ^
Quoted 6 lines
To reproduce the bug:
make defconfig && make host-fakerootThis is a fakeroot bug fixed in Debian since 1.20.1-1 [0]. Apply the patch [1] to Buildroot as well.
Are we sure this will not break again on other distros or older Debian/Ubuntu?
Quoted 24 lines
Buildroot bug reported by aborniak [2] on Ubuntu 15.04
x86_64. Verified on Ubuntu 14.04x86_64.[0] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=758406
[1] https://sources.debian.net/patches/patch/fakeroot/1.20.2-1/glibc-xattr-types/
[2] https://bugs.busybox.net/show_bug.cgi?id=8541Reported-by aborniak <[email protected]>Cc aborniak <[email protected]>Cc Vicente Olivert Riera <[email protected]>Cc Thomas Petazzoni <[email protected]>Signed-off-by Luca Ceresoli <[email protected]>--- .../fakeroot/0001-Fix-xattr-type-mismatch.patch | 108 +++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 package/fakeroot/0001-Fix-xattr-type-mismatch.patchpackage/fakeroot/0001-Fix-xattr-type-mismatch.patch new file +0
-0
package/fakeroot/0001-Fix-xattr-type-mismatch.patch line 1
Quoted 1 line
package/fakeroot/0001-Fix-xattr-type-mismatch.patch new file +1
-0@@ -0,0 +1,108 @@ +Fix the type of xattr functions to match the glibc headers.
You should refer to the upstream patch here as well. Ideally also
mention the author but that is hard to find.
But AFAICS it is identical to upstream, so why not
FAKEROOT_PATCHES = \ http://sources.debian.net/data/main/f/fakeroot/1.20.2-1/debian/patches/glibc-xattr-types
?
(I'm not 100% sure, but I believe that sources.debian.net should be as stable as snapshot.debian.org).
Regards,
Arnout
[snip]
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
PATCH 1/1 fakeroot: fix build when libcap-dev is installed
Quoted 17 lines · Arnout Vandecappelle
Hi Luca,
Quoted 14 lines · Luca Ceresoli
On an Ubuntu host, and probably several other build hosts, host-fakeroot fails building when libcap-dev is installed.
Error message:
libfakeroot.c:1646:9: error: conflicting types for 'setxattr'
ssize_tsetxattr(const char *path, const char *name, void *value, size_t size, int flags)^ In file included from /usr/include/sys/capability.h:30:0, from libfakeroot.c:131: /usr/include/x86_64-linux-gnu/sys/xattr.h:39:12: note: previous declaration of 'setxattr' was here extern int setxattr (const char *__path, const char *__name, ^
Quoted 8 lines
Quoted 6 lines
To reproduce the bug:
make defconfig && make host-fakerootThis is a fakeroot bug fixed in Debian since 1.20.1-1 [0]. Apply the patch [1] to Buildroot as well.
Are we sure this will not break again on other distros or older Debian/Ubuntu?
I prefer Ricardo's alternative.
We will have to pay attention however, if upstream (i.e. Debian?) releases a
new version, that we _don't_ take this patch along. Although I'm not sure if the upstream patch really breaks the build on older systems, I haven't checked when xattr.h has changed.
Regards,
Arnout
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
PATCH 1/1 fakeroot: fix build when libcap-dev is installed
Hi Arnout,
Quoted 18 lines · Arnout Vandecappelle
Quoted 17 lines · Arnout Vandecappelle
Hi Luca,
Quoted 14 lines · Luca Ceresoli
On an Ubuntu host, and probably several other build hosts, host-fakeroot fails building when libcap-dev is installed.
Error message:
libfakeroot.c:1646:9: error: conflicting types for 'setxattr'
ssize_tsetxattr(const char *path, const char *name, void *value, size_t size, int flags)
^
In file included from/usr/include/sys/capability.h:30:0,from libfakeroot.c:131:
/usr/include/x86_64-linux-gnu/sys/xattr.h:39:12: note: previous declaration of 'setxattr' was here
extern int setxattr (const char*__path, const char*__name,
^
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
To reproduce the bug:
make defconfig && make host-fakerootThis is a fakeroot bug fixed in Debian since 1.20.1-1 [0]. Apply the patch [1] to Buildroot as well.
Are we sure this will not break again on other distros or older Debian/Ubuntu?
Not sure, but xattr.h should not have changed recently. However...
Quoted 2 lines
I prefer Ricardo's alternative.
...I do prefer Ricardo's patch as well. Thanks, Ricardo. And since it has already been committed, this discussion is now pointless.
I marked this patch as Superseded in patchwork.
Signature · 1 line
Luca