rust-lang / rustc_codegen_cranelift

Cranelift based backend for rustc
Apache License 2.0
1.63k stars 101 forks source link

Can I make it build the build script with LLVM, but the main projech with Cranelift? #1529

Closed vi closed 2 months ago

vi commented 2 months ago

How do I take advantage of cranelift codegen speedup in a project that uses lalrpop in a build script?

When a project (e.g. Nickel) has a lalrpop in build script, the build script should be build with optimisations even when other parts are built for debugging.

This is possible with Cargo profile overrides and results in a reasonable debug build time.

However, when I use cg_clif mode I get compilation stuck in running the build script even with profile overrides.

Can I switch Cranelift mode off for build script, just like the optimisation level in overridden profile?

bjorn3 commented 2 months ago
[profile.dev.build-override]
codegen-backend = "llvm"

should work if you use cg_clif from rustup.