Add Windows ThinLTO arguments#747
Open
dzbarsky wants to merge 1 commit into
Open
Conversation
Use LLD COFF ThinLTO options and /start-lib groups for Windows targets. Use NUL for indexless Windows backend actions.
dzbarsky
commented
Jun 13, 2026
| else: | ||
| # An empty input indicates not to perform cross-module optimization. | ||
| build_variables["thinlto_index"] = "/dev/null" | ||
| build_variables["thinlto_index"] = ( |
Contributor
Author
There was a problem hiding this comment.
@lilygorsheneva would you mind taking a peek at this one? This is all net-new behavior for windows that has never worked so hopefully it shouldn't be dangerous for google-internal usage.
All the other bits we can vendor into our toolchain module but this part is impossible to change externally, and while we can carry a patch, bzlmod rule mean every single consumer of our toolchain would also need to carry a patch, which is a huge pain.
Would be amazing to get this landed and a new rules_cc release cut, if possible! 🙏
Contributor
Author
There was a problem hiding this comment.
ok we found a pretty hacky way to workaround this but would still be good to move back to upstream!
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.
Windows rule-based toolchains currently reuse ELF LLD ThinLTO plugin options and
/dev/null, which are not valid for LLD's COFF driver or Windows backend actions. This change selects the LLD COFF ThinLTO options, uses/start-liband/end-libfor object-file groups, and usesNULfor indexless Windows backend actions.This allows Windows toolchains that use LLD and provide
supports_start_end_libto enable rules_cc distributed ThinLTO.