Skip to content

fix(api,c-api,vm) Move .cargo/config into crates - #2475

Closed
Hywan wants to merge 2 commits into
wasmerio:masterfrom
Hywan:fix-1939
Closed

Hywan wants to merge 2 commits into
wasmerio:masterfrom
Hywan:fix-1939

Conversation

@Hywan

@Hywan Hywan commented Jul 16, 2021 •

Copy link
Copy Markdown
Contributor

Description

Rework of #1939.

We need to pass the -Wl,-E arguments to the linker when compiling wasmer, wasmer_c_api and wasmer_vm. It was done generally with a .cargo/config.toml file but it was local to our project, i.e. it was not used when Wasmer was a dependency of another project.

So we move the content of .cargo/config.toml to the respective Cargo.toml files.

Fixes #1939.
Fixes #1928.
Fixes #2107.

Review

  • Add a short description of the change to the CHANGELOG.md file not necessary I guess.

@Hywan Hywan added bug Something isn't working 📦 lib-c-api About wasmer-c-api 📦 lib-api About wasmer 📦 lib-vm About wasmer-vm labels Jul 16, 2021
@Hywan Hywan self-assigned this Jul 16, 2021
@Hywan

Hywan commented Jul 16, 2021

Copy link
Copy Markdown
Contributor Author

bors try

bors Bot added a commit that referenced this pull request Jul 16, 2021
@Hywan Hywan mentioned this pull request Jul 16, 2021
1 task
@bors

bors Bot commented Jul 16, 2021

Copy link
Copy Markdown
Contributor

try

Build failed:

@syrusakbary

syrusakbary commented Jul 16, 2021 •

Copy link
Copy Markdown
Member

I had no idea this was possible.
I think we might need to add to the wasmer_vm as well (not sure how to fix it)

@Hywan

Hywan commented Jul 19, 2021

Copy link
Copy Markdown
Contributor Author

@Hywan

Hywan commented Jul 19, 2021

Copy link
Copy Markdown
Contributor Author

I believe we must write build.rs scripts that emit a https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-libkindname.

@Hywan

Hywan commented Jul 19, 2021

Copy link
Copy Markdown
Contributor Author

Er, we can't configure RUSTFLAGS with a build.rs script, and my previous idea of using cargo-rustc-link-lib is wrong.

@Hywan Hywan changed the title fix(api,c-api,vm) Move .cargo/config to Cargo.tomls fix(api,c-api,vm) Move .cargo/config into crates Jul 19, 2021
@Hywan

Hywan commented Jul 19, 2021 •

Copy link
Copy Markdown
Contributor Author

Reference issue, rust-lang/cargo#9426.

@Hywan

Hywan commented Jul 20, 2021

Copy link
Copy Markdown
Contributor Author

What we need exactly is rust-lang/cargo#9557: The rustc-link-arg option.

I'm going to try with rustc-cdylib-link-arg which is stable now, but is going to be renamed rustc-link-arg-cdylib in the future if I've understood everything correctly.

@Hywan

Hywan commented Jul 20, 2021

Copy link
Copy Markdown
Contributor Author

bors try

bors Bot added a commit that referenced this pull request Jul 20, 2021
@bors

bors Bot commented Jul 20, 2021

Copy link
Copy Markdown
Contributor

try

Build failed:

@Hywan

Hywan commented Jul 20, 2021

Copy link
Copy Markdown
Contributor Author

bors try

bors Bot added a commit that referenced this pull request Jul 20, 2021
@bors

bors Bot commented Jul 20, 2021

Copy link
Copy Markdown
Contributor

try

Build failed:

@Hywan

Hywan commented Jul 20, 2021

Copy link
Copy Markdown
Contributor Author

Nah, we need to wait :-).

@syrusakbary

Copy link
Copy Markdown
Member

Should we close this PR @Hywan ?

@Hywan

Hywan commented Jul 23, 2021

Copy link
Copy Markdown
Contributor Author

We can keep it open and wait on Rust.

@wchaudry wchaudry closed this Oct 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working 📦 lib-api About wasmer 📦 lib-c-api About wasmer-c-api 📦 lib-vm About wasmer-vm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Failure to load LLVM-compiled WASM: undefined symbol: wasmer_raise_trap Undefined reference to wasmer_raise_trap when using native runtime

3 participants