Skip to content

Large .mem file with LLVM upstream/wasm2js #8999

@cwoffenden

Description

@cwoffenden

Building asm.js with the new LLVM can result in a much larger .mem file. Here's a standalone test:

#include <stdio.h>

char buf[4 * 1024 * 1024];

int main() {
    for (int n = sizeof buf; n > 0; n--) {
        buf[n] = n & 63;
    }
    printf("%d\n", buf[0]);
    return 0;
}

Compile using emcc test.c -Os -s WASM=0 -o out.js. With latest-upstream the resulting out.js.mem is 4196767 bytes, and with Fastcomp (latest) it's 973 bytes.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions