Skip to contentSkip to conversation

lib: zlib: update to 1.2.6

PATCH New Lei Wen 3 participants 10 messages Mar 6, 2012 – Mar 8, 2012

lore
Share & tools
lore

Lei Wen

author
#0 lore raw

PATCH 1/1 lib: zlib: update to 1.2.6

Hi,

In this patch, I update the current zlib from 1.2.5 to 1.2.6.

There is a lot of warnings when using checkpatch script, I don't know whether I should fix it or not...
Since it is just copy from as it is from upstream zlib 1.2.6, so I didn't do the correction, so don't be panic when use checkpatch.

Best regards,
Lei

========================================================
As it copy from zlib home page, the improvement from 1.2.5 to 1.2.6 contains following:

gzread() can now read a file that is being written concurrently gzgetc() is now a macro for increased speed
Added a 'T' option to gzopen() for transparent writing (no compression) Added deflatePending() to return the amount of pending output Allow deflateSetDictionary() and inflateSetDictionary() at any time in raw mode
deflatePrime() can now insert bits in the middle of the stream ./configure now creates a configure.log file with all of the results Added a ./configure --solo option to compile zlib with no dependency on any libraries
Fixed a problem with large file support macros
Fixed a bug in contrib/puff
Many portability improvements

---

 include/u-boot/zlib.h | 2002 +++++++++++++++++++++++++++++++++++++------------
 lib/zlib/adler32.c    |  112 ++-
 lib/zlib/inffast.c    |  139 ++--
 lib/zlib/inffast.h    |    4 +-
 lib/zlib/inffixed.h   |    6 +-
 lib/zlib/inflate.c    |  727 ++++++++++++++++---
 lib/zlib/inflate.h    |   31 +-
 lib/zlib/inftrees.c   |   93 +--
 lib/zlib/inftrees.h   |   27 +-
 lib/zlib/zutil.c      |  282 +++++++-
 lib/zlib/zutil.h      |  185 ++++-
 11 files changed, 2790 insertions(+), 818 deletions(-)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-lib-zlib-update-to-1.2.6.patch
Type: application/octet-stream
Size: 190236 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120306/b5ff44ce/attachment.obj>

#1 lore raw

PATCH 1/1 lib: zlib: update to 1.2.6

Quoted 6 lines · On Tuesday 06 March 2012 03:55:19 Lei Wen wrote:

In this patch, I update the current zlib from 1.2.5 to 1.2.6.

There is a lot of warnings when using checkpatch script, I don't know whether I should fix it or not...
Since it is just copy from as it is from upstream zlib 1.2.6, so I didn't do the correction, so don't be panic when use checkpatch.

did you test the performance ? i found it went down a bit which is why i didn't post a patch to update it to a newer version. improvements in API's we don't use aren't a good reason for updating ...
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120306/fec0138e/attachment.pgp>

author
#2 lore raw

PATCH 1/1 lib: zlib: update to 1.2.6

Hi Mike,

Quoted 11 lines · Mike Frysinger
Quoted 6 lines · On Tuesday 06 March 2012 03:55:19 Lei Wen wrote:

In this patch, I update the current zlib from 1.2.5 to 1.2.6.

There is a lot of warnings when using checkpatch script, I don't know whether I should fix it or not...
Since it is just copy from as it is from upstream zlib 1.2.6, so I didn't do the correction, so don't be panic when use checkpatch.

did you test the performance ? ?i found it went down a bit which is why i didn't post a patch to update it to a newer version. ?improvements in API's we don't use aren't a good reason for updating ...

I didn't do the performance test... Just did the compile and bring up a gziped kernel
with the update zlib.

Is there some easy test case which could run in the uboot to show the unzip speed?
I'd like to help to test it...

But your saying is right, we should always focus on our current usage.

Quoted 1 line

-mike

Thanks,
Lei

#3 lore raw

PATCH 1/1 lib: zlib: update to 1.2.6

In reply to Lei Wen

Dear Lei Wen,

Quoted 7 lines · In message <CALZhoST8b_gwi=b696BcNCedoYSNs7Mb3qihioeLAzShSHwArw@mail.gmail.com>…

--20cf300fafe1db2c6604ba8f33fe
Content-Type: text/plain; charset=ISO-8859-1

Hi,

In this patch, I update the current zlib from 1.2.5 to 1.2.6.

Quoted 7 lines

There is a lot of warnings when using checkpatch script, I don't know whether I should fix it or not...
Since it is just copy from as it is from upstream zlib 1.2.6, so I didn't do the correction, so don't be panic when use checkpatch.

Best regards,
Lei

This text should not be here. It would become part of the commit message. Please add such comments only to the comment section, i. e. below the '---' line.

Quoted 4 lines

========================================================
As it copy from zlib home page, the improvement from 1.2.5 to 1.2.6 contains following:

Quoted 13 lines

gzread() can now read a file that is being written concurrently gzgetc() is now a macro for increased speed
Added a 'T' option to gzopen() for transparent writing (no compression) Added deflatePending() to return the amount of pending output Allow deflateSetDictionary() and inflateSetDictionary() at any time in raw mode
deflatePrime() can now insert bits in the middle of the stream ./configure now creates a configure.log file with all of the results Added a ./configure --solo option to compile zlib with no dependency on any libraries
Fixed a problem with large file support macros
Fixed a bug in contrib/puff
Many portability improvements

Unfortunately the new code is not even compile clean:

-> ./MAKEALL m28evk
Configuring for m28evk board...
In file included from /home/wd/git/u-boot/tmp/lib/crc32.c:20:0:
/home/wd/git/u-boot/tmp/include/u-boot/zlib.h:86:5: error: unknown type name ?z_const? /home/wd/git/u-boot/tmp/include/u-boot/zlib.h:86:19: error: expected ?:?, ?,?, ?;?, ?}? or ?__attribute__? before ?*? token In file included from /home/wd/git/u-boot/tmp/lib/crc32.c:20:0:
/home/wd/git/u-boot/tmp/include/u-boot/zlib.h:1326:21: error: expected ?=?, ?,?, ?;?, ?asm? or ?__attribute__? before ?Z_ARG? make[1]: *** [crc32.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [tools] Error 2

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Teenagers are people who express a burning desire to be different by
dressing exactly alike.
There are some strings. They're just not attached.
author
#4 lore raw

PATCH 1/1 lib: zlib: update to 1.2.6

Hi Wolfgang,

Quoted 15 lines · Wolfgang Denk

Dear Lei Wen,

Quoted 12 lines · In message <CALZhoST8b_gwi=b696BcNCedoYSNs7Mb3qihioeLAzShSHwArw@mail.gmail.com>…

--20cf300fafe1db2c6604ba8f33fe
Content-Type: text/plain; charset=ISO-8859-1

Hi,

In this patch, I update the current zlib from 1.2.5 to 1.2.6.

There is a lot of warnings when using checkpatch script, I don't know whether I should fix it or not...
Since it is just copy from as it is from upstream zlib 1.2.6, so I didn't do the correction, so don't be panic when use checkpatch.

Quoted 6 lines
Quoted 2 lines

Best regards,
Lei

This text should not be here. ?It would become part of the commit message. ?Please add such comments only to the comment section, i. e. below the '---' line.

Opps, sorry for this...

Quoted 21 lines
Quoted 5 lines

========================================================
As it copy from zlib home page, the improvement from 1.2.5 to 1.2.6 contains following:

Quoted 13 lines

gzread() can now read a file that is being written concurrently gzgetc() is now a macro for increased speed
Added a 'T' option to gzopen() for transparent writing (no compression) Added deflatePending() to return the amount of pending output Allow deflateSetDictionary() and inflateSetDictionary() at any time in raw mode
deflatePrime() can now insert bits in the middle of the stream ./configure now creates a configure.log file with all of the results Added a ./configure --solo option to compile zlib with no dependency on any libraries
Fixed a problem with large file support macros
Fixed a bug in contrib/puff
Many portability improvements

Unfortunately the new code is not even compile clean:

Quoted 11 lines

-> ./MAKEALL m28evk
Configuring for m28evk board...
In file included from /home/wd/git/u-boot/tmp/lib/crc32.c:20:0:
/home/wd/git/u-boot/tmp/include/u-boot/zlib.h:86:5: error: unknown type name ?z_const? /home/wd/git/u-boot/tmp/include/u-boot/zlib.h:86:19: error: expected ?:?, ?,?, ?;?, ?}? or ?__attribute__? before ?*? token In file included from /home/wd/git/u-boot/tmp/lib/crc32.c:20:0:
/home/wd/git/u-boot/tmp/include/u-boot/zlib.h:1326:21: error: expected ?=?, ?,?, ?;?, ?asm? or ?__attribute__? before ?Z_ARG? make[1]: *** [crc32.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [tools] Error 2

I miss add the zconf.h into the patch...
V2 patch is attached...

Quoted 5 lines

Best regards,

Wolfgang Denk

Thanks,
Lei
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-lib-zlib-update-to-1.2.6.patch
Type: application/octet-stream
Size: 206719 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120307/ac30e7e2/attachment-0001.obj>

#5 lore raw

PATCH 1/1 lib: zlib: update to 1.2.6

Dear Lei Wen,

Quoted 3 lines · In message <CALZhoSSzBhmZ_c79zKBQE7Z5YEtCKC_E-4Vgr35rmBLiV_LawQ@mail.gmail.com>…

I miss add the zconf.h into the patch...
V2 patch is attached...

Argh. Please NEVER send patches as attachments. Always send them inline. See http://www.denx.de/wiki/U-Boot/Patches

Quoted 16 lines

As it copy from zlib home page, the improvement from 1.2.5 to 1.2.6 contains following:

gzread() can now read a file that is being written concurrently gzgetc() is now a macro for increased speed
Added a 'T' option to gzopen() for transparent writing (no compression) Added deflatePending() to return the amount of pending output Allow deflateSetDictionary() and inflateSetDictionary() at any time in raw mode
deflatePrime() can now insert bits in the middle of the stream ./configure now creates a configure.log file with all of the results Added a ./configure --solo option to compile zlib with no dependency on any libraries
Fixed a problem with large file support macros
Fixed a bug in contrib/puff
Many portability improvements

This is a lot of changes / improvements for genral use, but which of these are actually useful for U-Boot?

I. e. what exactly is the motivation to switch to a new version of the code? Do you want to fix any specific bugs, or improve performance, or what?

What I see is that the code size grows by about 2 kB (measured on ARM):

-> bloat-o-meter u-boot-before u-boot-after add/remove: 23/2 grow/shrink: 2/5 up/down: 4523/-2496 (2027)
function old new delta

static.lenfix                                  -    2048   +2048
inflateCopy                                    -     352    +352
updatewindow                                   -     308    +308
inflateSync                                    -     276    +276
inflateSetDictionary                           -     192    +192
static.adler32_combine_                        -     156    +156
inflateReset2                                  -     152    +152
inflateResetKeep                               -     148    +148
static.distfix                                 -     128    +128
inflatePrime                                   -     116    +116
inflateMark                                    -     104    +104
syncsearch                                     -      84     +84
zmemcmp                                        -      68     +68
inflateSyncPoint                               -      64     +64
inflateGetHeader                               -      64     +64
inflate_copyright                              -      47     +47
inflateUndermine                               -      44     +44
inflate                                     5764    5800     +36
zmemzero                                       -      28     +28
zmemcpy                                        -      28     +28
zError                                         -      24     +24
adler32_combine64                              -      20     +20
adler32_combine                                -      20     +20
zlibVersion                                    -      12     +12
zunzip                                       264     268      +4
inflateEnd                                   108     100      -8
inflateInit2_                                264     208     -56

inflate_table 1492 1428 -64
inflateReset 128 48 -80
inflate_fast 1480 1368 -112
distfix 128 - -128
lenfix 2048 - -2048

I wonder which benefits we get for this price we are paying?

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Probably the best operating system in the world  is  the  [operating
system] made for the PDP-11 by Bell Laboratories."
                                           - Ted Nelson, October 1977
author
#6 lore raw

PATCH 1/1 lib: zlib: update to 1.2.6

Hi Wolfgang,

Quoted 9 lines · Wolfgang Denk

Dear Lei Wen,

Quoted 3 lines · In message <CALZhoSSzBhmZ_c79zKBQE7Z5YEtCKC_E-4Vgr35rmBLiV_LawQ@mail.gmail.com>…

I miss add the zconf.h into the patch...
V2 patch is attached...

Argh. ?Please NEVER send patches as attachments. ?Always send them inline. ?See http://www.denx.de/wiki/U-Boot/Patches

Sorry for that again. I send the patch as attachment, which is only for RFC, and another
reason is the patch itself is very huge and almost all content is kept as it is from zlib
main stream. Anyway, I would keep the send patch rule in mind next time.

Quoted 65 lines
Quoted 4 lines

As it copy from zlib home page, the improvement from 1.2.5 to 1.2.6 contains following:

Quoted 13 lines

gzread() can now read a file that is being written concurrently gzgetc() is now a macro for increased speed
Added a 'T' option to gzopen() for transparent writing (no compression) Added deflatePending() to return the amount of pending output Allow deflateSetDictionary() and inflateSetDictionary() at any time in raw mode
deflatePrime() can now insert bits in the middle of the stream ./configure now creates a configure.log file with all of the results Added a ./configure --solo option to compile zlib with no dependency on any libraries
Fixed a problem with large file support macros
Fixed a bug in contrib/puff
Many portability improvements

This is a lot of changes / improvements for genral use, but which of these are actually useful for U-Boot?

I. e. what exactly is the motivation to switch to a new version of the code? ?Do you want to fix any specific bugs, or improve performance, or what?

What I see is that the code size grows by about 2 kB (measured on ARM):

-> bloat-o-meter u-boot-before u-boot-after add/remove: 23/2 grow/shrink: 2/5 up/down: 4523/-2496 (2027) function ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? old ? ? new ? delta static.lenfix ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?- ? ?2048 ? +2048 inflateCopy ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?- ? ? 352 ? ?+352 updatewindow ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? - ? ? 308 ? ?+308 inflateSync ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?- ? ? 276 ? ?+276 inflateSetDictionary ? ? ? ? ? ? ? ? ? ? ? ? ? - ? ? 192 ? ?+192 static.adler32_combine_ ? ? ? ? ? ? ? ? ? ? ? ?- ? ? 156 ? ?+156 inflateReset2 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?- ? ? 152 ? ?+152 inflateResetKeep ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? - ? ? 148 ? ?+148 static.distfix ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? - ? ? 128 ? ?+128 inflatePrime ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? - ? ? 116 ? ?+116 inflateMark ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?- ? ? 104 ? ?+104 syncsearch ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? - ? ? ?84 ? ? +84 zmemcmp ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?- ? ? ?68 ? ? +68 inflateSyncPoint ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? - ? ? ?64 ? ? +64 inflateGetHeader ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? - ? ? ?64 ? ? +64 inflate_copyright ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?- ? ? ?47 ? ? +47 inflateUndermine ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? - ? ? ?44 ? ? +44 inflate ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 5764 ? ?5800 ? ? +36 zmemzero ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? - ? ? ?28 ? ? +28 zmemcpy ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?- ? ? ?28 ? ? +28 zError ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? - ? ? ?24 ? ? +24 adler32_combine64 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?- ? ? ?20 ? ? +20 adler32_combine ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?- ? ? ?20 ? ? +20 zlibVersion ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?- ? ? ?12 ? ? +12 zunzip ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 264 ? ? 268 ? ? ?+4 inflateEnd ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 108 ? ? 100 ? ? ?-8 inflateInit2_ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?264 ? ? 208 ? ? -56 inflate_table ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 1492 ? ?1428 ? ? -64 inflateReset ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 128 ? ? ?48 ? ? -80 inflate_fast ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?1480 ? ?1368 ? ?-112 distfix ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?128 ? ? ? - ? ?-128 lenfix ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?2048 ? ? ? - ? -2048

Quoted 1 line

I wonder which benefits we get for this price we are paying?

The main reason I'd like to introduce this upgrade is for I want to add the compressing
feature for uboot. And the 1.2.6 has some fix for the deflate, so it is maybe a good
base line for introducing it.

Also the reason why I want to enable the compressing is that sometimes we may want to dump whole ram in the uboot, and since the ram grows bigger and bigger, compressing and then send to host is a reasonable method to reduce the dumping time.

How about define a Macro like CONIFG_ENABLE_GZIP_COMPRESSION to compile the compression related code only when this flag is on?

Quoted 4 lines

Best regards,

Wolfgang Denk

Thanks,
Lei

#7 lore raw

PATCH 1/1 lib: zlib: update to 1.2.6

Dear Lei Wen,

Quoted 6 lines · In message <CALZhoSSk3D9UY48ND_6HdZX1N_gP3rq0LP4w1e1M5bp3brzN9Q@mail.gmail.com>…
Quoted 2 lines

I wonder which benefits we get for this price we are paying?

The main reason I'd like to introduce this upgrade is for I want to add the compressing
feature for uboot.

This should be make optional code, including any extensions / additional functions that may be needed for zlib.

Most users will not need this, and they should not suffer (in terms of increased memory footprint) from such a change.

Quoted 3 lines

And the 1.2.6 has some fix for the deflate, so it
is maybe a good
base line for introducing it.

Which exact fix are you referring to?

Quoted 2 lines

How about define a Macro like CONIFG_ENABLE_GZIP_COMPRESSION to compile the compression related code only when this flag is on?

This makes sense, but please use standard naming rules. You will probably provide a "zip" command, so make all this depend on "CONFIG_CMD_ZIP" or so.

Best regards,

Wolfgang Denk

Signature · 9 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
It must be remembered that there is nothing more difficult  to  plan,
more  doubtful  of  success,  nor  more dangerous to manage, than the
creation of a new system. For the initiator has the enmity of all who
would profit by the preservation of the old institutions  and  merely
lukewarm defenders in those who would gain by the new ones.
- Machiavelli
author
#8 lore raw

PATCH 1/1 lib: zlib: update to 1.2.6

Hi Wolfgang,

Quoted 13 lines · Wolfgang Denk

Dear Lei Wen,

Quoted 6 lines · In message <CALZhoSSk3D9UY48ND_6HdZX1N_gP3rq0LP4w1e1M5bp3brzN9Q@mail.gmail.com>…
Quoted 2 lines

I wonder which benefits we get for this price we are paying?

The main reason I'd like to introduce this upgrade is for I want to add the compressing
feature for uboot.

This should be make optional code, including any extensions / additional functions that may be needed for zlib.

Quoted 8 lines

Most users will not need this, and they should not suffer (in terms of increased memory footprint) from such a change.

Quoted 3 lines

And the 1.2.6 has some fix for the deflate, so it
is maybe a good
base line for introducing it.

Which exact fix are you referring to?

I am referring to the zlib 1.2.5->1.2.6 changelog:
Added deflatePending() to return the amount of pending output Allow deflateSetDictionary() and inflateSetDictionary() at any time in raw mode
deflatePrime() can now insert bits in the middle of the stream

Quoted 7 lines
Quoted 3 lines

How about define a Macro like CONIFG_ENABLE_GZIP_COMPRESSION to compile the compression related code only when this flag is on?

This makes sense, but please use standard naming rules. ?You will probably provide a "zip" command, so make all this depend on "CONFIG_CMD_ZIP" or so.

Yep, that is also what I am thinking.

Quoted 4 lines

Best regards,

Wolfgang Denk

Thanks,
Lei

#9 lore raw

PATCH 1/1 lib: zlib: update to 1.2.6

Dear Lei Wen,

Quoted 5 lines · In message <CALZhoSRc1aV2JDqiZv5htDdQw28D8wn4pNSU3E9SanBwc7C1Dg@mail.gmail.com>…
Quoted 5 lines
Quoted 4 lines

And the 1.2.6 has some fix for the deflate, so it
is maybe a good
base line for introducing it.

Quoted 7 lines
Quoted 1 line

Which exact fix are you referring to?

I am referring to the zlib 1.2.5->1.2.6 changelog:
Added deflatePending() to return the amount of pending output Allow deflateSetDictionary() and inflateSetDictionary() at any time in raw mode
deflatePrime() can now insert bits in the middle of the stream

Are any of these relevant to U-Boot code? To me it looks more like extensions (which we do not use and thus not need) than bug fixes. But I may be wrong. Do you think it's fixes?

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Committee, n.:  A group of men who individually can do nothing but as
a group decide that nothing can be done.                 - Fred Allen