diff options
author | cpeyser <cpeyser@google.com> | 2017-10-24 20:39:27 +0200 |
---|---|---|
committer | Dmitry Lomov <dslomov@google.com> | 2017-10-25 16:46:06 +0200 |
commit | 11b64fd1d37810524feb55093f482197aa9c785d (patch) | |
tree | 0bd04b69ed923fe64053a13943ac71dbffe84177 /src/main/java/com/google/devtools/build/lib/rules/cpp | |
parent | edca92ef668399e6e305606bc551f46a3e766f05 (diff) |
Move CppConfiguration#getAbi and #getAbiGlibcVersion to CcToolchainProvider.
PiperOrigin-RevId: 173287598
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/cpp')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainProvider.java | 21 | ||||
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java | 24 |
2 files changed, 22 insertions, 23 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainProvider.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainProvider.java index 2f30b35c7e..097d4674eb 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainProvider.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainProvider.java @@ -382,6 +382,27 @@ public final class CcToolchainProvider extends ToolchainInfo { 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(); + } + @SkylarkCallable( name = "unfiltered_compiler_options_do_not_use", doc = 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 5e9e96e721..306e456805 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 @@ -630,28 +630,6 @@ public class CppConfiguration extends BuildConfiguration.Fragment { } /** - * 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 cppToolchainInfo.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 cppToolchainInfo.getAbiGlibcVersion(); - } - - /** * Returns the configured features of the toolchain. Rules should not call this directly, but * instead use {@code CcToolchainProvider.getFeatures}. */ @@ -1569,7 +1547,7 @@ public class CppConfiguration extends BuildConfiguration.Fragment { // CcToolchainProvider. globalMakeEnvBuilder.putAll(getAdditionalMakeVariables()); - globalMakeEnvBuilder.put("ABI_GLIBC_VERSION", getAbiGlibcVersion()); + globalMakeEnvBuilder.put("ABI_GLIBC_VERSION", cppToolchainInfo.getAbiGlibcVersion()); globalMakeEnvBuilder.put("ABI", cppToolchainInfo.getAbi()); } |