From bf70d25947832e221dd4ebe07bde8bf186592870 Mon Sep 17 00:00:00 2001 From: Alex Radetsky Date: Tue, 24 May 2022 14:46:34 +0300 Subject: [PATCH] Compiler optimization level for building WasmThemis (#919) * optimize libthemis.js with compiler * update package.json for wasm-themis * Update CHANGELOG.md Co-authored-by: vixentael --- CHANGELOG.md | 4 ++++ src/wrappers/themis/wasm/package.json | 2 +- src/wrappers/themis/wasm/wasmthemis.mk | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa0f69db4..049426f87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ Changes that are currently in development and have not been released yet. +## [0.14.6](https://github.com/cossacklabs/themis/releases/tag/0.14.6), May 24th 2022 + +**Reduce WasmThemis binary size x3, by increasing the compiler optimization level for WasmThemis build ([919](https://github.com/cossacklabs/themis/pull/919/)).** + ## [0.14.5](https://github.com/cossacklabs/themis/releases/tag/0.14.5), April 14th 2022 **Typescript compatibility issues in WasmThemis** diff --git a/src/wrappers/themis/wasm/package.json b/src/wrappers/themis/wasm/package.json index 097fd9485..a0bd4b5d3 100644 --- a/src/wrappers/themis/wasm/package.json +++ b/src/wrappers/themis/wasm/package.json @@ -1,6 +1,6 @@ { "name": "wasm-themis", - "version": "0.14.5", + "version": "0.14.6", "description": "Themis is a convenient cryptographic library for data protection.", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/wrappers/themis/wasm/wasmthemis.mk b/src/wrappers/themis/wasm/wasmthemis.mk index 33656bbd1..b8ef13ac5 100644 --- a/src/wrappers/themis/wasm/wasmthemis.mk +++ b/src/wrappers/themis/wasm/wasmthemis.mk @@ -39,7 +39,7 @@ $(BIN_PATH)/libthemis.js: LDFLAGS += -s LINKABLE=1 $(BIN_PATH)/libthemis.js: LDFLAGS += -s ERROR_ON_UNDEFINED_SYMBOLS=0 $(BIN_PATH)/libthemis.js: LDFLAGS += --pre-js $(WASM_PRE_JS) -$(BIN_PATH)/libthemis.js: CMD = $(CC) -o $@ $(filter %.o %a, $^) $(LDFLAGS) +$(BIN_PATH)/libthemis.js: CMD = $(CC) -o $@ $(filter %.o %a, $^) -O3 $(LDFLAGS) $(BIN_PATH)/libthemis.js: $(THEMIS_STATIC) $(WASM_RUNTIME) $(WASM_PRE_JS) @mkdir -p $(@D)