Skip to content

Couple of changes to make it easier to compile rustc for wasm - #130899

Merged
bors merged 3 commits into
rust-lang:masterfrom
bjorn3:wasi_bootstrap_fixes
Oct 7, 2024
Merged

Couple of changes to make it easier to compile rustc for wasm#130899
bors merged 3 commits into
rust-lang:masterfrom
bjorn3:wasi_bootstrap_fixes

Conversation

@bjorn3

Copy link
Copy Markdown
Member

This is a subset of the patches I have on my rust fork to compile rustc for wasm32-wasip1.

This is a subset of the patches I have on my rust fork to compile rustc
for wasm32-wasip1.
@rustbot

Copy link
Copy Markdown
Collaborator

r? @davidtwco

rustbot has assigned @davidtwco.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbotrustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 26, 2024
@bjorn3

Copy link
Copy Markdown
MemberAuthor

cc rust-lang/miri#722

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@bjorn3
bjorn3force-pushed the wasi_bootstrap_fixes branch from dd7dfe8 to ee6d837CompareOctober 4, 2024 10:05
@rust-log-analyzer

This comment has been minimized.

@bjorn3
bjorn3force-pushed the wasi_bootstrap_fixes branch from ee6d837 to bf1f5c9CompareOctober 4, 2024 10:26
@bjorn3

Copy link
Copy Markdown
MemberAuthor

Added a couple more fixes.

@davidtwco

Copy link
Copy Markdown
Member

@bors r+

@bors

bors commented Oct 7, 2024

Copy link
Copy Markdown
Collaborator

📌 Commit bf1f5c9 has been approved by davidtwco

It is now in the queue for this repository.

@borsbors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 7, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 7, 2024
…kingjubilee
Rollup of 7 pull requests
Successful merges:
- rust-lang#128721 (Don't allow the `#[pointee]` attribute where it doesn't belong)
- rust-lang#130479 (skip in-tree compiler build for llvm-bitcode-linker if ci-rustc is on)
- rust-lang#130899 (Couple of changes to make it easier to compile rustc for wasm)
- rust-lang#131225 (`rustc_borrowck` memory management tweaks)
- rust-lang#131351 (Remove valgrind test suite and support from compiletest, bootstrap and opt-dist)
- rust-lang#131359 (Fix used_underscore_binding in rustc_serialize)
- rust-lang#131367 (Mark Boxy as on vacation)
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit 31fbf67 into rust-lang:masterOct 7, 2024
@rustbotrustbot added this to the 1.83.0 milestone Oct 7, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Oct 7, 2024
Rollup merge of rust-lang#130899 - bjorn3:wasi_bootstrap_fixes, r=davidtwco
Couple of changes to make it easier to compile rustc for wasm
This is a subset of the patches I have on my rust fork to compile rustc for wasm32-wasip1.
@bjorn3
bjorn3 deleted the wasi_bootstrap_fixes branch October 12, 2024 16:42
@onur-ozkan

Copy link
Copy Markdown
Contributor

Apparently this is being problem for cross compilations (#135796, #133629).

@bjorn3

Copy link
Copy Markdown
MemberAuthor

I'm guessing this didn't fail in CI as we default to using rpaths, while these distros/OSes don't?

@onur-ozkan

Copy link
Copy Markdown
Contributor

Most likely yeah.

Comment on lines -1688 to +1703
cargo.arg("-Zdual-proc-macros");
rustflags.arg("-Zdual-proc-macros");
let error = command(self.rustc(compiler))
.arg("--target")
.arg(target.rustc_target_arg())
.arg("--print=file-names")
.arg("--crate-type=proc-macro")
.arg("-")
.run_capture(self)
.stderr();
let not_supported = error
.lines()
.any(|line| line.contains("unsupported crate type `proc-macro`"));
if !not_supported {
cargo.arg("-Zdual-proc-macros");
rustflags.arg("-Zdual-proc-macros");
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would adding rpath check here fix the regression?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

I think self.rustc() may be missing code to set LD_LIBRARY_PATH. If LD_LIBRARY_PATH is set correctly it should work even with rpath disabled.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@bjorn3@rustbot@rust-log-analyzer@davidtwco@bors@onur-ozkan