Skip to content
This repository has been archived by the owner on Feb 5, 2022. It is now read-only.

Update zlib port to latest #1

Open
VirtualTim opened this issue May 30, 2019 · 7 comments
Open

Update zlib port to latest #1

VirtualTim opened this issue May 30, 2019 · 7 comments

Comments

@VirtualTim
Copy link

Currently this port is based off 1.2.8 (2013), the latest zlib is 1.2.11 (2017). Could be good to upgrade?

Source is on github (https://github.com/madler/zlib), so hopefully shouldn't be too hard to merge changes in.

@tamusjroyce
Copy link

"-s USE_ZLIB=1" downloads https://github.com/emscripten-ports/zlib/archive/version_1.zip which was built Oct 28, 2014...

@jonnerloller
Copy link

jonnerloller commented Jun 7, 2019

Hi. I'm new to contributing and I wasn't too sure If what I'm doing is right.
But, I tried downloading the latest zlib and latest emscripten, and I'm running into
error: asm2wasm seeing an invalid argument type at index 1 (this will not validate) in call from $_gz_open to $_lseek (this is likely due to undefined behavior in C, like defining a function one way and calling it in another, which is important to fix)
As far as I can tell, it's due to Emscripten issue #8467.

I'm not 100% sure, but The "linked library" is always linking (func $_lseek (; 153 ;) (param $$0 i32) (param $$1 i32) (param $$2 i32) (result i32), but because off_t is now defined as a Int64, instead of an int, the application is trying to pass it a Int64, and the library is expecting a int

Any suggestions as to what I can do to help would be cool.

@VirtualTim
Copy link
Author

I would personally have started with diffing this repository and the 1.2.8 source, then applying that diff to 1.2.11. That would be a lot easier than trying to redo everything from scratch.

@jonnerloller
Copy link

I've been building zlib 1.2.11 for emscripten for a while now, and it used to always work fine, basically until the the recent changes about a month or 2 ago. i.e Zlib 1.2.11 on emscripten 1.38.28 works more or less out of the box.
Only recently a colleague notified me that it was breaking on the latest, so I went to investigate.

Should we support zlib 1.2.11 for both the older and the newer version of emscripten? or just the newer versions?

@kripken
Copy link
Member

kripken commented Jun 7, 2019

I think we can focus just on newer versions.

@kleisauke
Copy link

fwiw, it might be worth checking out https://github.com/zlib-ng/zlib-ng instead. It can possibly give a nice speed-up on test_zlib_benchmark.c in combination with the SIMD proposal for WebAssembly (untested).

It's API / ABI compatible with zlib (when configured with --zlib-compat or -DZLIB_COMPAT=ON). There is no "stable" release for zlib-ng yet, so it might be too risky to migrate now.

@vadimkantorov
Copy link

yep, this zlib is quite dated :(

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants