Support distributed ThinLTO for Linux cdylibs - #55
Draft
zbarsky-openai wants to merge 1 commit into
Draft
zbarsky-openai wants to merge 1 commit into
zbarsky-openai wants to merge 1 commit into
Conversation
Preserve rustc export metadata and bundled native archives while letting the C++ toolchain own ThinLTO backends and the shared-library link. Forward PyO3 CcInfo and keep opaque Cargo native objects outside distributed LTO. Assisted-by: OpenAI Codex
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linux cdylibs currently use rustc-owned linking even when the C++
thin_ltofeature is enabled. Route them throughcc_common.linkwhilepreserving rustc's ELF export script, symbol roots, and bundled native
archives. Keep the existing paths for other operating systems.
Forward
CcInfothrough the PyO3 toolchain adapters so the separate linkreceives their inputs. Keep Cargo build-script C/C++ compilation outside
ThinLTO because opaque archive members have no Bazel backend actions.
The existing one-codegen-unit-per-crate distributed model is unchanged.
This is a draft: native bitcode passed through build scripts without
CcInforemains unsupported. Custom native linker arguments and dynamicnative dependencies need further coverage before general enablement.
All 21 focused LTO and process-wrapper tests pass on the rebased source,
as does the new runtime fixture with normal linking. The LLVM runtime
fixture is blocked while building process_wrapper because
the toolchain cannot find
-lgcc_s. Earlier Linux integration probescovered dependency C exports, native archives, allocation, and Python
extension loading. Buildifier formatting passes; its lint diagnostics are
unchanged from main.