Subject: | Fails to build on Linux with attr-2.4.48 |
attr-2.4.48 removed <attr/xattr.h> header file because the same definitions are available in glibc's <sys/xattr.h>. Thus File-ExtAttr-1.09 to build now with:
perl Makefile.PL INSTALLDIRS=vendor 'optimize=-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection' NO_PACKLIST=1
<attr/xattr.h> not found; perhaps you need to install libattr-devel at Makefile.PL line 39.
+ make -j4
make: *** No targets specified and no makefile found. Stop.
Attached patches fixes it. 0001-Port-Linux-to-sys-xattr.h.patch fixes the build failure. 0002-Remove-dependency-on-attr-library-on-Linux.patch removes unneeded dependency on attr library.
This works for me with glibc-2.27.9000 and attr-2.4.48 and all tests pass. Question is if you want to support older attr or Linux systems with different standard library than glibc. These patches do not address it.
Subject: | 0001-Port-Linux-to-sys-xattr.h.patch |
From fedfb42a5dac5b86894daad5c9372fa4d7ce4d01 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Tue, 10 Jul 2018 11:49:35 +0200
Subject: [PATCH 1/2] Port Linux to <sys/xattr.h>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
attr-2.4.48 removed <attr/xattr.h> because glibc had been provided
<sys/xattr.h> with the same declarations for ages.
Signed-off-by: Petr PÃsaÅ <ppisar@redhat.com>
---
Makefile.PL | 4 ++--
README | 4 ++--
extattr_linux.h | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/Makefile.PL b/Makefile.PL
index ee3ba17..1694780 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -6,7 +6,7 @@ use File::Temp qw/tempdir/;
use IO::File;
use strict;
-# Check whether we have <attr/attributes.h> and <attr/xattr.h> on Linux.
+# Check whether we have <attr/attributes.h> and <sys/xattr.h> on Linux.
# Suggest what the user needs to install, to get these files.
if ($^O eq 'linux') {
@@ -20,7 +20,7 @@ if ($^O eq 'linux')
{
my %headers = (
'attr/attributes.h' => 0,
- 'attr/xattr.h' => 0,
+ 'sys/xattr.h' => 0,
);
my $incdir;
my $missing = 0;
diff --git a/README b/README
index e45c31e..4d40f1d 100644
--- a/README
+++ b/README
@@ -42,10 +42,10 @@ use a different file system, e.g.:
DEPENDENCIES
On Linux, you will need to install the package that provides
-the header files <attr/attributes.h> and <attr/xattr.h>. On Fedora
+the header files <attr/attributes.h> and <sys/xattr.h>. On Fedora
you can install these as follows:
- yum -y install libattr-devel
+ dnf -y install glibc-headers libattr-devel
This module requires these other modules:
diff --git a/extattr_linux.h b/extattr_linux.h
index d61deed..3c5900e 100644
--- a/extattr_linux.h
+++ b/extattr_linux.h
@@ -3,7 +3,7 @@
#include <sys/types.h>
#include <attr/attributes.h>
-#include <attr/xattr.h>
+#include <sys/xattr.h>
struct hv;
--
2.14.4
Subject: | 0002-Remove-dependency-on-attr-library-on-Linux.patch |
From c0e14f90a2a6e30a10dddaab6a2d49a3a3d8726d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Tue, 10 Jul 2018 12:07:54 +0200
Subject: [PATCH 2/2] Remove dependency on attr library on Linux
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Petr PÃsaÅ <ppisar@redhat.com>
---
Makefile.PL | 12 ++----------
README | 6 +++---
extattr_linux.h | 4 +++-
3 files changed, 8 insertions(+), 14 deletions(-)
diff --git a/Makefile.PL b/Makefile.PL
index 1694780..d0f8963 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -1,25 +1,17 @@
use lib qw(inc);
use ExtUtils::MakeMaker;
-use Devel::CheckLib;
use Cwd;
use File::Temp qw/tempdir/;
use IO::File;
use strict;
-# Check whether we have <attr/attributes.h> and <sys/xattr.h> on Linux.
+# Check whether we have <sys/xattr.h> on Linux.
# Suggest what the user needs to install, to get these files.
-if ($^O eq 'linux') {
- check_lib_or_exit(
- lib => [qw(attr)]
- );
-}
-
my @DIRS = qw(. /usr/include);
if ($^O eq 'linux')
{
my %headers = (
- 'attr/attributes.h' => 0,
'sys/xattr.h' => 0,
);
my $incdir;
@@ -36,7 +28,7 @@ if ($^O eq 'linux')
foreach (keys %headers)
{
if ($headers{$_} == 0) {
- warn "<$_> not found; perhaps you need to install libattr-devel";
+ warn "<$_> not found; perhaps you need to install glibc-headers";
$missing++;
}
}
diff --git a/README b/README
index 4d40f1d..9c628ae 100644
--- a/README
+++ b/README
@@ -42,10 +42,10 @@ use a different file system, e.g.:
DEPENDENCIES
On Linux, you will need to install the package that provides
-the header files <attr/attributes.h> and <sys/xattr.h>. On Fedora
-you can install these as follows:
+the <sys/xattr.h> header file. On Fedora you can install
+these as follows:
- dnf -y install glibc-headers libattr-devel
+ dnf -y install glibc-headers
This module requires these other modules:
diff --git a/extattr_linux.h b/extattr_linux.h
index 3c5900e..3b099f4 100644
--- a/extattr_linux.h
+++ b/extattr_linux.h
@@ -2,8 +2,10 @@
#define EXTATTR_LINUX_H
#include <sys/types.h>
-#include <attr/attributes.h>
#include <sys/xattr.h>
+#ifndef ENOATTR
+# define ENOATTR ENODATA
+#endif
struct hv;
--
2.14.4