All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [git commit] package/infozip: fix LARGE_FILE_SUPPORT check
@ 2015-02-05 21:49 Thomas Petazzoni
  0 siblings, 0 replies; only message in thread
From: Thomas Petazzoni @ 2015-02-05 21:49 UTC (permalink / raw)
  To: buildroot

commit: http://git.buildroot.net/buildroot/commit/?id=3046df45728e2f84adcc50e14469099d9e52ce64
branch: http://git.buildroot.net/buildroot/commit/?id=refs/heads/master

The LFS check was dropped in commit cc4dedd9.

Since then there is a runtime error:
zip warning : Not supported (uzoff_t not same size as zoff_t)

However LFS check can't readded as is because it can't work
for cross-compilation since it try to run a target's binary on
the host system.

Replace infozip's LFS check with the one used by autoconf.
This allows to readd LFS support for host-infozip.

Reported-by: Richard Genoud <richard.genoud@gmail.com>
Signed-off-by: Romain Naour <romain.naour@openwide.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 ...figure-borrow-the-LFS-test-from-autotools.patch |  101 ++++++++++++++++++++
 1 files changed, 101 insertions(+), 0 deletions(-)

diff --git a/package/infozip/0006-unix-configure-borrow-the-LFS-test-from-autotools.patch b/package/infozip/0006-unix-configure-borrow-the-LFS-test-from-autotools.patch
new file mode 100644
index 0000000..a4e99db
--- /dev/null
+++ b/package/infozip/0006-unix-configure-borrow-the-LFS-test-from-autotools.patch
@@ -0,0 +1,101 @@
+From fc392c939b9a18959482f588aff0afc29dd6d30a Mon Sep 17 00:00:00 2001
+From: Romain Naour <romain.naour@openwide.fr>
+Date: Fri, 23 Jan 2015 22:20:18 +0100
+Subject: [PATCH 6/6] unix/configure: borrow the LFS test from autotools.
+
+Infozip's LFS check can't work for cross-compilation
+since it try to run a target's binary on the host system.
+
+Instead, use to LFS test used by autotools which is a
+compilation test.
+(see autotools/lib/autoconf/specific.m4)
+
+Reported-by: Richard Genoud <richard.genoud@gmail.com>
+Signed-off-by: Romain Naour <romain.naour@openwide.fr>
+---
+ unix/configure | 51 ++++++++++++++++++---------------------------------
+ 1 file changed, 18 insertions(+), 33 deletions(-)
+
+diff --git a/unix/configure b/unix/configure
+index 7bfc9eb..588f269 100644
+--- a/unix/configure
++++ b/unix/configure
+@@ -237,9 +237,8 @@ _EOF_
+ $CC $CFLAGS -c conftest.c >/dev/null 2>/dev/null
+ [ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNO_OFF_T"
+ 
+-# Now we set the 64-bit file environment and check the size of off_t
+-# Added 11/4/2003 EG
+-# Revised 8/12/2004 EG
++# LFS check borrowed from autotools sources
++# lib/autoconf/specific.m4
+ 
+ echo Check for Large File Support
+ cat > conftest.c << _EOF_
+@@ -247,24 +246,22 @@ cat > conftest.c << _EOF_
+ # define _LARGEFILE64_SOURCE
+ # define _FILE_OFFSET_BITS 64       /* select default interface as 64 bit */
+ # define _LARGE_FILES        /* some OSes need this for 64-bit off_t */
++
+ #include <sys/types.h>
+-#include <sys/stat.h>
+-#include <unistd.h>
+-#include <stdio.h>
+-int main()
++ /* Check that off_t can represent 2**63 - 1 correctly.
++    We can't simply define LARGE_OFF_T to be 9223372036854775807,
++    since some C++ compilers masquerading as C compilers
++    incorrectly reject 9223372036854775807.  */
++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
++  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
++		       && LARGE_OFF_T % 2147483647 == 1)
++		      ? 1 : -1];
++int
++main ()
+ {
+-  off_t offset;
+-  struct stat s;
+-  /* see if have 64-bit off_t */
+-  if (sizeof(offset) < 8)
+-    return 1;
+-  printf("  off_t is %d bytes\n", sizeof(off_t));
+-  /* see if have 64-bit stat */
+-  if (sizeof(s.st_size) < 8) {
+-    printf("  s.st_size is %d bytes\n", sizeof(s.st_size));
+-    return 2;
+-  }
+-  return 3;
++
++  ;
++  return 0;
+ }
+ _EOF_
+ # compile it
+@@ -272,22 +269,10 @@ $CC -o conftest conftest.c >/dev/null 2>/dev/null
+ if [ $? -ne 0 ]; then
+   echo -- no Large File Support
+ else
+-# run it
+-  ./conftest
+-  r=$?
+-  if [ $r -eq 1 ]; then
+-    echo -- no Large File Support - no 64-bit off_t
+-  elif [ $r -eq 2 ]; then
+-    echo -- no Large File Support - no 64-bit stat
+-  elif [ $r -eq 3 ]; then
+-    echo -- yes we have Large File Support!
+-    CFLAGS="${CFLAGS} -DLARGE_FILE_SUPPORT"
+-  else
+-    echo -- no Large File Support - conftest returned $r
+-  fi
++      echo -- yes we have Large File Support!
++      CFLAGS="${CFLAGS} -DLARGE_FILE_SUPPORT"
+ fi
+ 
+-
+ # Check for wide char for Unicode support
+ # Added 11/24/2005 EG
+ 
+-- 
+1.9.3
+

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-02-05 21:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-05 21:49 [Buildroot] [git commit] package/infozip: fix LARGE_FILE_SUPPORT check Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.