-
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
Introduce an ArchiveBuilderBuilder #99844
Introduce an ArchiveBuilderBuilder #99844
Conversation
This avoids monomorphizing all linker code for each codegen backend and will allow passing in extra information to the archive builder from the codegen backend.
Some changes occurred in compiler/rustc_codegen_gcc cc @antoyo |
r? @nagisa (rust-highfive has picked a reviewer for you, use r? to override) |
Do I understand correctly that the ultimate goal is to have just one common implementation of an @bors r+ |
let output_path = | ||
Self::create_dll_import_lib(self.sess(), lib_name, dll_imports, tmpdir.as_ref()); | ||
archive: &Path, | ||
skip: Box<dyn FnMut(&str) -> bool + 'static>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn’t this have been &mut dyn
? Not that it matters much probably.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The LLVM based archive writer used to store the skip function and would only evaluate it once building the actual archive file. This is no longer the case since a couple of days, but I wanted to keep this option open for other archive builders.
Just like with MetadataLoader my plan is to have a single canonical implementation for all in-tree backends, but still give the option to use another one for platforms that don't use a variant of ar archives, or that use a variant unsupported by my rust port of LLVM's archive writer. For example IBM's big archive format. Or tar as used by rust-gpu's rustc_codegen_spirv. |
Rollup of 5 pull requests Successful merges: - rust-lang#99186 (Use LocalDefId for closures more) - rust-lang#99741 (Use `impl`'s generics when suggesting fix on bad `impl Copy`) - rust-lang#99844 (Introduce an ArchiveBuilderBuilder) - rust-lang#99921 (triagebot.yml: CC Enselic when rustdoc-json-types changes) - rust-lang#99974 (Suggest removing a semicolon and boxing the expressions for if-else) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Regression is still failing. Related changes: - rust-lang/rust#99420 - rust-lang/rust#99495 - rust-lang/rust#99844 - rust-lang/rust#99058
Regression is still failing. Related changes: - rust-lang/rust#99420 - rust-lang/rust#99495 - rust-lang/rust#99844 - rust-lang/rust#99058
* Fix compilation errors Regression is still failing. Related changes: - rust-lang/rust#99420 - rust-lang/rust#99495 - rust-lang/rust#99844 - rust-lang/rust#99058 * Change test to expect compilation failure The compiler has reverted their fix to Opaque types due to performance degradation. * Fix VTable handling now that it has an Opaque type - Add an implementation for vtable_size and vtable_align intrinsics. - Change how we handled Foreign types. Even though they are unsized, a pointer to foreign types is a thin pointer. Co-authored-by: Daniel Schwartz-Narbonne <danielsn@users.noreply.github.com>
This avoids monomorphizing all linker code for each codegen backend and will allow passing in extra information to the archive builder from the codegen backend. I'm going to use this in #97485 to allow passing in the right function to extract symbols from object files to a generic archive builder to be used by cg_llvm, cg_clif and cg_gcc.