Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 364152 Details for
Bug 489170
app-arch/tar-1.27.1[xattr]: Incorrect dependency / Needless usage of attr/xattr.h
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Use <sys/xattr.h> and link against libc OR use <attr/xattr.h> and link against libattr.so
tar-1.27.1-sys-attr.patch (text/plain), 4.35 KB, created by
Anthony Basile
on 2013-11-28 20:28:34 UTC
(
hide
)
Description:
Use <sys/xattr.h> and link against libc OR use <attr/xattr.h> and link against libattr.so
Filename:
MIME Type:
Creator:
Anthony Basile
Created:
2013-11-28 20:28:34 UTC
Size:
4.35 KB
patch
obsolete
>From: Anthony G. Basile <blueness@gentoo.org> > >The build system searches for <attr/xattr.h> and doesn't bother >looking to see if setxattr(), getxattr() and friends are provided >by the system libc. Worse, on successfully finding <attr/xattr.h> >it then proceeds to include it but then links against libc for >the *xattr() functions. > >This patch has the build system look for <sys/xattr.h> first and >if it success, links against libc. On failing to find <sys/xattr.h>, >it then search for <attr/xattr.h> and links against libattr.so. This >can happen, for instance, on a uClibc system where UCLIBC_HAS_XATTR >is not set, but libattr.so is present. Then the *xattr() functions >must be provided by libattr.so. > >X-Gentoo-Bug: 489170 >X-Gentoo-Bug-URL: https://bugs.gentoo.org/489170 > >diff --git a/acinclude.m4 b/acinclude.m4 >index d48c881..18cfd49 100644 >--- a/acinclude.m4 >+++ b/acinclude.m4 >@@ -37,18 +37,40 @@ AC_DEFUN([TAR_HEADERS_ATTR_XATTR_H], > [], [with_xattrs=maybe] > ) > >- AC_CHECK_HEADERS([attr/xattr.h]) >- AM_CONDITIONAL([TAR_COND_XATTR_H],[test "$ac_cv_header_attr_xattr_h" = yes]) >- if test "$ac_cv_header_attr_xattr_h" = yes; then >+ # First check for <sys/xattr.h> >+ AC_CHECK_HEADERS([sys/xattr.h]) >+ AM_CONDITIONAL([TAR_COND_XATTR_H],[test "$ac_cv_header_sys_xattr_h" = yes]) >+ AM_CONDITIONAL([TAR_LIB_ATTR],[false]) >+ if test "$ac_cv_header_sys_xattr_h" = yes; then > AC_CHECK_FUNCS(getxattr fgetxattr lgetxattr \ > setxattr fsetxattr lsetxattr \ > listxattr flistxattr llistxattr, > # only when functions are present >- AC_DEFINE([HAVE_ATTR_XATTR_H], [1], >- [define to 1 if we have <attr/xattr.h> header]) >+ AC_DEFINE([HAVE_SYS_XATTR_H], [1], >+ [define to 1 if we have <sys/xattr.h> header]) > if test "$with_xattrs" != no; then > AC_DEFINE([HAVE_XATTRS],,[Define when we have working linux xattrs.]) > fi > ) > fi >+ >+ # If <sys/xattr.h> is not found, then check for <attr/xattr.h> >+ if test "$ac_cv_header_sys_xattr_h" != yes; then >+ AC_CHECK_HEADERS([attr/xattr.h]) >+ AM_CONDITIONAL([TAR_COND_XATTR_H],[test "$ac_cv_header_attr_xattr_h" = yes]) >+ AC_CHECK_LIB([attr],[fgetxattr]) >+ AM_CONDITIONAL([TAR_LIB_ATTR],[test "$ac_cv_lib_attr_fgetxattr" = yes]) >+ if test "$ac_cv_header_attr_xattr_h" = yes; then >+ AC_CHECK_FUNCS(getxattr fgetxattr lgetxattr \ >+ setxattr fsetxattr lsetxattr \ >+ listxattr flistxattr llistxattr, >+ # only when functions are present >+ AC_DEFINE([HAVE_ATTR_XATTR_H], [1], >+ [define to 1 if we have <attr/xattr.h> header]) >+ if test "$with_xattrs" != no; then >+ AC_DEFINE([HAVE_XATTRS],,[Define when we have working linux xattrs.]) >+ fi >+ ) >+ fi >+ fi > ]) >diff --git a/config.h.in b/config.h.in >index 62023cf..c8d7c33 100644 >--- a/config.h.in >+++ b/config.h.in >@@ -973,6 +973,9 @@ > /* Define to 1 if you have the `lgetxattr' function. */ > #undef HAVE_LGETXATTR > >+/* Define to 1 if you have the `attr' library (-lattr). */ >+#undef HAVE_LIBATTR >+ > /* Define to 1 if you have the <libintl.h> header file. */ > #undef HAVE_LIBINTL_H > >@@ -1977,6 +1980,9 @@ > /* Define to 1 if you have the <sys/wait.h> header file. */ > #undef HAVE_SYS_WAIT_H > >+/* define to 1 if we have <sys/xattr.h> header */ >+#undef HAVE_SYS_XATTR_H >+ > /* Define if struct tm has the tm_gmtoff member. */ > #undef HAVE_TM_GMTOFF > >diff --git a/lib/xattr-at.h b/lib/xattr-at.h >index 2981771..1f517d0 100644 >--- a/lib/xattr-at.h >+++ b/lib/xattr-at.h >@@ -20,7 +20,15 @@ > #define XATTRS_AT_H > > #include <sys/types.h> >-#include <attr/xattr.h> >+#if defined(HAVE_SYS_XATTR_H) >+# include <sys/xattr.h> >+#elif defined(HAVE_ATTR_XATTR_H) >+# include <attr/xattr.h> >+#endif >+ >+#ifndef ENOATTR >+# define ENOATTR ENODATA /* No such attribute */ >+#endif > > /* These are the dir-fd-relative variants of the functions without the > "at" suffix. For example, setxattrat (AT_FDCWD, path, name, value, size, >diff --git a/src/Makefile.am b/src/Makefile.am >index 07c117d..d871256 100644 >--- a/src/Makefile.am >+++ b/src/Makefile.am >@@ -51,3 +51,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS) > LDADD = ../lib/libtar.a ../gnu/libgnu.a $(LIBINTL) $(LIBICONV) > > tar_LDADD = $(LIBS) $(LDADD) $(LIB_CLOCK_GETTIME) $(LIB_EACCESS) $(LIB_SELINUX) >+ >+if TAR_LIB_ATTR >+tar_LDADD += -lattr >+endif
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 489170
:
364152
|
364738