[wasm][bcl] Use zlib for DeflateStream on WASM profile (#14308)
* [wasm][bcl] Use zlib for DeflateStream on WASM profile
- Add `-s USE-ZLIB=1` flag for the emscripten build of `mono.js`
- Add new `zlib-helper` module build that is included in the `mono` wasm build.
- This adds roughly 300 kb to the size.
* Add zlib calls to `icall` for `WASM` profile
* Address comments use `TARGET_WASM` instead of `HOST_WASM`
* Hack around JS exception: RuntimeError: indirect call signature mismatch
- Instead of using the function pointer from DeflateStream (Marshal.GetFunctionPointerForDelegate) obtain the callback functions from the object itself.
* Update error messages and add exception parameter to `mono_runtime_invoke`.
* Add `mono/support` zlib include sources files to make `package` target.
* Add `zlib-helper` build to packager.
- Note: Right now only supports zlib build from mono tree build.
- Add `zlibtest.cs` scenario to compress and uncompress using DeflateStream and GZip.
- Add test to make file to build and run aot version of ziplibtest.
* Add copy of zlib header support files to `package-wasm-runtime`
- The support library is not built for wasm but the zlib include files are needed to build support during wasm build.
- See mono.js build and the use of the `-s USE_ZLIB=1` flag.
- The include files will be used in packager.exe to build zlib support for wasm.
* Use the zlib includes from support to build the zlib support.
* Setup base tests for testing System.IO.Compression integration
* Formatting
* Add more ziparchive tests
* Formatting and indentation
* Add more Zip tests
* Add more tests.
- Add more tests for ZipArchive.
- Add tests for Deflate - small, large and very large strings.
- Add tests for GZipStream - small, large and very large strings.
* Fix merge of EMCC_FLAGS
* Add new option to packager to enable the use of zlib
- --enable-zlib (enable the use of zlib for System.IO.Compression support)
type: bool default: false
- update packager doc
* Address review comments
- Change `enable-zlib` to `zlib`
17 files changed: