aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/cpp/CppOptions.java
diff options
context:
space:
mode:
authorGravatar klimek <klimek@google.com>2017-08-01 14:56:53 +0200
committerGravatar Dmitry Lomov <dslomov@google.com>2017-08-01 17:45:10 +0200
commitb05ed43283b9f5d69c4a1b27aa8319daed27e0be (patch)
tree9a0f098de3c1886dbca21a416ba6c4d86b6108cf /src/main/java/com/google/devtools/build/lib/rules/cpp/CppOptions.java
parent8db4454dbe103343d522a05bdd9f083b4cc13ff8 (diff)
Implement user experience for LIPO / ThinLTO users.
Add flag --convert_lipo_to_thinlto, which allows builds with LLVM to use ThinLTO when the user specifies LIPO + FDO flags; if that flag is not set, and the user requests a build with LLVM, the compile will now fail. Add an attribute supports_lipo to the DefaultCpuToolchain crosstool proto and skip default toolchains that do not support LIPO when the user has specified LIPO flags in the toolchain selection; this enables CROSSTOOL files to cause an implicit fallback to a hybrid / LIPO toolchain when using an LLVM toolchain as the default. Add a CrosstoolBuilder to MockCcSupport and add a new method setupCrosstoolFromScratch that allows unit tests to fully control the setup. The other methods available in MockCcSupport will always load in a default CROSSTOOL file and may show different unit test results depending on the content of that file. RELNOTES: None. PiperOrigin-RevId: 163819246
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/cpp/CppOptions.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/cpp/CppOptions.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppOptions.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppOptions.java
index 5a1c87cb9a..4a6a8579be 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppOptions.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppOptions.java
@@ -485,6 +485,17 @@ public class CppOptions extends FragmentOptions {
}
@Option(
+ name = "convert_lipo_to_thinlto",
+ defaultValue = "false",
+ documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
+ effectTags = {OptionEffectTag.UNKNOWN},
+ help =
+ "If set, builds using LIPO will automatically be converted to ThinLTO for the LLVM "
+ + "compiler."
+ )
+ public boolean convertLipoToThinLTO;
+
+ @Option(
name = "lipo",
defaultValue = "off",
converter = LipoModeConverter.class,