Browse Source

Don't export ZSTD_ symbols (reduce wasm size)

Fabian 2 years ago
parent
commit
e6c725bf54
2 changed files with 2 additions and 1 deletions
  1. 1 0
      Makefile
  2. 1 1
      src/cpu.js

+ 1 - 0
Makefile

@@ -207,6 +207,7 @@ build/zstddeclib.o: lib/zstd/zstddeclib.c
 	mkdir -p build
 	clang -c -Wall \
 	    --target=wasm32 -O3 -flto -nostdlib -fvisibility=hidden -ffunction-sections -fdata-sections \
+	    -DZSTDLIB_VISIBILITY="" \
 	    -o build/zstddeclib.o \
 	    lib/zstd/zstddeclib.c
 

+ 1 - 1
src/cpu.js

@@ -198,7 +198,7 @@ CPU.prototype.create_jit_imports = function()
 
     for(let name of Object.keys(this.wm.exports))
     {
-        if(name.startsWith("_") || name.startsWith("ZSTD") || name.startsWith("zstd") || name.endsWith("_js"))
+        if(name.startsWith("_") || name.startsWith("zstd") || name.endsWith("_js"))
         {
             continue;
         }