Skip to content

Commit

Permalink
Add hostPerFileLtoBackendOpts
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Jacklyn committed Jan 15, 2021
1 parent 31eaf68 commit 7df0d62
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,26 @@ public Label getPropellerOptimizeLabel() {
+ "except bar.o.")
public List<PerLabelOptions> perFileLtoBackendOpts;

@Option(
name = "host_per_file_ltobackendopt",
allowMultiple = true,
converter = PerLabelOptions.PerLabelOptionsConverter.class,
defaultValue = "null",
documentationCategory = OptionDocumentationCategory.OUTPUT_PARAMETERS,
effectTags = {OptionEffectTag.ACTION_COMMAND_LINES, OptionEffectTag.AFFECTS_OUTPUTS},
help =
"Additional options to selectively pass to LTO backend (under --features=thin_lto) when "
+ "compiling certain backend objects for host. This option can be passed multiple times. "
+ "Syntax: regex_filter@option_1,option_2,...,option_n. Where regex_filter stands "
+ "for a list of include and exclude regular expression patterns. "
+ "option_1 to option_n stand for arbitrary command line options. "
+ "If an option contains a comma it has to be quoted with a backslash. "
+ "Options can contain @. Only the first @ is used to split the string. Example: "
+ "--host_per_file_ltobackendopt=//foo/.*\\.o,-//foo/bar\\.o@-O0 adds the -O0 "
+ "command line option to the LTO backend command line of all o files in //foo/ "
+ "except bar.o.")
public List<PerLabelOptions> hostPerFileLtoBackendOpts;

/**
* The value of "--crosstool_top" to use for building tools.
*
Expand Down Expand Up @@ -1140,6 +1160,7 @@ public FragmentOptions getHost() {
host.conlyoptList = ImmutableList.copyOf(hostConlyoptList);
host.perFileCopts = ImmutableList.copyOf(hostPerFileCopts);
host.linkoptList = ImmutableList.copyOf(hostLinkoptList);
host.perFileLtoBackendOpts = ImmutableList.copyOf(hostPerFileLtoBackendOpts);

host.useStartEndLib = useStartEndLib;
host.stripBinaries = StripMode.ALWAYS;
Expand Down Expand Up @@ -1174,6 +1195,7 @@ public FragmentOptions getHost() {
host.hostPerFileCopts = hostPerFileCopts;
host.hostLibcTopLabel = hostLibcTopLabel;
host.hostLinkoptList = hostLinkoptList;
host.hostPerFileLtoBackendOpts = hostPerFileLtoBackendOpts;

host.experimentalStarlarkCcImport = experimentalStarlarkCcImport;

Expand Down

0 comments on commit 7df0d62

Please sign in to comment.