-
Notifications
You must be signed in to change notification settings - Fork 13k
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
compiling for msp430 doesn't work with multiple codegen units #45000
Comments
(#44853 changed the default number of codegen units to 32 when compiling without optimizations) |
This change probably also broke the NVPTX target (haven't checked yet). If that's the case we should also change the number of codegen units for that target to 1. |
This target has a very small memory size, so the programs for this target are usually small and don't suffer much from slow compilation time. |
Some targets, like msp430 and nvptx, don't work with multiple codegen units right now for bugs or fundamental reasons. To expose this allow targets to express a default. Closes rust-lang#45000
rustc: Allow target-specific default cgus Some targets, like msp430 and nvptx, don't work with multiple codegen units right now for bugs or fundamental reasons. To expose this allow targets to express a default. Closes #45000
Background: For this target the LLVM backend doesn't support producing object files so we do something slightly different: rustc uses LLVM to produce an assembly file for each crate, then it calls
msp430-elf-gcc
to assemble that file into an object file and makes an rlib out of that.With multiple codegen units we don't quite do the right thing right now because rustc produces N assembly files and then tries to create a single object file, with the wrong file path:
To support multiple codegen units rustc would have to invoke gcc once per assembly file. Which means calling it 32 times in this case. Thus increasing codegen units with this target is likely to slow down the build process.
Alex suggested tweaking this particular target to use a single codegen unit; at least until the LLVM backend learns how to generate object files.
cc @alexcrichton @pftbest
The text was updated successfully, but these errors were encountered: