rust/compiler/rustc_codegen_ssa
Trevor Gross 42cd3c60df
Rollup merge of #129418 - petrochenkov:libsearch2, r=jieyouxu
rustc: Simplify getting sysroot library directory

It was very non-obvious that `sess.target_tlib_path`, `make_target_lib_path(...)`, and `sess.target_filesearch(...).search_paths()` result in the same sysroot library directory paths.
They are however, indeed the same, because `sess.target_tlib_path` is initialized to `make_target_lib_path(...)` on `Session` creation, and they are used interchangeably.

There are still some redundant calls to `make_target_lib_path` and other inconsistent ways to obtain sysroot directories, but fixing that requires some behavior changes, while this PR is a pure refactoring.
Some places in the compiler even disagree on the number of sysroots - 1 (explicit `--sysroot` *or* default sysroot), 2 (explicit `--sysroot` *and* default sysroot), or an unclear number of `sysroot_candidates` every of which is considered.
The logic currently using `sess.target_tlib_path` or equivalents assumes one sysroot.
2024-08-27 01:46:51 -05:00
..
src Rollup merge of #129418 - petrochenkov:libsearch2, r=jieyouxu 2024-08-27 01:46:51 -05:00
Cargo.toml Rollup merge of #129290 - tgross35:pin-cc, r=Mark-Simulacrum 2024-08-24 22:14:13 +02:00
messages.ftl Always use ar_archive_writer for import libs 2024-08-17 19:10:46 +00:00
README.md mv compiler to compiler/ 2020-08-30 18:45:07 +03:00

Please read the rustc-dev-guide chapter on Backend Agnostic Codegen.