diff mbox

build: fix possibly undefined macro: AC_PACKAGE_NEED_GETXATTR_LIBATTR

Message ID 20180702070001.1973-1-lufq.fnst@cn.fujitsu.com (mailing list archive)
State New, archived
Headers show

Commit Message

Lu Fengqi July 2, 2018, 7 a.m. UTC
Because the macro AC_PACKAGE_NEED_GETXATTR_LIBATTR was removed by
the following commit specified by fixes tag, we also need remove
AC_PACKAGE_NEED_GETXATTR_LIBATTR from configure.ac.

In addition, the libattr will not be set, after the macro was be
removed. This cause gcc can't link the libattr for fsstress correctly.
The macro AC_PACKAGE_NEED_ATTRGET_LIBATTR has been obsoleted, so change
it to AC_PACKAGE_NEED_ATTRSET_LIBATTR and add it to configure.ac. It can
help me check libattr and set libattr variable.

Fixes: 42b851446ff1 ("build: remove <attr/xattr.h> check")
Reported-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com>
---
Hi, Eryu

I apologize for the previous patch about the build infrastructure that
caused the master branch to not be compiled.

Spoiler:
Regarding the following deprecated functions, I want to replace them
with the glibc version. And, I will carefully confirm the correctness
before send patches. Any suggestions?

fsstress.c:762:2: warning: 'attr_list' is deprecated: Use listxattr or
llistxattr instead [-Wdeprecated-declarations]
fsstress.c:781:2: warning: 'attr_remove' is deprecated: Use removexattr
or lremovexattr instead [-Wdeprecated-declarations]
fsstress.c:801:2: warning: 'attr_set' is deprecated: Use setxattr or
lsetxattr instead [-Wdeprecated-declarations]

 configure.ac          | 2 +-
 m4/package_attrdev.m4 | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

Comments

Eryu Guan July 2, 2018, 8:18 a.m. UTC | #1
On Mon, Jul 02, 2018 at 03:00:01PM +0800, Lu Fengqi wrote:
> Because the macro AC_PACKAGE_NEED_GETXATTR_LIBATTR was removed by
> the following commit specified by fixes tag, we also need remove
> AC_PACKAGE_NEED_GETXATTR_LIBATTR from configure.ac.
> 
> In addition, the libattr will not be set, after the macro was be
> removed. This cause gcc can't link the libattr for fsstress correctly.
> The macro AC_PACKAGE_NEED_ATTRGET_LIBATTR has been obsoleted, so change
> it to AC_PACKAGE_NEED_ATTRSET_LIBATTR and add it to configure.ac. It can
> help me check libattr and set libattr variable.
> 
> Fixes: 42b851446ff1 ("build: remove <attr/xattr.h> check")
> Reported-by: Zorro Lang <zlang@redhat.com>
> Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com>
> ---
> Hi, Eryu
> 
> I apologize for the previous patch about the build infrastructure that
> caused the master branch to not be compiled.

That's my fault, I didn't test the latest patch but a stale one, your
original patch worked fine. Sorry about that!

> 
> Spoiler:
> Regarding the following deprecated functions, I want to replace them
> with the glibc version. And, I will carefully confirm the correctness
> before send patches. Any suggestions?
> 
> fsstress.c:762:2: warning: 'attr_list' is deprecated: Use listxattr or
> llistxattr instead [-Wdeprecated-declarations]
> fsstress.c:781:2: warning: 'attr_remove' is deprecated: Use removexattr
> or lremovexattr instead [-Wdeprecated-declarations]
> fsstress.c:801:2: warning: 'attr_set' is deprecated: Use setxattr or
> lsetxattr instead [-Wdeprecated-declarations]

IMHO, replacing the deprecated attr functions looks fine to me. But I'm
not sure if there's any historical reason behind this.

> 
>  configure.ac          | 2 +-
>  m4/package_attrdev.m4 | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 63ea032dc564..aede4f59a060 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -53,7 +53,7 @@ AC_PACKAGE_NEED_XFS_HANDLE_H
>  AC_PACKAGE_NEED_ATTRLIST_LIBHANDLE
>  AC_PACKAGE_NEED_ATTRIBUTES_H
>  AC_PACKAGE_WANT_ATTRLIST_LIBATTR
> -AC_PACKAGE_NEED_GETXATTR_LIBATTR
> +AC_PACKAGE_NEED_ATTRSET_LIBATTR
>  
>  AC_PACKAGE_NEED_SYS_ACL_H
>  AC_PACKAGE_NEED_ACL_LIBACL_H
> diff --git a/m4/package_attrdev.m4 b/m4/package_attrdev.m4
> index 9a82f241de3a..d994cfc23c25 100644
> --- a/m4/package_attrdev.m4
> +++ b/m4/package_attrdev.m4
> @@ -26,8 +26,8 @@ AC_DEFUN([AC_PACKAGE_WANT_ATTRLIST_LIBATTR],
>      AC_SUBST(have_attr_list)
>    ])
>  
> -AC_DEFUN([AC_PACKAGE_NEED_ATTRGET_LIBATTR],
> -  [ AC_CHECK_LIB(attr, attr_get,, [
> +AC_DEFUN([AC_PACKAGE_NEED_ATTRSET_LIBATTR],
> +  [ AC_CHECK_LIB(attr, attr_set,, [

Looks fine to me as a hotfix. Thanks!

Eryu

>          echo
>          echo 'FATAL ERROR: could not find a valid Extended Attributes library.'
>          echo 'Install the extended attributes (attr) development package.'
> -- 
> 2.18.0
> 
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Darrick J. Wong July 3, 2018, 10:20 p.m. UTC | #2
On Mon, Jul 02, 2018 at 03:00:01PM +0800, Lu Fengqi wrote:
> Because the macro AC_PACKAGE_NEED_GETXATTR_LIBATTR was removed by
> the following commit specified by fixes tag, we also need remove
> AC_PACKAGE_NEED_GETXATTR_LIBATTR from configure.ac.
> 
> In addition, the libattr will not be set, after the macro was be
> removed. This cause gcc can't link the libattr for fsstress correctly.
> The macro AC_PACKAGE_NEED_ATTRGET_LIBATTR has been obsoleted, so change
> it to AC_PACKAGE_NEED_ATTRSET_LIBATTR and add it to configure.ac. It can
> help me check libattr and set libattr variable.
> 
> Fixes: 42b851446ff1 ("build: remove <attr/xattr.h> check")
> Reported-by: Zorro Lang <zlang@redhat.com>
> Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com>
> ---
> Hi, Eryu
> 
> I apologize for the previous patch about the build infrastructure that
> caused the master branch to not be compiled.
> 
> Spoiler:
> Regarding the following deprecated functions, I want to replace them
> with the glibc version. And, I will carefully confirm the correctness
> before send patches. Any suggestions?
> 
> fsstress.c:762:2: warning: 'attr_list' is deprecated: Use listxattr or
> llistxattr instead [-Wdeprecated-declarations]
> fsstress.c:781:2: warning: 'attr_remove' is deprecated: Use removexattr
> or lremovexattr instead [-Wdeprecated-declarations]
> fsstress.c:801:2: warning: 'attr_set' is deprecated: Use setxattr or
> lsetxattr instead [-Wdeprecated-declarations]

/me has no idea about this but his Ubuntu 18.04 build of xfstest master
failed with:

gcc: error: libattr@: No such file or directory

This fixes it, so I guess
Tested-by: Darrick J. Wong <darrick.wong@oracle.com>

--D


> 
>  configure.ac          | 2 +-
>  m4/package_attrdev.m4 | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 63ea032dc564..aede4f59a060 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -53,7 +53,7 @@ AC_PACKAGE_NEED_XFS_HANDLE_H
>  AC_PACKAGE_NEED_ATTRLIST_LIBHANDLE
>  AC_PACKAGE_NEED_ATTRIBUTES_H
>  AC_PACKAGE_WANT_ATTRLIST_LIBATTR
> -AC_PACKAGE_NEED_GETXATTR_LIBATTR
> +AC_PACKAGE_NEED_ATTRSET_LIBATTR
>  
>  AC_PACKAGE_NEED_SYS_ACL_H
>  AC_PACKAGE_NEED_ACL_LIBACL_H
> diff --git a/m4/package_attrdev.m4 b/m4/package_attrdev.m4
> index 9a82f241de3a..d994cfc23c25 100644
> --- a/m4/package_attrdev.m4
> +++ b/m4/package_attrdev.m4
> @@ -26,8 +26,8 @@ AC_DEFUN([AC_PACKAGE_WANT_ATTRLIST_LIBATTR],
>      AC_SUBST(have_attr_list)
>    ])
>  
> -AC_DEFUN([AC_PACKAGE_NEED_ATTRGET_LIBATTR],
> -  [ AC_CHECK_LIB(attr, attr_get,, [
> +AC_DEFUN([AC_PACKAGE_NEED_ATTRSET_LIBATTR],
> +  [ AC_CHECK_LIB(attr, attr_set,, [
>          echo
>          echo 'FATAL ERROR: could not find a valid Extended Attributes library.'
>          echo 'Install the extended attributes (attr) development package.'
> -- 
> 2.18.0
> 
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe fstests" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/configure.ac b/configure.ac
index 63ea032dc564..aede4f59a060 100644
--- a/configure.ac
+++ b/configure.ac
@@ -53,7 +53,7 @@  AC_PACKAGE_NEED_XFS_HANDLE_H
 AC_PACKAGE_NEED_ATTRLIST_LIBHANDLE
 AC_PACKAGE_NEED_ATTRIBUTES_H
 AC_PACKAGE_WANT_ATTRLIST_LIBATTR
-AC_PACKAGE_NEED_GETXATTR_LIBATTR
+AC_PACKAGE_NEED_ATTRSET_LIBATTR
 
 AC_PACKAGE_NEED_SYS_ACL_H
 AC_PACKAGE_NEED_ACL_LIBACL_H
diff --git a/m4/package_attrdev.m4 b/m4/package_attrdev.m4
index 9a82f241de3a..d994cfc23c25 100644
--- a/m4/package_attrdev.m4
+++ b/m4/package_attrdev.m4
@@ -26,8 +26,8 @@  AC_DEFUN([AC_PACKAGE_WANT_ATTRLIST_LIBATTR],
     AC_SUBST(have_attr_list)
   ])
 
-AC_DEFUN([AC_PACKAGE_NEED_ATTRGET_LIBATTR],
-  [ AC_CHECK_LIB(attr, attr_get,, [
+AC_DEFUN([AC_PACKAGE_NEED_ATTRSET_LIBATTR],
+  [ AC_CHECK_LIB(attr, attr_set,, [
         echo
         echo 'FATAL ERROR: could not find a valid Extended Attributes library.'
         echo 'Install the extended attributes (attr) development package.'