Skip to content

Conversation

perseoGI
Copy link
Contributor

@perseoGI perseoGI commented Jun 9, 2025

Changelog: Feature: Added first class citizen emscripten support (new wasm64 architecture + emcc).
Docs: conan-io/docs#4115
Examples2: conan-io/examples2#184

This PR adds updated support to wasm (32 bits) and asm.js and introduces new architecture wasm64.

@perseoGI perseoGI added this to the 2.18.0 milestone Jun 9, 2025
@memsharded memsharded self-assigned this Jun 9, 2025
Copy link
Member

@memsharded memsharded left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking very good!
Tests on Windows are failing, as expected, as Emscripten not installed there.

compiler.version=4.0.10
os=Emscripten

[platform_tool_requires]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be necessary if we are using the emscripten installed in the machines, better remove it

@memsharded memsharded merged commit 395d737 into develop2 Jun 12, 2025
15 checks passed
@memsharded memsharded deleted the pgi/feature/emscripten branch June 12, 2025 09:25
memsharded added a commit that referenced this pull request Jun 20, 2025
Changelog: Feature: new linker flags autodetected by conan based on
profile architecture
Docs: omit

In #18432 native `asmjs`
architecture support was introduced.
To enable `asmjs` code generation the `-sWASM=0` flag needs to be passed
to the `emscripten linker`.

That flag was added in `architecture_flag` without noticing that those
flags were being passed to both compiler and linker across all
toolchains.
This was causing the compiler to throw warnings as this flag is only
understood by the linker:

```
em++: warning: linker setting ignored during compilation: 'WASM' [-Wunused-command-line-argument]
```
Having a compilation warning is not desirable as a compilation with
warning as errors will result in a build failure:

```
em++: error: linker setting ignored during compilation: 'WASM' [-Wunused-command-line-argument] [-Werror]
```

This PR aims to address this issue by creating a new
`architecture_link_flags` which will return the required flags **only**
for the linker based on the profile architecture.

This function will be called by several toolchains which will bypass the
result to the final linker by setting `LD_FLAGS`.

#### Tests

The current
[`test_emcc`](https://github.com/conan-io/conan/blob/92b606909bd4fe04f5b3ea515130d31a8f0481da/test/functional/toolchains/emscripten/test_emcc.py)
test suite already tests this new functionality added.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants