* [Buildroot] [PATCH v2 1/6] package/infozip: rework infozip patch.
@ 2015-01-24 15:23 Romain Naour
2015-01-24 15:23 ` [Buildroot] [PATCH v2 2/6] package/infozip: factorize common CFLAGS Romain Naour
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: Romain Naour @ 2015-01-24 15:23 UTC (permalink / raw)
To: buildroot
Split each cross-compilation fixes to differents
patches files.
Signed-off-by: Romain Naour <romain.naour@openwide.fr>
---
...emove-Check-C-compiler-type-optimization-.patch | 130 +++++++++++
.../0002-configure-Don-t-use-host-CPP.patch | 37 ++++
...003-Makefile-Use-CFLAGS-from-command-line.patch | 30 +++
...4-configure-use-LDFLAGS-from-command-line.patch | 35 +++
.../infozip-0001-configure-fix-cross-build.patch | 237 ---------------------
5 files changed, 232 insertions(+), 237 deletions(-)
create mode 100644 package/infozip/0001-configure-Remove-Check-C-compiler-type-optimization-.patch
create mode 100644 package/infozip/0002-configure-Don-t-use-host-CPP.patch
create mode 100644 package/infozip/0003-Makefile-Use-CFLAGS-from-command-line.patch
create mode 100644 package/infozip/0004-configure-use-LDFLAGS-from-command-line.patch
delete mode 100644 package/infozip/infozip-0001-configure-fix-cross-build.patch
diff --git a/package/infozip/0001-configure-Remove-Check-C-compiler-type-optimization-.patch b/package/infozip/0001-configure-Remove-Check-C-compiler-type-optimization-.patch
new file mode 100644
index 0000000..591b178
--- /dev/null
+++ b/package/infozip/0001-configure-Remove-Check-C-compiler-type-optimization-.patch
@@ -0,0 +1,130 @@
+From 0f5e1658c05746b17f05a1bade263cad19b37e79 Mon Sep 17 00:00:00 2001
+From: Romain Naour <romain.naour@openwide.fr>
+Date: Thu, 22 Jan 2015 15:20:25 +0100
+Subject: [PATCH 1/6] configure: Remove "Check C compiler type (optimization
+ options)"
+
+This test force optimization to -O3
+while it is already set in CFLAGS
+
+Signed-off-by: Romain Naour <romain.naour@openwide.fr>
+---
+ unix/configure | 98 ----------------------------------------------------------
+ 1 file changed, 98 deletions(-)
+
+diff --git a/unix/configure b/unix/configure
+index 73ba803..4185fee 100644
+--- a/unix/configure
++++ b/unix/configure
+@@ -22,108 +22,10 @@ LFLAGS1=''
+ LFLAGS2=''
+ LN="ln -s"
+
+-CFLAGS_OPT=''
+-
+ # bzip2
+ IZ_BZIP2=${3-}
+ CFLAGS_BZ=''
+
+-
+-echo 'Check C compiler type (optimization options)'
+-# Sun C?
+-cat > conftest.c << _EOF_
+-int main()
+-{
+-#ifndef __SUNPRO_C
+- bad code
+-#endif
+- return 0;
+-}
+-_EOF_
+-$CC $CFLAGS -c conftest.c > /dev/null 2>/dev/null
+-if test $? -eq 0; then
+- CFLAGS_OPT='-xO3'
+- echo " Sun C ($CFLAGS_OPT)"
+-else
+- # Tru64 DEC/Compaq/HP C?
+- cat > conftest.c << _EOF_
+-int main()
+-{
+-#ifndef __DECC
+- bad code
+-#endif
+- return 0;
+-}
+-_EOF_
+- $CC $CFLAGS -c conftest.c > /dev/null 2>/dev/null
+- if test $? -eq 0; then
+- CFLAGS_OPT='-O3'
+- echo " DEC C ($CFLAGS_OPT)"
+- else
+- # HP-UX HP C?
+- cat > conftest.c << _EOF_
+-int main()
+-{
+-#ifdef __GNUC__
+- bad code
+-#endif
+-#ifndef __hpux
+- bad code
+-#endif
+- return 0;
+-}
+-_EOF_
+- $CC $CFLAGS -c conftest.c > /dev/null 2>/dev/null
+- if test $? -eq 0; then
+- # HP-UX, not GCC. Lame bundled or real ANSI compiler?
+- CFLAGS_OPT_TRY="+O3 +Onolimit"
+- $CC $CFLAGS $CFLAGS_OPT_TRY -c conftest.c 2>&1 | \
+- grep '(Bundled)' > /dev/null
+- if test $? -ne 0; then
+- CFLAGS_OPT="$CFLAGS_OPT_TRY"
+- echo " HP-UX ANSI C ($CFLAGS_OPT)"
+- else
+- echo ' HP-UX Bundled C (no opt)'
+- fi
+- else
+- # GNU C?
+- cat > conftest.c << _EOF_
+-int main()
+-{
+-#ifndef __GNUC__
+- bad code
+-#endif
+- return 0;
+-}
+-_EOF_
+- $CC $CFLAGS -c conftest.c > /dev/null 2>/dev/null
+- if test $? -eq 0; then
+- CFLAGS_OPT='-O3'
+- echo " GNU C ($CFLAGS_OPT)"
+- # Special Mac OS X shared library "ld" option?
+- if test ` uname -s 2> /dev/null ` = 'Darwin'; then
+- lf='-Wl,-search_paths_first'
+- $CC $CFLAGS $lf conftest.c > /dev/null 2>/dev/null
+- if test $? -eq 0; then
+- LFLAGS2="${LFLAGS2} ${lf}"
+- fi
+- rm -f conftest
+- fi
+- else
+- CFLAGS_OPT='-O'
+- echo " Other-unknown C ($CFLAGS_OPT)"
+- fi
+- fi
+- fi
+-fi
+-
+-# optimization flags
+-if test -n "${CFLAGS_OPT}"; then
+- CFLAGS="${CFLAGS} ${CFLAGS_OPT}"
+- CFLAGS_BZ="${CFLAGS_BZ} ${CFLAGS_OPT}"
+-fi
+-
+-
+ # bzip2
+
+ echo "Check bzip2 support"
+--
+1.9.3
+
diff --git a/package/infozip/0002-configure-Don-t-use-host-CPP.patch b/package/infozip/0002-configure-Don-t-use-host-CPP.patch
new file mode 100644
index 0000000..8504912
--- /dev/null
+++ b/package/infozip/0002-configure-Don-t-use-host-CPP.patch
@@ -0,0 +1,37 @@
+From fc5c889131ff6270e1028cc7edd87e7f10a7da6d Mon Sep 17 00:00:00 2001
+From: Romain Naour <romain.naour@openwide.fr>
+Date: Thu, 22 Jan 2015 15:21:31 +0100
+Subject: [PATCH 2/6] configure: Don't use host CPP
+
+CPP is redefined if a cpp binary (/lib/cpp) is found on the host.
+
+Use the CPP="${CC} -E" allows to pass the following checks:
+Check if we can use asm code (for -DASMV)
+Check if compiler generates underlines (for -DASM_CRC)
+
+Signed-off-by: Romain Naour <romain.naour@openwide.fr>
+---
+ unix/configure | 7 -------
+ 1 file changed, 7 deletions(-)
+
+diff --git a/unix/configure b/unix/configure
+index 4185fee..489009f 100644
+--- a/unix/configure
++++ b/unix/configure
+@@ -122,13 +122,6 @@ fi
+ echo Check for the C preprocessor
+ # on SVR4, cc -E does not produce correct assembler files. Need /lib/cpp.
+ CPP="${CC} -E"
+-# solaris as(1) needs -P, maybe others as well ?
+-[ -f /usr/ccs/lib/cpp ] && CPP="/usr/ccs/lib/cpp -P"
+-[ -f /usr/lib/cpp ] && CPP=/usr/lib/cpp
+-[ -f /lib/cpp ] && CPP=/lib/cpp
+-[ -f /usr/bin/cpp ] && CPP=/usr/bin/cpp
+-[ -f /xenix ] && CPP="${CC} -E"
+-[ -f /lynx.os ] && CPP="${CC} -E"
+
+ echo "#include <stdio.h>" > conftest.c
+ $CPP conftest.c >/dev/null 2>/dev/null || CPP="${CC} -E"
+--
+1.9.3
+
diff --git a/package/infozip/0003-Makefile-Use-CFLAGS-from-command-line.patch b/package/infozip/0003-Makefile-Use-CFLAGS-from-command-line.patch
new file mode 100644
index 0000000..104b7e8
--- /dev/null
+++ b/package/infozip/0003-Makefile-Use-CFLAGS-from-command-line.patch
@@ -0,0 +1,30 @@
+From 93189390de7322da78bc5b807f4cadaff46393c9 Mon Sep 17 00:00:00 2001
+From: Romain Naour <romain.naour@openwide.fr>
+Date: Thu, 22 Jan 2015 22:45:30 +0100
+Subject: [PATCH 3/6] Makefile: Use CFLAGS from command line
+
+Replace CFLAGS_NOOPT by CFLAGS when calling unix/configure script
+to create 'flags' file which contains all variables used to build
+zip binary.
+
+Signed-off-by: Romain Naour <romain.naour@openwide.fr>
+---
+ unix/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/unix/Makefile b/unix/Makefile
+index abd0c44..db62368 100644
+--- a/unix/Makefile
++++ b/unix/Makefile
+@@ -177,7 +177,7 @@ uninstall:
+
+
+ flags: unix/configure
+- sh unix/configure "${CC}" "${CFLAGS_NOOPT}" "${IZ_BZIP2}"
++ sh unix/configure "${CC}" "${CFLAGS}" "${IZ_BZIP2}"
+
+ # These symbols, when #defined using -D have these effects on compilation:
+ # ZMEM - includes C language versions of memset(), memcpy(),
+--
+1.9.3
+
diff --git a/package/infozip/0004-configure-use-LDFLAGS-from-command-line.patch b/package/infozip/0004-configure-use-LDFLAGS-from-command-line.patch
new file mode 100644
index 0000000..35d3860
--- /dev/null
+++ b/package/infozip/0004-configure-use-LDFLAGS-from-command-line.patch
@@ -0,0 +1,35 @@
+From 5c58b8737dc9ccf9407f6725f6f07b764d6abb22 Mon Sep 17 00:00:00 2001
+From: Romain Naour <romain.naour@openwide.fr>
+Date: Thu, 22 Jan 2015 23:47:55 +0100
+Subject: [PATCH 4/6] configure: use LDFLAGS from command line
+
+The bzip2 support may not enabled due to a build error
+during the checking for bzip2 library.
+The library path (-L) to bzip2 library is missing.
+
+Signed-off-by: Romain Naour <romain.naour@openwide.fr>
+---
+ unix/configure | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/unix/configure b/unix/configure
+index 489009f..de9fd68 100644
+--- a/unix/configure
++++ b/unix/configure
+@@ -106,11 +106,11 @@ int main()
+ return 0;
+ }
+ _EOF_
+- $CC $CFLAGS -o conftest conftest.c -lbz2 > /dev/null 2>/dev/null
++ $CC $CFLAGS $LDFLAGS -o conftest conftest.c -lbz2 > /dev/null 2>/dev/null
+ if test $? -eq 0; then
+ echo "-- OS supports bzip2 - linking in bzip2"
+ CFLAGS="${CFLAGS} -DBZIP2_SUPPORT"
+- LFLAGS2="${LFLAGS2} -lbz2"
++ LFLAGS2="${LFLAGS2} ${LDFLAGS} -lbz2"
+ else
+ echo "-- Either bzlib.h or libbz2.a not found - no bzip2"
+ fi
+--
+1.9.3
+
diff --git a/package/infozip/infozip-0001-configure-fix-cross-build.patch b/package/infozip/infozip-0001-configure-fix-cross-build.patch
deleted file mode 100644
index 0b939b3..0000000
--- a/package/infozip/infozip-0001-configure-fix-cross-build.patch
+++ /dev/null
@@ -1,237 +0,0 @@
-From 941c322e4378e0ef09f21bfd7b2a337b8f812629 Mon Sep 17 00:00:00 2001
-From: Romain Naour <romain.naour@openwide.fr>
-Date: Mon, 27 Jan 2014 22:42:53 +0100
-Subject: [PATCH 1/1] configure: fix cross-compilation issues
-
-- Use CFLAGS from command line
-
-- Remove "Check C compiler type (optimization options)"
- This test force optimization to -O3
- while it is already set in CFLAGS
-
-- Don't use host CPP
-
-- Remove "Check for Large File Support"
- LFS support is already set in CFLAGS
-
-Note: configure script still use host nm
-
-Signed-off-by: Romain Naour <romain.naour@openwide.fr>
----
- unix/Makefile | 4 +-
- unix/configure | 161 +--------------------------------------------------------
- 2 files changed, 3 insertions(+), 162 deletions(-)
-
-diff --git a/unix/Makefile b/unix/Makefile
-index abd0c44..8388c74 100644
---- a/unix/Makefile
-+++ b/unix/Makefile
-@@ -58,7 +58,7 @@ IZ_OUR_BZIP2_DIR = bzip2
- # LFLAGS1 flags after output file spec, before obj file list
- # LFLAGS2 flags after obj file list (libraries, etc)
- CFLAGS_NOOPT = -I. -DUNIX $(LOCAL_ZIP)
--CFLAGS = -O2 $(CFLAGS_NOOPT)
-+CFLAGS ?= -O2 $(CFLAGS_NOOPT)
- LFLAGS1 =
- LFLAGS2 = -s
-
-@@ -177,7 +177,7 @@ uninstall:
-
-
- flags: unix/configure
-- sh unix/configure "${CC}" "${CFLAGS_NOOPT}" "${IZ_BZIP2}"
-+ sh unix/configure "${CC}" "${CFLAGS}" "${IZ_BZIP2}"
-
- # These symbols, when #defined using -D have these effects on compilation:
- # ZMEM - includes C language versions of memset(), memcpy(),
-diff --git a/unix/configure b/unix/configure
-index 73ba803..57272db 100644
---- a/unix/configure
-+++ b/unix/configure
-@@ -22,109 +22,9 @@ LFLAGS1=''
- LFLAGS2=''
- LN="ln -s"
-
--CFLAGS_OPT=''
--
- # bzip2
- IZ_BZIP2=${3-}
--CFLAGS_BZ=''
--
--
--echo 'Check C compiler type (optimization options)'
--# Sun C?
--cat > conftest.c << _EOF_
--int main()
--{
--#ifndef __SUNPRO_C
-- bad code
--#endif
-- return 0;
--}
--_EOF_
--$CC $CFLAGS -c conftest.c > /dev/null 2>/dev/null
--if test $? -eq 0; then
-- CFLAGS_OPT='-xO3'
-- echo " Sun C ($CFLAGS_OPT)"
--else
-- # Tru64 DEC/Compaq/HP C?
-- cat > conftest.c << _EOF_
--int main()
--{
--#ifndef __DECC
-- bad code
--#endif
-- return 0;
--}
--_EOF_
-- $CC $CFLAGS -c conftest.c > /dev/null 2>/dev/null
-- if test $? -eq 0; then
-- CFLAGS_OPT='-O3'
-- echo " DEC C ($CFLAGS_OPT)"
-- else
-- # HP-UX HP C?
-- cat > conftest.c << _EOF_
--int main()
--{
--#ifdef __GNUC__
-- bad code
--#endif
--#ifndef __hpux
-- bad code
--#endif
-- return 0;
--}
--_EOF_
-- $CC $CFLAGS -c conftest.c > /dev/null 2>/dev/null
-- if test $? -eq 0; then
-- # HP-UX, not GCC. Lame bundled or real ANSI compiler?
-- CFLAGS_OPT_TRY="+O3 +Onolimit"
-- $CC $CFLAGS $CFLAGS_OPT_TRY -c conftest.c 2>&1 | \
-- grep '(Bundled)' > /dev/null
-- if test $? -ne 0; then
-- CFLAGS_OPT="$CFLAGS_OPT_TRY"
-- echo " HP-UX ANSI C ($CFLAGS_OPT)"
-- else
-- echo ' HP-UX Bundled C (no opt)'
-- fi
-- else
-- # GNU C?
-- cat > conftest.c << _EOF_
--int main()
--{
--#ifndef __GNUC__
-- bad code
--#endif
-- return 0;
--}
--_EOF_
-- $CC $CFLAGS -c conftest.c > /dev/null 2>/dev/null
-- if test $? -eq 0; then
-- CFLAGS_OPT='-O3'
-- echo " GNU C ($CFLAGS_OPT)"
-- # Special Mac OS X shared library "ld" option?
-- if test ` uname -s 2> /dev/null ` = 'Darwin'; then
-- lf='-Wl,-search_paths_first'
-- $CC $CFLAGS $lf conftest.c > /dev/null 2>/dev/null
-- if test $? -eq 0; then
-- LFLAGS2="${LFLAGS2} ${lf}"
-- fi
-- rm -f conftest
-- fi
-- else
-- CFLAGS_OPT='-O'
-- echo " Other-unknown C ($CFLAGS_OPT)"
-- fi
-- fi
-- fi
--fi
--
--# optimization flags
--if test -n "${CFLAGS_OPT}"; then
-- CFLAGS="${CFLAGS} ${CFLAGS_OPT}"
-- CFLAGS_BZ="${CFLAGS_BZ} ${CFLAGS_OPT}"
--fi
--
--
--# bzip2
-+CFLAGS_BZ="${CFLAGS}"
-
- echo "Check bzip2 support"
- CC_BZ="${CC}"
-@@ -220,13 +120,6 @@ fi
- echo Check for the C preprocessor
- # on SVR4, cc -E does not produce correct assembler files. Need /lib/cpp.
- CPP="${CC} -E"
--# solaris as(1) needs -P, maybe others as well ?
--[ -f /usr/ccs/lib/cpp ] && CPP="/usr/ccs/lib/cpp -P"
--[ -f /usr/lib/cpp ] && CPP=/usr/lib/cpp
--[ -f /lib/cpp ] && CPP=/lib/cpp
--[ -f /usr/bin/cpp ] && CPP=/usr/bin/cpp
--[ -f /xenix ] && CPP="${CC} -E"
--[ -f /lynx.os ] && CPP="${CC} -E"
-
- echo "#include <stdio.h>" > conftest.c
- $CPP conftest.c >/dev/null 2>/dev/null || CPP="${CC} -E"
-@@ -398,58 +291,6 @@ else
- fi
- fi
-
--
--# 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
--
--echo Check for Large File Support
--cat > conftest.c << _EOF_
--# define _LARGEFILE_SOURCE /* some OSes need this for fseeko */
--# 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()
--{
-- 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;
--}
--_EOF_
--# compile it
--$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
--fi
--
--
- # Check for wide char for Unicode support
- # Added 11/24/2005 EG
-
---
-1.8.5.3
-
--
1.9.3
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH v2 2/6] package/infozip: factorize common CFLAGS
2015-01-24 15:23 [Buildroot] [PATCH v2 1/6] package/infozip: rework infozip patch Romain Naour
@ 2015-01-24 15:23 ` Romain Naour
2015-01-24 15:23 ` [Buildroot] [PATCH v2 3/6] package/infozip: disable GID/UID support Romain Naour
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Romain Naour @ 2015-01-24 15:23 UTC (permalink / raw)
To: buildroot
Signed-off-by: Romain Naour <romain.naour@openwide.fr>
---
package/infozip/infozip.mk | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/package/infozip/infozip.mk b/package/infozip/infozip.mk
index 229299c..3f53224 100644
--- a/package/infozip/infozip.mk
+++ b/package/infozip/infozip.mk
@@ -14,9 +14,12 @@ ifeq ($(BR2_PACKAGE_BZIP2),y)
INFOZIP_DEPENDENCIES += bzip2
endif
+# Infozip's default CFLAGS.
+INFOZIP_CFLAGS = -I. -DUNIX
+
define INFOZIP_BUILD_CMDS
$(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) \
- CFLAGS="$(TARGET_CFLAGS) -I. -DUNIX" \
+ CFLAGS="$(TARGET_CFLAGS) $(INFOZIP_CFLAGS)" \
AS="$(TARGET_CC) -c" \
-f unix/Makefile generic
endef
@@ -28,7 +31,7 @@ endef
define HOST_INFOZIP_BUILD_CMDS
$(MAKE) $(HOST_CONFIGURE_OPTS) -C $(@D) \
- CFLAGS="$(HOST_CFLAGS) -I. -DUNIX" \
+ CFLAGS="$(HOST_CFLAGS) $(INFOZIP_CFLAGS)" \
AS="$(HOSTCC) -c" \
-f unix/Makefile generic
endef
--
1.9.3
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH v2 3/6] package/infozip: disable GID/UID support
2015-01-24 15:23 [Buildroot] [PATCH v2 1/6] package/infozip: rework infozip patch Romain Naour
2015-01-24 15:23 ` [Buildroot] [PATCH v2 2/6] package/infozip: factorize common CFLAGS Romain Naour
@ 2015-01-24 15:23 ` Romain Naour
2015-01-24 15:23 ` [Buildroot] [PATCH v2 4/6] package/infozip: fix LARGE_FILE_SUPPORT check Romain Naour
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Romain Naour @ 2015-01-24 15:23 UTC (permalink / raw)
To: buildroot
This check can't work for cross-compilation since it
try to run a target's binary on the host system.
Signed-off-by: Romain Naour <romain.naour@openwide.fr>
---
...-unix-configure-remove-GID-UID-size-check.patch | 85 ++++++++++++++++++++++
package/infozip/infozip.mk | 4 +
2 files changed, 89 insertions(+)
create mode 100644 package/infozip/0005-unix-configure-remove-GID-UID-size-check.patch
diff --git a/package/infozip/0005-unix-configure-remove-GID-UID-size-check.patch b/package/infozip/0005-unix-configure-remove-GID-UID-size-check.patch
new file mode 100644
index 0000000..38d8d73
--- /dev/null
+++ b/package/infozip/0005-unix-configure-remove-GID-UID-size-check.patch
@@ -0,0 +1,85 @@
+From d8da4e5f0ebed000f880e60b6cca7c575f7ed1c7 Mon Sep 17 00:00:00 2001
+From: Romain Naour <romain.naour@openwide.fr>
+Date: Fri, 23 Jan 2015 22:13:14 +0100
+Subject: [PATCH 5/6] unix/configure: remove GID/UID size check
+
+This check can't work for cross-compilation since it
+try to run a target's binary on the host system.
+
+Reported-by: Richard Genoud <richard.genoud@gmail.com>
+Signed-off-by: Romain Naour <romain.naour@openwide.fr>
+---
+ unix/configure | 57 ---------------------------------------------------------
+ 1 file changed, 57 deletions(-)
+
+diff --git a/unix/configure b/unix/configure
+index de9fd68..7bfc9eb 100644
+--- a/unix/configure
++++ b/unix/configure
+@@ -237,63 +237,6 @@ _EOF_
+ $CC $CFLAGS -c conftest.c >/dev/null 2>/dev/null
+ [ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNO_OFF_T"
+
+-
+-echo Check size of UIDs and GIDs
+-echo "(Now zip stores variable size UIDs/GIDs using a new extra field. This"
+-echo " tests if this OS uses 16-bit UIDs/GIDs and so if the old 16-bit storage"
+-echo " should also be used for backward compatibility.)"
+-# Added 2008-04-15 CS
+-cat > conftest.c << _EOF_
+-# define _LARGEFILE_SOURCE /* some OSes need this for fseeko */
+-# 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()
+-{
+- struct stat s;
+-
+- printf(" s.st_uid is %u bytes\n", sizeof(s.st_uid));
+- printf(" s.st_gid is %u bytes\n", sizeof(s.st_gid));
+-
+- /* see if have 16-bit UID */
+- if (sizeof(s.st_uid) != 2) {
+- return 1;
+- }
+- /* see if have 16-bit GID */
+- if (sizeof(s.st_gid) != 2) {
+- return 2;
+- }
+- return 3;
+-}
+-_EOF_
+-# compile it
+-$CC -o conftest conftest.c >/dev/null 2>/dev/null
+-if [ $? -ne 0 ]; then
+- echo -- UID/GID test failed on compile - disabling old 16-bit UID/GID support
+- CFLAGS="${CFLAGS} -DUIDGID_NOT_16BIT"
+-else
+-# run it
+- ./conftest
+- r=$?
+- if [ $r -eq 1 ]; then
+- echo -- UID not 2 bytes - disabling old 16-bit UID/GID support
+- CFLAGS="${CFLAGS} -DUIDGID_NOT_16BIT"
+- elif [ $r -eq 2 ]; then
+- echo -- GID not 2 bytes - disabling old 16-bit UID/GID support
+- CFLAGS="${CFLAGS} -DUIDGID_NOT_16BIT"
+- elif [ $r -eq 3 ]; then
+- echo -- 16-bit UIDs and GIDs - keeping old 16-bit UID/GID support
+- else
+- echo -- test failed - conftest returned $r - disabling old 16-bit UID/GID support
+- CFLAGS="${CFLAGS} -DUIDGID_NOT_16BIT"
+- fi
+-fi
+-
+-
+ # 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
+--
+1.9.3
+
diff --git a/package/infozip/infozip.mk b/package/infozip/infozip.mk
index 3f53224..3e8058f 100644
--- a/package/infozip/infozip.mk
+++ b/package/infozip/infozip.mk
@@ -17,6 +17,10 @@ endif
# Infozip's default CFLAGS.
INFOZIP_CFLAGS = -I. -DUNIX
+# Disable the support of 16-bit UIDs/GIDs, the test in unix/configure was
+# removed since it can't work for cross-compilation.
+INFOZIP_CFLAGS += -DUIDGID_NOT_16BIT
+
define INFOZIP_BUILD_CMDS
$(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) \
CFLAGS="$(TARGET_CFLAGS) $(INFOZIP_CFLAGS)" \
--
1.9.3
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH v2 4/6] package/infozip: fix LARGE_FILE_SUPPORT check
2015-01-24 15:23 [Buildroot] [PATCH v2 1/6] package/infozip: rework infozip patch Romain Naour
2015-01-24 15:23 ` [Buildroot] [PATCH v2 2/6] package/infozip: factorize common CFLAGS Romain Naour
2015-01-24 15:23 ` [Buildroot] [PATCH v2 3/6] package/infozip: disable GID/UID support Romain Naour
@ 2015-01-24 15:23 ` Romain Naour
2015-01-24 15:23 ` [Buildroot] [PATCH v2 5/6] package/infozip: silent LFS warning Romain Naour
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Romain Naour @ 2015-01-24 15:23 UTC (permalink / raw)
To: buildroot
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>
---
...figure-borrow-the-LFS-test-from-autotools.patch | 101 +++++++++++++++++++++
1 file changed, 101 insertions(+)
create mode 100644 package/infozip/0006-unix-configure-borrow-the-LFS-test-from-autotools.patch
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
+
--
1.9.3
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH v2 5/6] package/infozip: silent LFS warning
2015-01-24 15:23 [Buildroot] [PATCH v2 1/6] package/infozip: rework infozip patch Romain Naour
` (2 preceding siblings ...)
2015-01-24 15:23 ` [Buildroot] [PATCH v2 4/6] package/infozip: fix LARGE_FILE_SUPPORT check Romain Naour
@ 2015-01-24 15:23 ` Romain Naour
2015-01-24 15:23 ` [Buildroot] [PATCH v2 6/6] package/infozip: add hash file Romain Naour
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Romain Naour @ 2015-01-24 15:23 UTC (permalink / raw)
To: buildroot
infozip already defines _LARGEFILE_SOURCE and _LARGEFILE64_SOURCE in
some sources files when LARGE_FILE_SUPPORT is set.
Remove them from CFLAGS.
Signed-off-by: Romain Naour <romain.naour@openwide.fr>
---
package/infozip/infozip.mk | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/package/infozip/infozip.mk b/package/infozip/infozip.mk
index 3e8058f..e57f7e1 100644
--- a/package/infozip/infozip.mk
+++ b/package/infozip/infozip.mk
@@ -21,9 +21,14 @@ INFOZIP_CFLAGS = -I. -DUNIX
# removed since it can't work for cross-compilation.
INFOZIP_CFLAGS += -DUIDGID_NOT_16BIT
+# infozip already defines _LARGEFILE_SOURCE and _LARGEFILE64_SOURCE when
+# necessary, redefining it on the command line causes some warnings.
+INFOZIP_TARGET_CFLAGS = \
+ $(filter-out -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE,$(TARGET_CFLAGS))
+
define INFOZIP_BUILD_CMDS
$(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) \
- CFLAGS="$(TARGET_CFLAGS) $(INFOZIP_CFLAGS)" \
+ CFLAGS="$(INFOZIP_TARGET_CFLAGS) $(INFOZIP_CFLAGS)" \
AS="$(TARGET_CC) -c" \
-f unix/Makefile generic
endef
--
1.9.3
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH v2 6/6] package/infozip: add hash file
2015-01-24 15:23 [Buildroot] [PATCH v2 1/6] package/infozip: rework infozip patch Romain Naour
` (3 preceding siblings ...)
2015-01-24 15:23 ` [Buildroot] [PATCH v2 5/6] package/infozip: silent LFS warning Romain Naour
@ 2015-01-24 15:23 ` Romain Naour
2015-01-26 11:46 ` [Buildroot] [PATCH v2 1/6] package/infozip: rework infozip patch Richard Genoud
2015-02-05 22:31 ` Thomas Petazzoni
6 siblings, 0 replies; 8+ messages in thread
From: Romain Naour @ 2015-01-24 15:23 UTC (permalink / raw)
To: buildroot
Signed-off-by: Romain Naour <romain.naour@openwide.fr>
---
package/infozip/infozip.hash | 2 ++
1 file changed, 2 insertions(+)
create mode 100644 package/infozip/infozip.hash
diff --git a/package/infozip/infozip.hash b/package/infozip/infozip.hash
new file mode 100644
index 0000000..782ae5e
--- /dev/null
+++ b/package/infozip/infozip.hash
@@ -0,0 +1,2 @@
+# Locally calculated from download (no sig, hash)
+sha256 f0e8bb1f9b7eb0b01285495a2699df3a4b766784c1765a8f1aeedf63c0806369 zip30.tgz
--
1.9.3
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH v2 1/6] package/infozip: rework infozip patch.
2015-01-24 15:23 [Buildroot] [PATCH v2 1/6] package/infozip: rework infozip patch Romain Naour
` (4 preceding siblings ...)
2015-01-24 15:23 ` [Buildroot] [PATCH v2 6/6] package/infozip: add hash file Romain Naour
@ 2015-01-26 11:46 ` Richard Genoud
2015-02-05 22:31 ` Thomas Petazzoni
6 siblings, 0 replies; 8+ messages in thread
From: Richard Genoud @ 2015-01-26 11:46 UTC (permalink / raw)
To: buildroot
2015-01-24 16:23 GMT+01:00 Romain Naour <romain.naour@openwide.fr>:
> Split each cross-compilation fixes to differents
> patches files.
>
> Signed-off-by: Romain Naour <romain.naour@openwide.fr>
> ---
> ...emove-Check-C-compiler-type-optimization-.patch | 130 +++++++++++
> .../0002-configure-Don-t-use-host-CPP.patch | 37 ++++
> ...003-Makefile-Use-CFLAGS-from-command-line.patch | 30 +++
> ...4-configure-use-LDFLAGS-from-command-line.patch | 35 +++
> .../infozip-0001-configure-fix-cross-build.patch | 237 ---------------------
> 5 files changed, 232 insertions(+), 237 deletions(-)
> create mode 100644 package/infozip/0001-configure-Remove-Check-C-compiler-type-optimization-.patch
> create mode 100644 package/infozip/0002-configure-Don-t-use-host-CPP.patch
> create mode 100644 package/infozip/0003-Makefile-Use-CFLAGS-from-command-line.patch
> create mode 100644 package/infozip/0004-configure-use-LDFLAGS-from-command-line.patch
> delete mode 100644 package/infozip/infozip-0001-configure-fix-cross-build.patch
>
Tested this series on a cortex A15, compilation / execution of infozip is ok.
Tested-by: Richard Genoud <richard.genoud@gmail.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH v2 1/6] package/infozip: rework infozip patch.
2015-01-24 15:23 [Buildroot] [PATCH v2 1/6] package/infozip: rework infozip patch Romain Naour
` (5 preceding siblings ...)
2015-01-26 11:46 ` [Buildroot] [PATCH v2 1/6] package/infozip: rework infozip patch Richard Genoud
@ 2015-02-05 22:31 ` Thomas Petazzoni
6 siblings, 0 replies; 8+ messages in thread
From: Thomas Petazzoni @ 2015-02-05 22:31 UTC (permalink / raw)
To: buildroot
Dear Romain Naour,
On Sat, 24 Jan 2015 16:23:40 +0100, Romain Naour wrote:
> Split each cross-compilation fixes to differents
> patches files.
>
> Signed-off-by: Romain Naour <romain.naour@openwide.fr>
Entire series applied, thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2015-02-05 22:31 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-24 15:23 [Buildroot] [PATCH v2 1/6] package/infozip: rework infozip patch Romain Naour
2015-01-24 15:23 ` [Buildroot] [PATCH v2 2/6] package/infozip: factorize common CFLAGS Romain Naour
2015-01-24 15:23 ` [Buildroot] [PATCH v2 3/6] package/infozip: disable GID/UID support Romain Naour
2015-01-24 15:23 ` [Buildroot] [PATCH v2 4/6] package/infozip: fix LARGE_FILE_SUPPORT check Romain Naour
2015-01-24 15:23 ` [Buildroot] [PATCH v2 5/6] package/infozip: silent LFS warning Romain Naour
2015-01-24 15:23 ` [Buildroot] [PATCH v2 6/6] package/infozip: add hash file Romain Naour
2015-01-26 11:46 ` [Buildroot] [PATCH v2 1/6] package/infozip: rework infozip patch Richard Genoud
2015-02-05 22:31 ` 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.