Skip to content

incompatible_make_thinlto_command_lines_standalone: Make ThinLTO actions fully configured in the CcToolchainInfo #6791

@hlopko

Description

@hlopko

Flag: --incompatible_make_thinlto_command_lines_standalone
Available since: 0.26
Will be flipped in: 1.0

Motivation

Before this flag, lto-indexing action reuses flags from plain C++ linking actions. lto-backend uses GCC tool from tool_paths, not action configs as it should. Because of this it's unnecessary hard to configure C++ toolchain that supports ThinLTO. Once this flag is flipped, we'll document how to configure C++ toolchain for ThinLTO, and add support for ThinLTO into Bazel's autoconfigured toolchain as part of #6926.

Migration

If your toolchain doesn't support ThinLTO you don't have to do anything. In case it does:

  1. You have to define action configs for these actions:
    • lto-backend
    • lto-index-for-executable
    • lto-index-for-dynamic-library
    • lto-index-for-nodeps-dynamic-library
  2. You have to mention these actions in all flag sets that you want to be expanded for lto.
  3. Once this flag is flipped, you can remove mentions of lto-indexing in your toolchain, it will no longer be used by Bazel.

Metadata

Metadata

Assignees

Labels

P1I'll work on this now. (Assignee required)incompatible-changeIncompatible/breaking changeteam-Rules-CPPIssues for C++ rules

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions