Patchwork acl_2.2.49.bb: Fix build when DISTRO_FEATURES lacks largefile.

login
register
mail settings
Submitter Graham Gower
Date Dec. 21, 2010, 4:54 a.m.
Message ID <4D103319.4080002@gmail.com>
Download mbox | patch
Permalink /patch/94/
State Accepted
Headers show

Comments

Graham Gower - Dec. 21, 2010, 4:54 a.m.
Signed-off-by: Graham Gower <graham.gower@gmail.com>
---
 recipes/udev/acl-2.2.49/nolargefile.patch |   15 +++++++++++++++
 recipes/udev/acl_2.2.49.bb                |    9 +++++++--
 2 files changed, 22 insertions(+), 2 deletions(-)
 create mode 100644 recipes/udev/acl-2.2.49/nolargefile.patch
Khem Raj - Dec. 21, 2010, 5:51 a.m.
On Mon, Dec 20, 2010 at 8:54 PM, Graham Gower <graham.gower@gmail.com> wrote:
>
> Signed-off-by: Graham Gower <graham.gower@gmail.com>

Does it function correctly at runtime ?

> ---
>  recipes/udev/acl-2.2.49/nolargefile.patch |   15 +++++++++++++++
>  recipes/udev/acl_2.2.49.bb                |    9 +++++++--
>  2 files changed, 22 insertions(+), 2 deletions(-)
>  create mode 100644 recipes/udev/acl-2.2.49/nolargefile.patch
>
> diff --git a/recipes/udev/acl-2.2.49/nolargefile.patch b/recipes/udev/acl-2.2.49/nolargefile.patch
> new file mode 100644
> index 0000000..272b97e
> --- /dev/null
> +++ b/recipes/udev/acl-2.2.49/nolargefile.patch
> @@ -0,0 +1,15 @@
> +--- acl-2.2.49/chacl/chacl.c.orig      2010-12-21 14:00:42.563984943 +1030
> ++++ acl-2.2.49/chacl/chacl.c   2010-12-21 14:01:15.614983219 +1030
> +@@ -315,6 +315,12 @@
> +       return(failed);
> + }
> +
> ++#ifndef __USE_LARGEFILE64
> ++/* XXX: hack! */
> ++#define dirent64 dirent
> ++#define readdir64 readdir
> ++#endif
> ++
> + static int
> + walk_dir(acl_t acl, acl_t dacl, const char *fname)
> + {
> diff --git a/recipes/udev/acl_2.2.49.bb b/recipes/udev/acl_2.2.49.bb
> index 027a8c6..5a37c57 100644
> --- a/recipes/udev/acl_2.2.49.bb
> +++ b/recipes/udev/acl_2.2.49.bb
> @@ -1,11 +1,12 @@
>  DESCRIPTION = "Commands for Manipulating POSIX Access Control Lists"
>  LICENSE = "GPLv2"
>
> -PR = "r2"
> +PR = "r3"
>
>  DEPENDS = "attr"
>
> -SRC_URI = "http://mirror.its.uidaho.edu/pub/savannah/acl/acl-${PV}.src.tar.gz"
> +SRC_URI = "http://mirror.its.uidaho.edu/pub/savannah/acl/acl-${PV}.src.tar.gz \
> +               file://nolargefile.patch"
>
>  inherit autotools lib_package
>
> @@ -21,6 +22,10 @@ do_configure_append() {
>     echo "#define _(str) str" >> ${S}/include/config.h
>  }
>
> +do_configure_prepend() {
> +    ${@base_contains('DISTRO_FEATURES', 'largefile', '', 'sed -i -e "s/-D_FILE_OFFSET_BITS=64//" ${S}/include/builddefs.in', d)}
> +}
> +
>  do_install() {
>     export PKG_BIN_DIR=${D}${bindir}
>     export PKG_SBIN_DIR=${D}${sbindir}
> --
> 1.7.1
>
>
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
>
Graham Gower - Dec. 21, 2010, 6:04 a.m.
On 21 December 2010 16:21, Khem Raj <raj.khem@gmail.com> wrote:
> On Mon, Dec 20, 2010 at 8:54 PM, Graham Gower <graham.gower@gmail.com> wrote:
>>
>> Signed-off-by: Graham Gower <graham.gower@gmail.com>
>
> Does it function correctly at runtime ?

Can't test yet. I have problems with proxy-libintl conflicting with
libintl8 during do_rootfs...
Graham Gower - Dec. 21, 2010, 6:13 a.m.
On 21 December 2010 16:34, Graham Gower <graham.gower@gmail.com> wrote:
> On 21 December 2010 16:21, Khem Raj <raj.khem@gmail.com> wrote:
>> On Mon, Dec 20, 2010 at 8:54 PM, Graham Gower <graham.gower@gmail.com> wrote:
>>>
>>> Signed-off-by: Graham Gower <graham.gower@gmail.com>
>>
>> Does it function correctly at runtime ?
>
> Can't test yet. I have problems with proxy-libintl conflicting with
> libintl8 during do_rootfs...
>

For what its worth, glibc dirent.h has

#ifndef __USE_FILE_OFFSET64
extern struct dirent *readdir (DIR *__dirp) __nonnull ((1));
#else
# ifdef __REDIRECT
extern struct dirent *__REDIRECT (readdir, (DIR *__dirp), readdir64)
     __nonnull ((1));
# else
#  define readdir readdir64
# endif
#endif

Patch

diff --git a/recipes/udev/acl-2.2.49/nolargefile.patch b/recipes/udev/acl-2.2.49/nolargefile.patch
new file mode 100644
index 0000000..272b97e
--- /dev/null
+++ b/recipes/udev/acl-2.2.49/nolargefile.patch
@@ -0,0 +1,15 @@ 
+--- acl-2.2.49/chacl/chacl.c.orig	2010-12-21 14:00:42.563984943 +1030
++++ acl-2.2.49/chacl/chacl.c	2010-12-21 14:01:15.614983219 +1030
+@@ -315,6 +315,12 @@
+ 	return(failed);
+ }
+ 
++#ifndef __USE_LARGEFILE64
++/* XXX: hack! */
++#define dirent64 dirent
++#define readdir64 readdir
++#endif
++
+ static int
+ walk_dir(acl_t acl, acl_t dacl, const char *fname)
+ {
diff --git a/recipes/udev/acl_2.2.49.bb b/recipes/udev/acl_2.2.49.bb
index 027a8c6..5a37c57 100644
--- a/recipes/udev/acl_2.2.49.bb
+++ b/recipes/udev/acl_2.2.49.bb
@@ -1,11 +1,12 @@ 
 DESCRIPTION = "Commands for Manipulating POSIX Access Control Lists"
 LICENSE = "GPLv2"
 
-PR = "r2"
+PR = "r3"
 
 DEPENDS = "attr"
 
-SRC_URI = "http://mirror.its.uidaho.edu/pub/savannah/acl/acl-${PV}.src.tar.gz"
+SRC_URI = "http://mirror.its.uidaho.edu/pub/savannah/acl/acl-${PV}.src.tar.gz \
+		file://nolargefile.patch"
 
 inherit autotools lib_package
 
@@ -21,6 +22,10 @@  do_configure_append() {
     echo "#define _(str) str" >> ${S}/include/config.h
 }
 
+do_configure_prepend() {
+    ${@base_contains('DISTRO_FEATURES', 'largefile', '', 'sed -i -e "s/-D_FILE_OFFSET_BITS=64//" ${S}/include/builddefs.in', d)}
+}
+
 do_install() {
     export PKG_BIN_DIR=${D}${bindir}
     export PKG_SBIN_DIR=${D}${sbindir}