-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Add a new config flag, dist.include-mingw-linker. #108581
Conversation
The flag controls whether to copy the linker, DLLs, and various libraries from MinGW into the rustc toolchain. It applies only when the host or target is pc-windows-gnu. The flag is true by default to preserve existing behavior.
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @ozkanonur (or someone else) soon. Please see the contribution instructions for more information. |
Follow-up from #108140. See discussion there for additional context. |
from #108140 r? @Mark-Simulacrum |
To clarify a previous comment: It's not necessary to copy libgcc_s_seh-1.dll and libwinpthread-1.dll, but if you do not, they need to be discoverable on the path in order to bootstrap and use the toolchain. |
r? @mati865 or @petrochenkov -- I want to confirm there are no concerns in terms of rustc expecting these particular files to be in a particular place. r=me on the diff itself |
Failed to set assignee to
|
As jfgoog said those executables and DLLs need to be available in PATH. So for downstream vendors having them duplicated by Rust only creates problems. In such cases these files are expected to be in proper locations already. I don't have time to take deeper look but in overall this looks good to me. |
@bors r+ |
Thanks! And, special thanks to mati865 for patiently explaining why I was wrong about the previous PR. |
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#108460 (migrate `rustc_hir_analysis` to session diagnostic [Part Two]) - rust-lang#108581 (Add a new config flag, dist.include-mingw-linker.) - rust-lang#108583 (Account for binders correctly when adding default RPITIT method assumption) - rust-lang#108783 (Sync rustc_codegen_gcc 2023/03/04) - rust-lang#108793 (Append to existing `PYTHONPATH` in compiletest instead of overwriting) - rust-lang#108822 (Remove references to PassManagerBuilder) - rust-lang#108866 (Force to use the stage 2 compiler when config.download_rustc is set) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
…o-dist, r=Mark-Simulacrum Move MinGW linker dist option to proper section Using this option currently results in the error: ``` failed to parse TOML configuration 'config.toml': unknown field `include-mingw-linker`, expected one of `optimize`, `debug`, `codegen-units`, `codegen-units-std`, `debug-assertions`, `debug-assertions-std`, `overflow-checks`, `overflow-checks-std`, `debug-logging`, `debuginfo-level`, `debuginfo-level-rustc`, `debuginfo-level-std`, `debuginfo-level-tools`, `debuginfo-level-tests`, `split-debuginfo`, `run-dsymutil`, `backtrace`, `incremental`, `parallel-compiler`, `default-linker`, `channel`, `description`, `musl-root`, `rpath`, `verbose-tests`, `optimize-tests`, `codegen-tests`, `omit-git-hash`, `dist-src`, `save-toolstates`, `codegen-backends`, `lld`, `use-lld`, `llvm-tools`, `deny-warnings`, `backtrace-on-ice`, `verify-llvm-ir`, `thin-lto-import-instr-limit`, `remap-debuginfo`, `jemalloc`, `test-compare-mode`, `llvm-libunwind`, `control-flow-guard`, `new-symbol-mangling`, `profile-generate`, `profile-use`, `download-rustc`, `lto`, `validate-mir-opts` for key `rust` ``` That's because the option [belongs to `dist` section](https://github.com/rust-lang/rust/blob/bef6ff618f17398775e9d8cd23a6f47d983869dc/src/bootstrap/config.rs#L861). cc rust-lang#108581
…o-dist, r=Mark-Simulacrum Move MinGW linker dist option to proper section Using this option currently results in the error: ``` failed to parse TOML configuration 'config.toml': unknown field `include-mingw-linker`, expected one of `optimize`, `debug`, `codegen-units`, `codegen-units-std`, `debug-assertions`, `debug-assertions-std`, `overflow-checks`, `overflow-checks-std`, `debug-logging`, `debuginfo-level`, `debuginfo-level-rustc`, `debuginfo-level-std`, `debuginfo-level-tools`, `debuginfo-level-tests`, `split-debuginfo`, `run-dsymutil`, `backtrace`, `incremental`, `parallel-compiler`, `default-linker`, `channel`, `description`, `musl-root`, `rpath`, `verbose-tests`, `optimize-tests`, `codegen-tests`, `omit-git-hash`, `dist-src`, `save-toolstates`, `codegen-backends`, `lld`, `use-lld`, `llvm-tools`, `deny-warnings`, `backtrace-on-ice`, `verify-llvm-ir`, `thin-lto-import-instr-limit`, `remap-debuginfo`, `jemalloc`, `test-compare-mode`, `llvm-libunwind`, `control-flow-guard`, `new-symbol-mangling`, `profile-generate`, `profile-use`, `download-rustc`, `lto`, `validate-mir-opts` for key `rust` ``` That's because the option [belongs to `dist` section](https://github.com/rust-lang/rust/blob/bef6ff618f17398775e9d8cd23a6f47d983869dc/src/bootstrap/config.rs#L861). cc rust-lang#108581
…o-dist, r=Mark-Simulacrum Move MinGW linker dist option to proper section Using this option currently results in the error: ``` failed to parse TOML configuration 'config.toml': unknown field `include-mingw-linker`, expected one of `optimize`, `debug`, `codegen-units`, `codegen-units-std`, `debug-assertions`, `debug-assertions-std`, `overflow-checks`, `overflow-checks-std`, `debug-logging`, `debuginfo-level`, `debuginfo-level-rustc`, `debuginfo-level-std`, `debuginfo-level-tools`, `debuginfo-level-tests`, `split-debuginfo`, `run-dsymutil`, `backtrace`, `incremental`, `parallel-compiler`, `default-linker`, `channel`, `description`, `musl-root`, `rpath`, `verbose-tests`, `optimize-tests`, `codegen-tests`, `omit-git-hash`, `dist-src`, `save-toolstates`, `codegen-backends`, `lld`, `use-lld`, `llvm-tools`, `deny-warnings`, `backtrace-on-ice`, `verify-llvm-ir`, `thin-lto-import-instr-limit`, `remap-debuginfo`, `jemalloc`, `test-compare-mode`, `llvm-libunwind`, `control-flow-guard`, `new-symbol-mangling`, `profile-generate`, `profile-use`, `download-rustc`, `lto`, `validate-mir-opts` for key `rust` ``` That's because the option [belongs to `dist` section](https://github.com/rust-lang/rust/blob/bef6ff618f17398775e9d8cd23a6f47d983869dc/src/bootstrap/config.rs#L861). cc rust-lang#108581
The flag controls whether to copy the linker, DLLs, and various libraries from MinGW into the rustc toolchain.
It applies only when the host or target is pc-windows-gnu.
The flag is true by default to preserve existing behavior.