cc_*
rules. */
@SkylarkModule(name = "CcToolchainInfo", doc = "Information about the C++ compiler being used.")
@Immutable
public final class CcToolchainProvider extends ToolchainInfo {
public static final String SKYLARK_NAME = "CcToolchainInfo";
/** An empty toolchain to be returned in the error case (instead of null). */
public static final CcToolchainProvider EMPTY_TOOLCHAIN_IS_ERROR =
new CcToolchainProvider(
ImmutableMap.of(),
null,
null,
null,
null,
NestedSetBuilder.null
.
*/
public PathFragment getRuntimeSysroot() {
return toolchainInfo.getRuntimeSysroot();
}
/**
* Return the name of the directory (relative to the bin directory) that holds mangled links to
* shared libraries. This name is always set to the '{@code _solib_None
."
)
public PathFragment getSysroot() {
return sysroot;
}
/**
* Returns the path fragment that is either absolute or relative to the execution root that can be
* used to execute the given tool.
*/
public PathFragment getToolPathFragment(CppConfiguration.Tool tool) {
return toolchainInfo.getToolPathFragment(tool);
}
/**
* Returns the abi we're using, which is a gcc version. E.g.: "gcc-3.4". Note that in practice we
* might be using gcc-3.4 as ABI even when compiling with gcc-4.1.0, because ABIs are backwards
* compatible.
*/
// TODO(bazel-team): The javadoc should clarify how this is used in Blaze.
public String getAbi() {
return toolchainInfo.getAbi();
}
/**
* Returns the glibc version used by the abi we're using. This is a glibc version number (e.g.,
* "2.2.2"). Note that in practice we might be using glibc 2.2.2 as ABI even when compiling with
* gcc-4.2.2, gcc-4.3.1, or gcc-4.4.0 (which use glibc 2.3.6), because ABIs are backwards
* compatible.
*/
// TODO(bazel-team): The javadoc should clarify how this is used in Blaze.
public String getAbiGlibcVersion() {
return toolchainInfo.getAbiGlibcVersion();
}
/**
* Returns a label that references the library files needed to statically
* link the C++ runtime (i.e. libgcc.a, libgcc_eh.a, libstdc++.a) for the
* target architecture.
*/
public Label getStaticRuntimeLibsLabel() {
return toolchainInfo.getStaticRuntimeLibsLabel();
}
/**
* Returns a label that references the library files needed to dynamically
* link the C++ runtime (i.e. libgcc_s.so, libstdc++.so) for the target
* architecture.
*/
public Label getDynamicRuntimeLibsLabel() {
return toolchainInfo.getDynamicRuntimeLibsLabel();
}
/** Returns the compiler version string (e.g. "gcc-4.1.1"). */
@SkylarkCallable(name = "compiler", structField = true, doc = "C++ compiler.")
public String getCompiler() {
return toolchainInfo.getCompiler();
}
/** Returns the libc version string (e.g. "glibc-2.2.2"). */
@SkylarkCallable(name = "libc", structField = true, doc = "libc version string.")
public String getTargetLibc() {
return toolchainInfo.getTargetLibc();
}
/** Returns the target architecture using blaze-specific constants (e.g. "piii"). */
@SkylarkCallable(name = "cpu", structField = true, doc = "Target CPU of the C++ toolchain.")
public String getTargetCpu() {
return toolchainInfo.getTargetCpu();
}
/**
* Returns a map of additional make variables for use by {@link BuildConfiguration}. These are to
* used to allow some build rules to avoid the limits on stack frame sizes and variable-length
* arrays.
*
* The returned map must contain an entry for {@code STACK_FRAME_UNLIMITED}, though the entry
* may be an empty string.
*/
public ImmutableMap