25391510 Upgrade zlib to version 1.2.11
authorPetr Sumbera <petr.sumbera@oracle.com>
Fri, 13 Jan 2017 02:17:05 -0800
changeset 7718 9960a50bc6cf
parent 7714 39538c7a06b7
child 7719 1b7c77c09e57
25391510 Upgrade zlib to version 1.2.11 25214399 problem in LIBRARY/LIBZ 25417002 ZLIB_VERSION is not fully numeric, breaks Python zlib test
components/zlib/Makefile
components/zlib/llib-lz
components/zlib/mapfile
components/zlib/patches/manpage.patch
components/zlib/patches/parfait.patch
components/zlib/patches/perf.patch
components/zlib/test/results-all.master
components/zlib/zlib.license
--- a/components/zlib/Makefile	Mon Mar 06 19:45:46 2017 -0800
+++ b/components/zlib/Makefile	Fri Jan 13 02:17:05 2017 -0800
@@ -27,15 +27,15 @@
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		zlib
-COMPONENT_VERSION=	1.2.8
+COMPONENT_VERSION=	1.2.11
 COMPONENT_PROJECT_URL=	http://www.zlib.net/
 COMPONENT_ARCHIVE_HASH=	\
-    sha256:36658cb768a54c1d4dec43c3116c27ed893e88b02ecfcb44f2166f9c0b7f2a0d
+    sha256:c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1
 COMPONENT_ARCHIVE_URL=	http://downloads.sourceforge.net/project/libpng/zlib/$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE)
 COMPONENT_BUGDB=	library/libz
 COMPONENT_ANITYA_ID=	5303
 
-TPNO=			17611
+TPNO=			33488
 
 # Omit directory options that cause zlib's CMake-based build to fail.
 CONFIGURE_DEFAULT_DIRS=no
--- a/components/zlib/llib-lz	Mon Mar 06 19:45:46 2017 -0800
+++ b/components/zlib/llib-lz	Fri Jan 13 02:17:05 2017 -0800
@@ -20,7 +20,7 @@
  */
 
 /*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  */
 
 /* LINTLIBRARY */
@@ -37,6 +37,7 @@
 int deflateInit2_(z_streamp strm, int  level, int  method, int windowBits,
     int memLevel, int strategy, const char *version, int stream_size);
 int deflate(z_streamp strm, int flush);
+int deflateGetDictionary(z_streamp strm, Bytef *dictionary, uInt *dictLength);
 int deflateSetDictionary(z_streamp strm, const Bytef *dictionary,
     uInt dictLength);
 int deflateCopy(z_streamp dest, z_streamp source);
@@ -74,6 +75,8 @@
 uLong compressBound(uLong sourceLen);
 int uncompress(Bytef *dest, uLongf *destLen, const Bytef *source,
     uLong sourceLen);
+int uncompress2(Bytef *dest, uLongf *destLen, const Bytef *source,
+    uLong *sourceLen);
 gzFile gzopen(const char *path, const char *mode);
 gzFile gzopen64(const char *path, const char *mode);
 gzFile gzdopen(int fd, const char *mode);
@@ -87,6 +90,8 @@
 int gzungetc(int c, gzFile file);
 int gzputc(gzFile file, int c);
 int gzflush(gzFile file, int flush);
+z_size_t gzfread(voidp buf, z_size_t size, z_size_t nitems, gzFile file);
+z_size_t gzfwrite(voidpc buf, z_size_t size, z_size_t nitems, gzFile file);
 z_off_t gzseek(gzFile file, z_off_t offset, int whence);
 z_off64_t gzseek64(gzFile, z_off64_t, int);
 int gzrewind(gzFile file);
@@ -104,14 +109,18 @@
 uLong adler32(uLong adler, const Bytef *buf, uInt len);
 uLong adler32_combine(uLong adler1, uLong adler2, z_off_t len2);
 uLong adler32_combine64(uLong adler1, uLong adler2, z_off64_t len2);
+uLong adler32_z(uLong adler, const Bytef *buf, z_size_t len);
 uLong crc32(uLong crc, const Bytef *buf, uInt len);
 uLong crc32_combine(uLong crc1, uLong crc2, z_off_t len2);
 uLong crc32_combine64(uLong crc1, uLong crc2, z_off64_t len2);
+uLong crc32_z(uLong adler, const Bytef *buf, z_size_t len);
 const char *zError(int err);
 uLong zlibCompileFlags(void);
 int inflateSyncPoint(z_streamp z);
 const z_crc_t *get_crc_table(void);
 int inflateUndermine(z_streamp, int);
+int inflateValidate(z_streamp, int);
+unsigned long inflateCodesUsed(z_streamp);
 int inflateResetKeep(z_streamp);
 int deflateResetKeep(z_streamp);
 int gzvprintf(gzFile file, const char *format, va_list va);
--- a/components/zlib/mapfile	Mon Mar 06 19:45:46 2017 -0800
+++ b/components/zlib/mapfile	Fri Jan 13 02:17:05 2017 -0800
@@ -32,12 +32,24 @@
 #
 # Note that the source above actually lives in the ON tree.
 #
-# Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
 #
 # public interfaces in libz
 #
 $mapfile_version 2
 
+SYMBOL_VERSION SUNW_1.4 {
+    global:
+	deflateGetDictionary ;
+	uncompress2 ;
+	gzfread ;
+	gzfwrite ;
+	adler32_z ;
+	crc32_z ;
+	inflateValidate ;
+	inflateCodesUsed ;
+} SUNW_1.3;
+
 SYMBOL_VERSION SUNW_1.3 {
     global:
 	deflatePending ;
--- a/components/zlib/patches/manpage.patch	Mon Mar 06 19:45:46 2017 -0800
+++ b/components/zlib/patches/manpage.patch	Fri Jan 13 02:17:05 2017 -0800
@@ -1,11 +1,11 @@
 Patch origin: in-house
 Patch status: Solaris-specific; not suitable for upstream
 
---- zlib-1.2.8/zlib.3	2013-04-28 17:23:49.000000000 -0700
-+++ zlib-1.2.8/zlib.3	2014-04-18 06:07:00.037749015 -0700
+--- zlib-1.2.11/zlib.3
++++ zlib-1.2.11/zlib.3
 @@ -1,13 +1,13 @@
--.TH ZLIB 3 "28 Apr 2013"
-+.TH LIBZ 3 "28 Apr 2013"
+-.TH ZLIB 3 "15 Jan 2017"
++.TH LIBZ 3 "15 Jan 2017"
  .SH NAME
 -zlib \- compression/decompression library
 +libz \- compression/decompression library
@@ -16,7 +16,7 @@
  .SH DESCRIPTION
  The
 -.I zlib
-+.I libz (zlib)
++.I libz
  library is a general purpose data compression library.
  The code is thread safe, assuming that the standard library functions
  used are thread safe, such as memory allocation routines.
--- a/components/zlib/patches/parfait.patch	Mon Mar 06 19:45:46 2017 -0800
+++ b/components/zlib/patches/parfait.patch	Fri Jan 13 02:17:05 2017 -0800
@@ -8,13 +8,97 @@
 Downside of it is that Parfait will analyze also these separate object
 files.
 
---- zlib-1.2.8/Makefile.in	2013-04-28 15:57:11.000000000 -0700
-+++ zlib-1.2.8/Makefile.in	2014-05-07 07:30:58.047571894 -0700
-@@ -158,6 +158,7 @@
+--- zlib-1.2.11/Makefile.in
++++ zlib-1.2.11/Makefile.in
+@@ -208,76 +208,91 @@
+ 	-@mkdir objs 2>/dev/null || test -d objs
+ 	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/adler32.o $(SRCDIR)adler32.c
+ 	-@mv objs/adler32.o $@
++	-@if [ -f objs/adler32.o.bc ]; then mv objs/adler32.o.bc adler32.bc; fi
+ 
+ crc32.lo: $(SRCDIR)crc32.c
+ 	-@mkdir objs 2>/dev/null || test -d objs
+ 	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/crc32.o $(SRCDIR)crc32.c
+ 	-@mv objs/crc32.o $@
++	-@if [ -f objs/crc32.o.bc ]; then mv objs/crc32.o.bc crc32.bc; fi
+ 
+ deflate.lo: $(SRCDIR)deflate.c
+ 	-@mkdir objs 2>/dev/null || test -d objs
+ 	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/deflate.o $(SRCDIR)deflate.c
+ 	-@mv objs/deflate.o $@
++	-@if [ -f objs/deflate.o.bc ]; then mv objs/deflate.o.bc deflate.bc; fi
+ 
+ infback.lo: $(SRCDIR)infback.c
+ 	-@mkdir objs 2>/dev/null || test -d objs
+ 	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/infback.o $(SRCDIR)infback.c
+ 	-@mv objs/infback.o $@
++	-@if [ -f objs/infback.o.bc ]; then mv objs/infback.o.bc infback.bc; fi
+ 
+ inffast.lo: $(SRCDIR)inffast.c
+ 	-@mkdir objs 2>/dev/null || test -d objs
+ 	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/inffast.o $(SRCDIR)inffast.c
+ 	-@mv objs/inffast.o $@
++	-@if [ -f objs/inffast.o.bc ]; then mv objs/inffast.o.bc inffast.bc; fi
+ 
+ inflate.lo: $(SRCDIR)inflate.c
+ 	-@mkdir objs 2>/dev/null || test -d objs
+ 	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/inflate.o $(SRCDIR)inflate.c
+ 	-@mv objs/inflate.o $@
++	-@if [ -f objs/inflate.o.bc ]; then mv objs/inflate.o.bc inflate.bc; fi
+ 
+ inftrees.lo: $(SRCDIR)inftrees.c
+ 	-@mkdir objs 2>/dev/null || test -d objs
+ 	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/inftrees.o $(SRCDIR)inftrees.c
+ 	-@mv objs/inftrees.o $@
++	-@if [ -f objs/inftrees.o.bc ]; then mv objs/inftrees.o.bc inftrees.bc; fi
+ 
+ trees.lo: $(SRCDIR)trees.c
  	-@mkdir objs 2>/dev/null || test -d objs
- 	$(CC) $(SFLAGS) -DPIC -c -o objs/$*.o $<
- 	-@mv objs/$*.o $@
-+	-@if [ -f objs/$*.o.bc ]; then mv objs/$*.o.bc [email protected]; fi
+ 	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/trees.o $(SRCDIR)trees.c
+ 	-@mv objs/trees.o $@
++	-@if [ -f objs/trees.o.bc ]; then mv objs/trees.o.bc trees.bc; fi
+ 
+ zutil.lo: $(SRCDIR)zutil.c
+ 	-@mkdir objs 2>/dev/null || test -d objs
+ 	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/zutil.o $(SRCDIR)zutil.c
+ 	-@mv objs/zutil.o $@
++	-@if [ -f objs/zutil.o.bc ]; then mv objs/zutil.o.bc zutil.bc; fi
+ 
+ compress.lo: $(SRCDIR)compress.c
+ 	-@mkdir objs 2>/dev/null || test -d objs
+ 	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/compress.o $(SRCDIR)compress.c
+ 	-@mv objs/compress.o $@
++	-@if [ -f objs/compress.o.bc ]; then mv objs/compress.o.bc compress.bc; fi
+ 
+ uncompr.lo: $(SRCDIR)uncompr.c
+ 	-@mkdir objs 2>/dev/null || test -d objs
+ 	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/uncompr.o $(SRCDIR)uncompr.c
+ 	-@mv objs/uncompr.o $@
++	-@if [ -f objs/uncompr.o.bc ]; then mv objs/uncompr.o.bc uncompr.bc; fi
+ 
+ gzclose.lo: $(SRCDIR)gzclose.c
+ 	-@mkdir objs 2>/dev/null || test -d objs
+ 	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/gzclose.o $(SRCDIR)gzclose.c
+ 	-@mv objs/gzclose.o $@
++	-@if [ -f objs/gzclose.o.bc ]; then mv objs/gzclose.o.bc gzclose.bc; fi
+ 
+ gzlib.lo: $(SRCDIR)gzlib.c
+ 	-@mkdir objs 2>/dev/null || test -d objs
+ 	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/gzlib.o $(SRCDIR)gzlib.c
+ 	-@mv objs/gzlib.o $@
++	-@if [ -f objs/gzlib.o.bc ]; then mv objs/gzlib.o.bc gzlib.bc; fi
+ 
+ gzread.lo: $(SRCDIR)gzread.c
+ 	-@mkdir objs 2>/dev/null || test -d objs
+ 	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/gzread.o $(SRCDIR)gzread.c
+ 	-@mv objs/gzread.o $@
++	-@if [ -f objs/gzread.o.bc ]; then mv objs/gzread.o.bc gzread.bc; fi
+ 
+ gzwrite.lo: $(SRCDIR)gzwrite.c
+ 	-@mkdir objs 2>/dev/null || test -d objs
+ 	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/gzwrite.o $(SRCDIR)gzwrite.c
+ 	-@mv objs/gzwrite.o $@
++	-@if [ -f objs/gzwrite.o.bc ]; then mv objs/gzwrite.o.bc gzwrite.bc; fi
+ 
  
  placebo $(SHAREDLIBV): $(PIC_OBJS) libz.a
- 	$(LDSHARED) $(SFLAGS) -o $@ $(PIC_OBJS) $(LDSHAREDLIBC) $(LDFLAGS)
--- a/components/zlib/patches/perf.patch	Mon Mar 06 19:45:46 2017 -0800
+++ b/components/zlib/patches/perf.patch	Fri Jan 13 02:17:05 2017 -0800
@@ -1,23 +1,12 @@
 Patch origin: in-house
-Patch status: inffast.c part: submitted back to community without feedback
+Patch status: inffast.c part: accepted, will be in next version
 Patch status: deflate.c part: Solaris-specific; not suitable for upstream
 
---- zlib-1.2.8/zlib.h	2013-04-28 17:23:49.000000000 -0700
-+++ zlib-1.2.8/zlib.h	2014-04-18 05:32:31.316290241 -0700
-@@ -37,8 +37,8 @@
- extern "C" {
- #endif
- 
--#define ZLIB_VERSION "1.2.8"
--#define ZLIB_VERNUM 0x1280
-+#define ZLIB_VERSION "1.2.8-T4mods"
-+#define ZLIB_VERNUM 0x128f
- #define ZLIB_VER_MAJOR 1
- #define ZLIB_VER_MINOR 2
- #define ZLIB_VER_REVISION 8
+https://github.com/madler/zlib/commit/60a5ecc62b18d1e2391993b1fcfc10e100720642
+
 --- zlib-1.2.8/inffast.c	2013-03-24 22:47:59.000000000 -0700
 +++ zlib-1.2.8/inffast.c	2014-02-28 01:57:57.075708259 -0800
-@@ -87,7 +87,7 @@
+@@ -68,7 +68,7 @@
      code const FAR *dcode;      /* local strm->distcode */
      unsigned lmask;             /* mask for first level of length codes */
      unsigned dmask;             /* mask for first level of distance codes */
@@ -26,8 +15,8 @@
      unsigned op;                /* code bits, operation, extra bits, or */
                                  /*  window position, window bytes to copy */
      unsigned len;               /* match length, unused bytes */
-@@ -124,20 +124,20 @@
-             hold += (unsigned long)(PUP(in)) << bits;
+@@ -105,20 +105,20 @@
+             hold += (unsigned long)(*in++) << bits;
              bits += 8;
          }
 -        here = lcode[hold & lmask];
@@ -44,9 +33,9 @@
 +            Tracevv((stderr, here->val >= 0x20 && here->val < 0x7f ?
                      "inflate:         literal '%c'\n" :
 -                    "inflate:         literal 0x%02x\n", here.val));
--            PUP(out) = (unsigned char)(here.val);
+-            *out++ = (unsigned char)(here.val);
 +                    "inflate:         literal 0x%02x\n", here->val));
-+            PUP(out) = (unsigned char)(here->val);
++            *out++ = (unsigned char)(here->val);
          }
          else if (op & 16) {                     /* length base */
 -            len = (unsigned)(here.val);
@@ -54,8 +43,8 @@
              op &= 15;                           /* number of extra bits */
              if (op) {
                  if (bits < op) {
-@@ -155,14 +155,14 @@
-                 hold += (unsigned long)(PUP(in)) << bits;
+@@ -136,14 +136,14 @@
+                 hold += (unsigned long)(*in++) << bits;
                  bits += 8;
              }
 -            here = dcode[hold & dmask];
@@ -72,8 +61,8 @@
 +                dist = (unsigned)(here->val);
                  op &= 15;                       /* number of extra bits */
                  if (bits < op) {
-                     hold += (unsigned long)(PUP(in)) << bits;
-@@ -281,7 +281,7 @@
+                     hold += (unsigned long)(*in++) << bits;
+@@ -262,7 +262,7 @@
                  }
              }
              else if ((op & 64) == 0) {          /* 2nd level distance code */
@@ -82,7 +71,7 @@
                  goto dodist;
              }
              else {
-@@ -291,7 +291,7 @@
+@@ -272,7 +272,7 @@
              }
          }
          else if ((op & 64) == 0) {              /* 2nd level length code */
@@ -101,7 +90,7 @@
  /* ===========================================================================
   *  Function prototypes.
   */
-@@ -89,13 +90,18 @@
+@@ -91,13 +92,18 @@
        void match_init OF((void)); /* asm code initialization */
        uInt longest_match  OF((deflate_state *s, IPos cur_match));
  #else
@@ -112,7 +101,7 @@
 +#endif
  #endif
  
- #ifdef DEBUG
+ #ifdef ZLIB_DEBUG
  local  void check_match OF((deflate_state *s, IPos start, IPos match,
                              int length));
  #endif
@@ -120,7 +109,7 @@
  
  /* ===========================================================================
   * Local data
-@@ -104,6 +110,7 @@
+@@ -106,6 +112,7 @@
  #define NIL 0
  /* Tail of hash chains */
  
@@ -128,7 +117,7 @@
  #ifndef TOO_FAR
  #  define TOO_FAR 4096
  #endif
-@@ -1130,7 +1137,9 @@
+@@ -1217,7 +1224,9 @@
  #endif
  #endif
  }
@@ -138,7 +127,7 @@
  #ifndef FASTEST
  /* ===========================================================================
   * Set match_start to the longest match starting at the given string and
-@@ -1145,7 +1154,11 @@
+@@ -1232,7 +1241,11 @@
  /* For 80x86 and 680x0, an optimized version will be provided in match.asm or
   * match.S. The code will be functionally equivalent.
   */
@@ -150,7 +139,7 @@
      deflate_state *s;
      IPos cur_match;                             /* current match */
  {
-@@ -1288,6 +1301,7 @@
+@@ -1375,6 +1388,7 @@
      return s->lookahead;
  }
  #endif /* ASMV */
@@ -158,15 +147,15 @@
  
  #else /* FASTEST */
  
-@@ -1349,6 +1363,7 @@
+@@ -1436,6 +1450,7 @@
  
  #endif /* FASTEST */
  
 +#ifndef LONGEST_MATCH_ONLY
- #ifdef DEBUG
- /* ===========================================================================
-  * Check that the match at match_start is indeed a match.
-@@ -1965,3 +1980,4 @@
+ #ifdef ZLIB_DEBUG
+ 
+ #define EQUAL 0
+@@ -2154,3 +2169,4 @@
          FLUSH_BLOCK(s, 0);
      return block_done;
  }
--- a/components/zlib/test/results-all.master	Mon Mar 06 19:45:46 2017 -0800
+++ b/components/zlib/test/results-all.master	Fri Jan 13 02:17:05 2017 -0800
@@ -1,6 +1,6 @@
-make[1]: Entering directory `$(@D)'
+make[1]: Entering directory '$(@D)'
 hello world
-zlib version 1.2.8-T4mods = 0x128f, compile flags = 0xXX
+zlib version 1.2.11 = 0x12b0, compile flags = 0xXX
 uncompress(): hello, hello!
 gzread(): hello, hello!
 gzgets() after gzseek:  hello!
@@ -10,7 +10,7 @@
 inflate with dictionary: hello, hello!
 		*** zlib test OK ***
 hello world
-zlib version 1.2.8-T4mods = 0x128f, compile flags = 0xXX
+zlib version 1.2.11 = 0x12b0, compile flags = 0xXX
 uncompress(): hello, hello!
 gzread(): hello, hello!
 gzgets() after gzseek:  hello!
@@ -20,7 +20,7 @@
 inflate with dictionary: hello, hello!
 		*** zlib shared test OK ***
 hello world
-zlib version 1.2.8-T4mods = 0x128f, compile flags = 0xXX
+zlib version 1.2.11 = 0x12b0, compile flags = 0xXX
 uncompress(): hello, hello!
 gzread(): hello, hello!
 gzgets() after gzseek:  hello!
@@ -29,4 +29,4 @@
 after inflateSync(): hello, hello!
 inflate with dictionary: hello, hello!
 		*** zlib 64-bit test OK ***
-make[1]: Leaving directory `$(@D)'
+make[1]: Leaving directory '$(@D)'
--- a/components/zlib/zlib.license	Mon Mar 06 19:45:46 2017 -0800
+++ b/components/zlib/zlib.license	Fri Jan 13 02:17:05 2017 -0800
@@ -1,22 +1,22 @@
 
-Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler
+ (C) 1995-2017 Jean-loup Gailly and Mark Adler
 
-This software is provided 'as-is', without any express or implied
-warranty.  In no event will the authors be held liable for any damages
-arising from the use of this software.
+  This software is provided 'as-is', without any express or implied
+  warranty.  In no event will the authors be held liable for any damages
+  arising from the use of this software.
 
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it
-freely, subject to the following restrictions:
+  Permission is granted to anyone to use this software for any purpose,
+  including commercial applications, and to alter it and redistribute it
+  freely, subject to the following restrictions:
 
-1. The origin of this software must not be misrepresented; you must not
-   claim that you wrote the original software. If you use this software
-   in a product, an acknowledgment in the product documentation would be
-   appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be
-   misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
+  1. The origin of this software must not be misrepresented; you must not
+     claim that you wrote the original software. If you use this software
+     in a product, an acknowledgment in the product documentation would be
+     appreciated but is not required.
+  2. Altered source versions must be plainly marked as such, and must not be
+     misrepresented as being the original software.
+  3. This notice may not be removed or altered from any source distribution.
 
-Jean-loup Gailly        Mark Adler
[email protected]          [email protected]
+  Jean-loup Gailly        Mark Adler
+  [email protected]          [email protected]