[fedfs-utils] [PATCH] Do not look for libattr. <sys/xattr.h> is enough

Cristian Rodríguez crrodriguez at opensuse.org
Mon Jun 23 15:38:34 PDT 2014


El lun 23 jun 2014 18:16:14 CLT, Chuck Lever escribió:
> Hi Cristian-
>
> On Jun 23, 2014, at 5:51 PM, Cristian Rodríguez <crrodriguez at opensuse.org> wrote:
>
>> libattr never gets used in the final build as xattr functions
>> are provided by libc.
>
> Is this true for all versions of glibc? My copy of glibc 2.7 shows
> its copy of the *xattr functions are just stubs, for example.

huh ? glibc binary interface provides this functions as version 2.3..

>
>> This commit avoids requiring an used library during package build.
>
> I assume you mean “an unused library” here.

Yes.

>
> Unfortunately the patch description for commit f5c16606beca0 is not
> clear why I added this check a year ago. But I seem to recall that
> one of the RH-based systems I worked on (EL6, perhaps) had an issue
> when libattr and headers were missing in the mockbuild.
>
> Fedora packaging has a BuildRequires libattr-devel. I’m not sure it
> is universally safe to simply rip this out. Some testing is required,
> and maybe something that has a more precise configure.ac test would
> work better for both legacy and newer systems?

That does not mean anything..one rule on distribution packages you need 
to understand first is that buildrequires are added but rarely if ever 
removed
unless someone takes the time to clean-up the house from time to time.. 
or for some reason the build breaks and someone realizes it is 
superfluous, this is however seldom happens.

Of course the package build will have libattr-devel as a build 
dependency, since this code include <attr/xattr.h> and will fail 
without it.. however...the code is not even linking the attr library so 
it will never get used.

AC_CHECK_LIB([attr], [fgetxattr],
              [AC_SUBST([LIBATTR], ["-lattr"])
                AC_DEFINE([HAVE_LIBATTR], [1],
                          [Define if you have libattr])],
               [AC_MSG_ERROR([libattr not found.])])

Does not add -lattr to $LIBS and the variable LIBATTR is never 
referenced anywhere in the makefiles.. the build succeeds because 
libattr duplicates libc functionality....



--
Cristian
"I don't know the key to success, but the key to failure is trying to 
please everybody."



More information about the fedfs-utils-devel mailing list