From a4b31d4966a55e252cfc871b0e8e632a73e8f4b9 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Wed, 23 Nov 2022 10:43:20 +0100 Subject: [PATCH] WASM add a note about memory required for linking Signed-off-by: Michael Stahl Change-Id: Ic7f2cffdeb4408a9f726ad70a8ceb8db372787d9 --- wasm/README | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wasm/README b/wasm/README index fae99697e..acc125c64 100644 --- a/wasm/README +++ b/wasm/README @@ -8,6 +8,12 @@ Note that there are wrapper tools like "emconfigure", "emmake", "emcmake" that tend to set up environment variables like CC properly, although some project's build system unfortunately override that. +Linking WASM executable uses a lot of memory; without optimisations or with -O1 +in LDFLAGS, /usr/bin/time prints "1660068maxresident" which should work +anywhere, but with -O2 in LDFLAGS (which is the default) some LTO happens that +uses about 8x as much RAM, "12261016maxresident" or ~12 GiB... so append +CXXFLAGS='-g -O1' or similar to the configure invocation if out of memory. + For convenience it's recommended to build with a docker container that has the required build tools.