Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions conan_config/profiles/emsdk/.base
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ compiler.cppstd=17
compiler.libcxx=libc++
# Choose between both types of multithreading support (or none)
# compiler.threads=<posix|wasm_workers>
compiler.version=5.0.3
compiler.version=6.0.6
os=Emscripten

[tool_requires]
ninja/[*]
emsdk/5.0.3
emsdk/6.0.6

[conf]
tools.build:exelinkflags+=['-sALLOW_MEMORY_GROWTH=1']
Expand Down
31 changes: 28 additions & 3 deletions conan_config/profiles/emsdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,39 @@ $ conan build <path> -pr emsdk/wasm32

### ⚠️ WASM64 caveats:

The latest `node` version `emsdk/5.0.3` installs is the `22.16.0`, which can not run directly wasm64 binaries.
Also, it is not valid to compile wasm64 with `-sMIN_NODE_VERSION=221600`, see following error:
**Conan 2.31.0 or newer is recommended for `wasm64` with `emsdk/6.x`.** Emscripten
6.0.0 added the standard `-m64` flag as an alias for the legacy `-sMEMORY64`
setting, and 6.0.1 deprecated `-sMEMORY64`; Conan learned to prefer `-m64` for
`compiler.version >= 6.0.0` in
[conan-io/conan#20152](https://github.com/conan-io/conan/pull/20152), first
released in 2.31.0. Older Conan still builds — the emitted flag is deprecated,
not removed — but every `wasm64` compile and link reports:

```
em++: warning: MEMORY64 is deprecated (prefer the standard -m64 or --target=wasm64 flags). [-Wdeprecated]
```

The recipe's `required_conan_version` is deliberately **not** raised for this: it
is shared with `emsdk/5.0.3`, where `-sMEMORY64` remains the correct flag, and
`wasm32` is unaffected on every version. This is a recommendation for one
architecture on one SDK series, not a floor for the package.

The `node` bundled with the SDK is what decides whether a `wasm64` binary can be
run at all, and it needs `node/23` or newer — `-sMIN_NODE_VERSION` below 230000
is rejected outright:

```
em++: warning: MIN_NODE_VERSION=221600 is not compatible with MEMORY64 (230000 or above required) [-Wcompatibility]
```

Thus, to be able to run an `wasm64` binary you will need to download at least `node/23` manually in your system.
This differs by SDK series:

| SDK | bundled `node` | runs `wasm64` directly |
|---|---|---|
| `emsdk/5.0.3` | 22.16.0 | no — install `node/23+` separately |
| `emsdk/6.0.6` | 24.19.0 | yes |

So the manual `node` step is only needed on the 5.x series.

### 🧠 Dynamic Memory Allocation

Expand Down
3 changes: 2 additions & 1 deletion conan_config/profiles/emsdk/wasm64
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ arch=wasm64
tools.build:exelinkflags+=['-sMAXIMUM_MEMORY=16GB', '-sINITIAL_MEMORY=16GB', '-sASSERTIONS']
tools.build:sharedlinkflags+=['-sMAXIMUM_MEMORY=16GB', '-sINITIAL_MEMORY=16GB', '-sASSERTIONS']

# Node version from emsdk/5.0.3 can not run a wasm64 binary. See more details in README
# emsdk/6.0.6 bundles node 24.19.0, which runs wasm64 binaries directly. The
# 5.x series bundles node 22.16.0, which does not. See more details in README
3 changes: 3 additions & 0 deletions recipes/emsdk/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ sources:
"5.0.3":
url: "https://github.com/emscripten-core/emsdk/archive/5.0.3.tar.gz"
sha256: "9a44a58bca0a3ea594ea7340d9a726cb58c772144dd37406d1c4e921823a75eb"
"6.0.6":
url: "https://github.com/emscripten-core/emsdk/archive/6.0.6.tar.gz"
sha256: "ce6a639f150493bb827a809ff20bcf727dffba2cfb28b019e14d59a6b7ead26e"
2 changes: 2 additions & 0 deletions recipes/emsdk/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
versions:
"5.0.3":
folder: all
"6.0.6":
folder: all