Automated rollback of commit e06c0acef428795fa83f42f28e6e882786fff26b.

*** Reason for rollback ***

Causes large build breakage

*** Original change description ***

Blank out value of crosstool_top when C++ toolchain resolution is enabled

Without this change, analysis fails in case `--crosstool_top` is set to a `cc_toolchain_suite`
that doesn't have a toolchain matching the `--cpu` value.

This prevented removing `--crosstool_top` flag, because the default value only supports a limited set of cpus.

PiperOrigin-RevId: 526989656
Change-Id: I255396e01d62405e34598b3eed81b4e03464dbd3
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java
index e938214..d851b60 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java
@@ -321,16 +321,8 @@
       doc = "The label of the target describing the C++ toolchain",
       defaultLabel = "//tools/cpp:toolchain",
       defaultInToolRepository = true)
-  @Nullable
   public Label getRuleProvidingCcToolchainProvider() {
-    if (cppOptions.enableCcToolchainResolution) {
-      // In case C++ toolchain resolution is enabled, crosstool_top flags are not used.
-      // Returning null prevents additional work on the flags values and makes it possible to
-      // remove `--crosstool_top` flags.
-      return null;
-    } else {
-      return cppOptions.crosstoolTop;
-    }
+    return cppOptions.crosstoolTop;
   }
 
   /** Returns the configured current compilation mode. */