about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src/back/archive.rs
AgeCommit message (Collapse)AuthorLines
2025-08-29Move to 0.50.1Daniel Paoliello-9/+11
2025-08-29Update to ar_archive_writer 0.5.1Daniel Paoliello-2/+4
2025-06-03Move metadata object generation for dylibs to the linker codebjorn3-1/+11
This deduplicates some code between codegen backends and may in the future allow adding extra metadata that is only known at link time.
2025-04-25Retry if creating temp fails with access deniedChris Denton-2/+2
On Windows, if creating a temporary directory fails with permission denied then use a retry/backoff loop. This hopefully fixes a recuring error in our CI.
2025-03-17Flatten `if`s in `rustc_codegen_ssa`Yotam Ofek-5/+4
2025-02-08Rustfmtbjorn3-4/+4
2024-12-29review fixes: Adjust whitespacePiotr Osiewicz-0/+3
2024-12-29rustc_codegen_ssa: Buffer file writes in link_rlibPiotr Osiewicz-5/+5
This makes this step take ~25ms on my machine (M3 Max 64GB) for Zed repo instead of ~150ms. Additionally it takes down the time needed for a clean cargo build of ripgrep from ~6.1s to 5.9s. This change is mostly relevant for crates with multiple large CGUs.
2024-12-18Re-export more `rustc_span::symbol` things from `rustc_span`.Nicholas Nethercote-1/+1
`rustc_span::symbol` defines some things that are re-exported from `rustc_span`, such as `Symbol` and `sym`. But it doesn't re-export some closely related things such as `Ident` and `kw`. So you can do `use rustc_span::{Symbol, sym}` but you have to do `use rustc_span::symbol::{Ident, kw}`, which is inconsistent for no good reason. This commit re-exports `Ident`, `kw`, and `MacroRulesNormalizedIdent`, and changes many `rustc_span::symbol::` qualifiers in `compiler/` to `rustc_span::`. This is a 200+ net line of code reduction, mostly because many files with two `use rustc_span` items can be reduced to one.
2024-11-09Add a default implementation for CodegenBackend::linkbjorn3-0/+8
As a side effect this should add raw-dylib support to cg_gcc as the default ArchiveBuilderBuilder that is used implements create_dll_import_lib. I haven't tested if the raw-dylib support actually works however.
2024-11-07Rollup merge of #130586 - dpaoliello:fixrawdylib, r=wesleywiserJubilee-26/+37
Set "symbol name" in raw-dylib import libraries to the decorated name `windows-rs` received a bug report that mixing raw-dylib generated and the Windows SDK import libraries was causing linker failures: <https://github.com/microsoft/windows-rs/issues/3285> The root cause turned out to be #124958, that is we are not including the decorated name in the import library and so the import name type is also not being correctly set. This change modifies the generation of import libraries to set the "symbol name" to the fully decorated name and correctly marks the import as being data vs function. Note that this also required some changes to how the symbol is named within Rust: for MSVC we now need to use the decorated name but for MinGW we still need to use partially decorated (or undecorated) name. Fixes #124958 Passing i686 MSVC and MinGW build: <https://github.com/rust-lang/rust/actions/runs/11000433888?pr=130586> r? `@ChrisDenton`
2024-09-24Test fixing raw-dylibDaniel Paoliello-26/+37
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-6/+6
2024-09-17Minimize visibilities.Nicholas Nethercote-1/+1
This makes it much clearer which things are used outside the crate.
2024-08-24Fix `elided_named_lifetimes` in codePavel Grigorenko-1/+1
2024-08-20Make import libraries compatible with wholearchiveChris Denton-1/+5
2024-08-17Always use ar_archive_writer for import libsChris Denton-3/+83
2024-08-11Fix review comments and other improvementsbjorn3-4/+2
2024-08-10Support reading thin archives in ArArchiveBuilderbjorn3-4/+11
2024-08-07Rollup merge of #128206 - bjorn3:import_lib_writing_refactor, r=jieyouxuGuillaume Gomez-5/+130
Make create_dll_import_lib easier to implement This will make it easier to implement raw-dylib support in cg_clif and cg_gcc. This PR doesn't yet include an create_dll_import_lib implementation for cg_clif as I need to correctly implement dllimport in cg_clif first before raw-dylib can work at all with cg_clif. Required for https://github.com/rust-lang/rustc_codegen_cranelift/issues/1345
2024-08-01Rollup merge of #128450 - dpaoliello:coff, r=bjorn3Matthias Krüger-5/+1
Create COFF archives for non-LLVM backends `ar_archive_writer` now supports creating COFF archives, so enable them for the non-LLVM backends when requested. r? ``@bjorn3``
2024-07-31Create COFF archives for non-LLVM backendsDaniel Paoliello-5/+1
2024-07-31Rollup merge of #127830 - tgross35:archive-failure-message, r=BoxyUwUMatthias Krüger-1/+3
When an archive fails to build, print the path Currently the output on failure is as follows: Compiling block-buffer v0.10.4 Compiling crypto-common v0.1.6 Compiling digest v0.10.7 Compiling sha2 v0.10.8 Compiling xz2 v0.1.7 error: failed to build archive: No such file or directory error: could not compile `bootstrap` (lib) due to 1 previous error Change this to print which file is being constructed, to give some hint about what is going on. error: failed to build archive at `path/to/output`: No such file or directory
2024-07-30Move mingw dlltool invocation to cg_ssabjorn3-0/+127
2024-07-30Move computation of decorated names out of the create_dll_import_lib methodbjorn3-2/+1
2024-07-30Move temp file name generation out of the create_dll_import_lib methodbjorn3-3/+2
2024-07-29Reformat `use` declarations.Nicholas Nethercote-12/+10
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-28adopt object changesklensy-13/+9
adopt wasm_encoder changes
2024-07-16When an archive fails to build, print the pathTrevor Gross-1/+3
Currently the output on failure is as follows: Compiling block-buffer v0.10.4 Compiling crypto-common v0.1.6 Compiling digest v0.10.7 Compiling sha2 v0.10.8 Compiling xz2 v0.1.7 error: failed to build archive: No such file or directory error: could not compile `bootstrap` (lib) due to 1 previous error Print which file is being constructed to give some hint about what is going on.
2024-07-07Fix review commentsbjorn3-1/+1
2024-07-07Sync ar_archive_writer to LLVM 18.1.3bjorn3-13/+12
From LLVM 15.0.0-rc3. This adds support for COFF archives containing Arm64EC object files and has various fixes for AIX big archive files.
2024-04-17Use the default file permissions when writingbjorn3-8/+19
static libraries with ar_archive_writer Fixes #107495
2024-04-09Update ar_archive_writer to 0.2.0bjorn3-8/+1
This adds a whole bunch of tests checking for any difference with llvm's archive writer. It also fixes two mistakes in the porting from C++ to Rust. The first one causes a divergence for Mach-O archives which may or may not be harmless. The second will definitively cause issues, but only applies to thin archives, which rustc currently doesn't create.
2024-04-04MSVC targets should use COFF as their archive formatDaniel Paoliello-1/+5
2024-02-26remove useless lifetime of ArchiveBuilder823984418-3/+3
2024-02-14clean up potential_query_instability with FxIndexMap and UnordMapyukang-2/+2
2023-12-24Remove `Session` methods that duplicate `DiagCtxt` methods.Nicholas Nethercote-2/+2
Also add some `dcx` methods to types that wrap `TyCtxt`, for easier access.
2023-11-21Fix `clippy::needless_borrow` in the compilerNilstrieb-2/+1
`x clippy compiler -Aclippy::all -Wclippy::needless_borrow --fix`. Then I had to remove a few unnecessary parens and muts that were exposed now.
2023-04-19Recognize AIX style archive kindQiu Chaofan-0/+1
2023-02-10remove redundant clonesMatthias Krüger-1/+1
2023-01-27Revert "Avoid a temporary file when processing macOS fat archives"bjorn3-34/+36
This reverts commit bd8e476d8bd85b6d60a0de7694d154b4a74f5133.
2022-12-19clippy::complexity fixesMatthias Krüger-1/+1
filter_next needless_question_mark bind_instead_of_map manual_find derivable_impls map_identity redundant_slicing skip_while_next unnecessary_unwrap needless_bool
2022-12-03Avoid a temporary file when processing macOS fat archivesAlex Gaynor-36/+34
2022-12-03Make sure all input archives are unmapped before persisting the output archivebjorn3-1/+7
2022-12-02Write to temp file before renaming to the final namebjorn3-4/+22
2022-11-26Rewrite LLVM's archive writer in Rustbjorn3-2/+205
This allows it to be used by other codegen backends
2022-11-14Wrap bundlen static libraries into object filesDaniil Belov-0/+6
2022-11-04UPDATE - accept dyn error and make Box<dyn error> conform to IntoDiagnosticArgJhonny Bill Mena-15/+14
2022-11-04UPDATE - address PR CommentsJhonny Bill Mena-37/+19
FIX - StrippingDebugInfoFailed typo DELETE - unneeded FIXME comment UPDATE - only declare the error with ExtractBundledLibsError as an enum and use the Diagnostic derive macro
2022-11-04ADD - ExtractBundledLibsError. Migrated extract_bundled_libs to translatable ↵Jhonny Bill Mena-18/+41
diagnostics