Skip to content

lto optimization not usable for wasm #18

@KaruroChori

Description

@KaruroChori

Somehow, the lto optimizations are breaking the wasm build.
This might be related to limits of the stack being reached.

RuntimeError: Out of bounds memory access (evaluating 'instance.exports')
      at vs.templ.js.wasm-function[_GLOBAL__sub_I_pugixml.cpp]
      at vs.templ.js.wasm-function[__wasm_call_ctors]
      at vs.templ.js.wasm-function[_start]
      at start (node:wasi:1023:26)
      at /archive/shared/projects/vs.templ/build/vs.templ.js:49:11

The solution would be to ask for a bigger stack, but I don't know how to do that in zig cc and the usual -stack-size=xxxx is not working.
If implemented, lto optimization would result in a blob going from 6.5MB to 4.4MB which is very substantial.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions