diff options
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java | 45 |
1 files changed, 1 insertions, 44 deletions
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 e3be6f5b27..f151deaf59 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 @@ -25,10 +25,6 @@ import com.google.common.collect.Iterables; import com.google.common.collect.ListMultimap; import com.google.common.collect.Maps; import com.google.common.collect.Multimap; -import com.google.devtools.build.lib.actions.Artifact; -import com.google.devtools.build.lib.actions.ArtifactFactory; -import com.google.devtools.build.lib.actions.PackageRootResolutionException; -import com.google.devtools.build.lib.actions.PackageRootResolver; import com.google.devtools.build.lib.actions.Root; import com.google.devtools.build.lib.analysis.RuleContext; import com.google.devtools.build.lib.analysis.ViewCreationFailedException; @@ -70,8 +66,6 @@ import java.util.Map; import java.util.Set; import java.util.zip.ZipException; -import javax.annotation.Nullable; - /** * This class represents the C/C++ parts of the {@link BuildConfiguration}, * including the host architecture, target architecture, compiler version, and @@ -203,12 +197,6 @@ public class CppConfiguration extends BuildConfiguration.Fragment { public static final String FDO_STAMP_MACRO = "BUILD_FDO_TYPE"; /** - * This file (found under the sysroot) may be unconditionally included in every C/C++ compilation. - */ - private static final PathFragment BUILT_IN_INCLUDE_PATH_FRAGMENT = - new PathFragment("include/stdc-predef.h"); - - /** * Represents an optional flag that can be toggled using the package features mechanism. */ @Immutable @@ -308,7 +296,6 @@ public class CppConfiguration extends BuildConfiguration.Fragment { private final PathFragment sysroot; private final PathFragment runtimeSysroot; private final List<PathFragment> builtInIncludeDirectories; - private Artifact builtInIncludeFile; private final Map<String, PathFragment> toolPaths; private final PathFragment ldExecutable; @@ -1202,15 +1189,6 @@ public class CppConfiguration extends BuildConfiguration.Fragment { } /** - * Returns the built-in header automatically included by the toolchain compiler. All C++ files - * may implicitly include this file. May be null if {@link #getSysroot} is null. - */ - @Nullable - public Artifact getBuiltInIncludeFile() { - return builtInIncludeFile; - } - - /** * Returns the sysroot to be used. If the toolchain compiler does not support * different sysroots, or the sysroot is the same as the default sysroot, then * this method returns <code>null</code>. @@ -1914,28 +1892,7 @@ public class CppConfiguration extends BuildConfiguration.Fragment { } @Override - public void prepareHook(Path execRoot, ArtifactFactory artifactFactory, - PackageRootResolver resolver) throws ViewCreationFailedException { - // TODO(bazel-team): Remove the "relative" guard. sysroot should always be relative, and this - // should be enforced in the creation of CppConfiguration. - if (getSysroot() != null && !getSysroot().isAbsolute()) { - Root sysrootRoot; - try { - sysrootRoot = Iterables.getOnlyElement( - resolver.findPackageRootsForFiles( - // See doc of findPackageRootsForFiles for why we need a getChild here. - ImmutableList.of(getSysroot().getChild("dummy_child"))).entrySet()).getValue(); - } catch (PackageRootResolutionException prre) { - throw new ViewCreationFailedException("Failed to determine sysroot", prre); - } - - PathFragment sysrootExecPath = sysroot.getRelative(BUILT_IN_INCLUDE_PATH_FRAGMENT); - if (sysrootRoot.getPath().getRelative(sysrootExecPath).exists()) { - builtInIncludeFile = Preconditions.checkNotNull( - artifactFactory.getSourceArtifact(sysrootExecPath, sysrootRoot), - "%s %s", sysrootRoot, sysroot); - } - } + public void prepareHook(Path execRoot) throws ViewCreationFailedException { try { getFdoSupport().prepareToBuild(execRoot); } catch (ZipException e) { |