71a74f9
From e0be75f8dce27a4e32196529df2a08dca791a286 Mon Sep 17 00:00:00 2001
25e9802
From: Jeremy Linton <jeremy.linton@arm.com>
25e9802
Date: Fri, 6 Apr 2018 11:46:42 -0500
25e9802
Subject: [PATCH 3/3] arm64 specific build patch
25e9802
25e9802
---
71a74f9
 Makefile.in           | 19 ++++++++++++-------
25e9802
 configure             |  2 +-
25e9802
 contrib/minizip/zip.c |  6 ++++--
71a74f9
 3 files changed, 17 insertions(+), 10 deletions(-)
25e9802
25e9802
diff --git a/Makefile.in b/Makefile.in
71a74f9
index 5a77949..9f088e5 100644
25e9802
--- a/Makefile.in
25e9802
+++ b/Makefile.in
71a74f9
@@ -57,7 +57,7 @@ SRCDIR=
25e9802
 ZINC=
25e9802
 ZINCOUT=-I.
25e9802
 
25e9802
-OBJZ = adler32.o crc32.o deflate.o infback.o inffast.o inflate.o inftrees.o trees.o zutil.o
71a74f9
+OBJZ = adler32.o crc32.o deflate.o infback.o inffast.o inffast.o inflate.o inftrees.o trees.o zutil.o
25e9802
 OBJG = compress.o uncompr.o gzclose.o gzlib.o gzread.o gzwrite.o
25e9802
 OBJC = $(OBJZ) $(OBJG)
25e9802
 
71a74f9
@@ -163,16 +163,16 @@ crc32.o: $(SRCDIR)crc32.c
25e9802
 	$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)crc32.c
25e9802
 
25e9802
 deflate.o: $(SRCDIR)deflate.c
25e9802
-	$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)deflate.c
25e9802
+	$(CC) $(CFLAGS) $(ZINC) -I$(SRCDIR) -I$(SRCDIR)contrib/arm -c -o $@ $(SRCDIR)deflate.c
25e9802
 
25e9802
 infback.o: $(SRCDIR)infback.c
25e9802
 	$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)infback.c
25e9802
 
25e9802
 inffast.o: $(SRCDIR)inffast.c
25e9802
-	$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)inffast.c
25e9802
+	$(CC) $(CFLAGS) $(ZINC) -I$(SRCDIR) -I$(SRCDIR)contrib/arm -c -o $@ $(SRCDIR)inffast.c
25e9802
 
71a74f9
 inflate.o: $(SRCDIR)inflate.c
25e9802
-	$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)inflate.c
71a74f9
+	$(CC) $(CFLAGS) $(ZINC) -I$(SRCDIR) -I$(SRCDIR)contrib/arm -c -o $@ $(SRCDIR)inflate.c
25e9802
 
25e9802
 inftrees.o: $(SRCDIR)inftrees.c
25e9802
 	$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)inftrees.c
71a74f9
@@ -214,7 +214,7 @@ crc32.lo: $(SRCDIR)crc32.c
25e9802
 
25e9802
 deflate.lo: $(SRCDIR)deflate.c
25e9802
 	-@mkdir objs 2>/dev/null || test -d objs
25e9802
-	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/deflate.o $(SRCDIR)deflate.c
25e9802
+	$(CC) $(SFLAGS) $(ZINC) -I$(SRCDIR) -I$(SRCDIR)contrib/arm -DPIC -c -o objs/deflate.o $(SRCDIR)deflate.c
25e9802
 	-@mv objs/deflate.o $@
25e9802
 
25e9802
 infback.lo: $(SRCDIR)infback.c
71a74f9
@@ -222,14 +222,19 @@ infback.lo: $(SRCDIR)infback.c
25e9802
 	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/infback.o $(SRCDIR)infback.c
25e9802
 	-@mv objs/infback.o $@
25e9802
 
25e9802
+arminffast.lo: $(SRCDIR)contrib/arm/inffast_chunk.c $(SRCDIR)inffast.c
25e9802
+	-@mkdir objs 2>/dev/null || test -d objs
25e9802
+	$(CC) $(SFLAGS) $(ZINC) -I$(SRCDIR) -I$(SRCDIR)contrib/arm -DPIC -c -o objs/arminffast.o $(SRCDIR)contrib/arm/inffast_chunk.c
25e9802
+	-@mv objs/arminffast.o $@
25e9802
+
25e9802
 inffast.lo: $(SRCDIR)inffast.c
25e9802
 	-@mkdir objs 2>/dev/null || test -d objs
25e9802
-	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/inffast.o $(SRCDIR)inffast.c
25e9802
+	$(CC) $(SFLAGS) $(ZINC) -I$(SRCDIR) -I$(SRCDIR)contrib/arm -DPIC -c -o objs/inffast.o $(SRCDIR)inffast.c
25e9802
 	-@mv objs/inffast.o $@
25e9802
 
71a74f9
 inflate.lo: $(SRCDIR)inflate.c
25e9802
 	-@mkdir objs 2>/dev/null || test -d objs
25e9802
-	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/inflate.o $(SRCDIR)inflate.c
71a74f9
+	$(CC) $(SFLAGS) $(ZINC) -I$(SRCDIR) -I$(SRCDIR)contrib/arm -DPIC -c -o objs/inflate.o $(SRCDIR)inflate.c
25e9802
 	-@mv objs/inflate.o $@
25e9802
 
25e9802
 inftrees.lo: $(SRCDIR)inftrees.c
25e9802
diff --git a/configure b/configure
25e9802
index e974d1f..0c5f837 100755
25e9802
--- a/configure
25e9802
+++ b/configure
25e9802
@@ -23,7 +23,7 @@ SRCDIR=`dirname $0`
25e9802
 if test $SRCDIR = "."; then
25e9802
     ZINC=""
25e9802
     ZINCOUT="-I."
25e9802
-    SRCDIR=""
25e9802
+    SRCDIR="./"
25e9802
 else
25e9802
     ZINC='-include zconf.h'
25e9802
     ZINCOUT='-I. -I$(SRCDIR)'
25e9802
diff --git a/contrib/minizip/zip.c b/contrib/minizip/zip.c
25e9802
index 44e88a9..0517930 100644
25e9802
--- a/contrib/minizip/zip.c
25e9802
+++ b/contrib/minizip/zip.c
25e9802
@@ -519,15 +519,17 @@ local ZPOS64_T zip64local_SearchCentralDir(const zlib_filefunc64_32_def* pzlib_f
25e9802
       break;
25e9802
 
25e9802
     for (i=(int)uReadSize-3; (i--)>0;)
25e9802
+    {
25e9802
       if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) &&
25e9802
         ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06))
25e9802
       {
25e9802
         uPosFound = uReadPos+i;
25e9802
         break;
25e9802
       }
25e9802
+    }
25e9802
 
25e9802
-      if (uPosFound!=0)
25e9802
-        break;
25e9802
+    if (uPosFound!=0)
25e9802
+      break;
25e9802
   }
25e9802
   TRYFREE(buf);
25e9802
   return uPosFound;
25e9802
-- 
71a74f9
2.19.0
25e9802