Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow disabling the host-arch feature of cranelift-codegen #7369

Merged

Conversation

bjorn3
Copy link
Contributor

@bjorn3 bjorn3 commented Oct 25, 2023

This is required to compile for a target which doesn't have a cranelift backend. Before this change using any of the cranelift crates that depend on cranelift-codegen would forcefully enable all default features and thus host-arch. With this change only the std and unwind features are still forcefully enabled as cranelift-codegen doesn't compile with either disabled.

Required for rust-lang/rust#81746

@bjorn3 bjorn3 requested a review from a team as a code owner October 25, 2023 19:25
@bjorn3 bjorn3 requested review from alexcrichton and removed request for a team October 25, 2023 19:25
@bjorn3
Copy link
Contributor Author

bjorn3 commented Oct 25, 2023

Without the unwind feature enabled I get:

error[E0433]: failed to resolve: could not find `systemv` in `unwind`
    --> cranelift/codegen/src/machinst/vcode.rs:1181:41
     |
1181 |                     crate::isa::unwind::systemv::caller_sp_to_cfa_offset();
     |                                         ^^^^^^^ could not find `systemv` in `unwind`

@bjorn3
Copy link
Contributor Author

bjorn3 commented Oct 25, 2023

It would be great if this could get backported too. Without this rust's CI fails when trying to build cg_clif for distribution with rustup.

@alexcrichton
Copy link
Member

Thanks! I'm a little surprised that the dependency from wasmtime-cranelift on the cranelift crate, without features = ['default'], still works. I think it's because without any enabled ISAs it still builds the host ISA? Mind adding it there though to be safe?

Otherwise yeah looks like disabling the unwind feature and not being able to compile is indeed a Cranelift bug. If you'd like feel free to open an issue (or a subsequent PR) to fix that. Enabling it here by default is definitely ok.

Also a point release is fine by me, and there's one slated tomorrow for #7362 as well so good timing!

If you wouldn't mind preparing the PR for the backport that'd be appreciated!

This is required to compile for a target which doesn't have a cranelift
backend. Before this change using any of the cranelift crates that
depend on cranelift-codegen would forcefully enable all default features
and thus host-arch. With this change only the std and unwind features
are still forcefully enabled as cranelift-codegen doesn't compile with
either disabled.
@bjorn3 bjorn3 force-pushed the allow_disabling_host_arch branch from abf0105 to e3e38cb Compare October 25, 2023 19:33
@bjorn3 bjorn3 requested a review from a team as a code owner October 25, 2023 19:33
@bjorn3
Copy link
Contributor Author

bjorn3 commented Oct 25, 2023

Mind adding it there though to be safe?

Done

If you'd like feel free to open an issue (or a subsequent PR) to fix that.

Sure

If you wouldn't mind preparing the PR for the backport that'd be appreciated!

Will do.

@alexcrichton alexcrichton added this pull request to the merge queue Oct 25, 2023
Merged via the queue into bytecodealliance:main with commit 23031e3 Oct 25, 2023
18 checks passed
@bjorn3 bjorn3 deleted the allow_disabling_host_arch branch October 25, 2023 21:28
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