aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRulesModule.java10
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/android/AndroidRuleClasses.java2
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchain.java7
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainRule.java1
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/cpp/CppOptions.java12
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/cpp/CrosstoolConfigurationIdentifier.java34
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/cpp/CrosstoolConfigurationLoader.java4
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/cpp/CrosstoolConfigurationOptions.java4
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/objc/AppleCrosstoolTransition.java1
9 files changed, 22 insertions, 53 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRulesModule.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRulesModule.java
index 0f333e90e0..435b55f7dc 100644
--- a/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRulesModule.java
+++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRulesModule.java
@@ -49,6 +49,16 @@ public class BazelRulesModule extends BlazeModule {
metadataTags = {OptionMetadataTag.DEPRECATED},
help = "Deprecated no-op.")
public boolean directRun;
+
+ @Deprecated
+ @Option(
+ name = "glibc",
+ defaultValue = "null",
+ documentationCategory = OptionDocumentationCategory.UNDOCUMENTED,
+ effectTags = {OptionEffectTag.UNKNOWN},
+ metadataTags = {OptionMetadataTag.DEPRECATED},
+ help = "Deprecated no-op.")
+ public String glibc;
}
@Override
diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidRuleClasses.java b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidRuleClasses.java
index cd39c8b33b..1c5d0116eb 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidRuleClasses.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidRuleClasses.java
@@ -252,7 +252,6 @@ public final class AndroidRuleClasses {
splitOptions.get(CppOptions.class).libcTopLabel = androidOptions.androidLibcTopLabel;
splitOptions.get(BuildConfiguration.Options.class).cpu = androidOptions.cpu;
splitOptions.get(CppOptions.class).dynamicMode = androidOptions.dynamicMode;
- splitOptions.get(CppOptions.class).glibc = null;
setCrosstoolToAndroid(splitOptions, buildOptions);
return ImmutableList.of(splitOptions);
}
@@ -272,7 +271,6 @@ public final class AndroidRuleClasses {
splitOptions.get(CppOptions.class).cppCompiler = androidOptions.cppCompiler;
splitOptions.get(CppOptions.class).libcTopLabel = androidOptions.androidLibcTopLabel;
splitOptions.get(CppOptions.class).dynamicMode = androidOptions.dynamicMode;
- splitOptions.get(CppOptions.class).glibc = null;
setCrosstoolToAndroid(splitOptions, buildOptions);
result.add(splitOptions);
}
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchain.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchain.java
index 5dc9e75bf6..624c84712d 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchain.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchain.java
@@ -753,12 +753,7 @@ public class CcToolchain implements RuleConfiguredTargetFactory {
if (compiler.isEmpty()) {
compiler = null;
}
- String libc = ruleContext.attributes().get("libc", Type.STRING);
- if (libc.isEmpty()) {
- libc = null;
- }
- CrosstoolConfigurationIdentifier config =
- new CrosstoolConfigurationIdentifier(cpu, compiler, libc);
+ CrosstoolConfigurationIdentifier config = new CrosstoolConfigurationIdentifier(cpu, compiler);
try {
return CrosstoolConfigurationLoader.selectToolchain(
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainRule.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainRule.java
index bdba98899c..a22c7a3f32 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainRule.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainRule.java
@@ -111,7 +111,6 @@ public final class CcToolchainRule implements RuleDefinition {
.add(attr("output_licenses", LICENSE))
.add(attr("cpu", STRING).mandatory())
.add(attr("compiler", STRING))
- .add(attr("libc", STRING))
.add(
attr("all_files", LABEL)
.legacyAllowAnyFileType()
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 cc8fd2f3e0..68009b8b5f 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
@@ -170,17 +170,6 @@ public class CppOptions extends FragmentOptions {
)
public String outputDirectoryTag;
- @Option(
- name = "glibc",
- defaultValue = "null",
- documentationCategory = OptionDocumentationCategory.TOOLCHAIN,
- effectTags = {OptionEffectTag.LOADING_AND_ANALYSIS, OptionEffectTag.AFFECTS_OUTPUTS},
- help =
- "The version of glibc the target should be linked against. "
- + "By default, a suitable version is chosen based on --cpu."
- )
- public String glibc;
-
// O intrepid reaper of unused options: Be warned that the [no]start_end_lib
// option, however tempting to remove, has a use case. Look in our telemetry data.
@Option(
@@ -954,7 +943,6 @@ public class CppOptions extends FragmentOptions {
if (hostCrosstoolTop == null) {
host.cppCompiler = cppCompiler;
host.crosstoolTop = crosstoolTop;
- host.glibc = glibc;
} else {
host.crosstoolTop = hostCrosstoolTop;
}
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CrosstoolConfigurationIdentifier.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CrosstoolConfigurationIdentifier.java
index accd29c195..63ef402e9c 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CrosstoolConfigurationIdentifier.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CrosstoolConfigurationIdentifier.java
@@ -35,14 +35,10 @@ public final class CrosstoolConfigurationIdentifier implements CrosstoolConfigur
/** The compiler (e.g. gcc) associated with this crosstool configuration. */
private final String compiler;
- /** The version of libc (e.g. glibc-2.11) associated with this crosstool configuration. */
- private final String libc;
-
/** Creates a new {@link CrosstoolConfigurationIdentifier} with the given parameters. */
- CrosstoolConfigurationIdentifier(String cpu, String compiler, String libc) {
+ CrosstoolConfigurationIdentifier(String cpu, String compiler) {
this.cpu = Preconditions.checkNotNull(cpu);
this.compiler = compiler;
- this.libc = libc;
}
/**
@@ -52,13 +48,11 @@ public final class CrosstoolConfigurationIdentifier implements CrosstoolConfigur
public static CrosstoolConfigurationIdentifier fromOptions(BuildOptions buildOptions) {
Options options = buildOptions.get(BuildConfiguration.Options.class);
CppOptions cppOptions = buildOptions.get(CppOptions.class);
- return new CrosstoolConfigurationIdentifier(
- options.cpu, cppOptions.cppCompiler, cppOptions.glibc);
+ return new CrosstoolConfigurationIdentifier(options.cpu, cppOptions.cppCompiler);
}
public static CrosstoolConfigurationIdentifier fromToolchain(CToolchain toolchain) {
- return new CrosstoolConfigurationIdentifier(
- toolchain.getTargetCpu(), toolchain.getCompiler(), toolchain.getTargetLibc());
+ return new CrosstoolConfigurationIdentifier(toolchain.getTargetCpu(), toolchain.getCompiler());
}
@Override
@@ -68,22 +62,19 @@ public final class CrosstoolConfigurationIdentifier implements CrosstoolConfigur
}
CrosstoolConfigurationIdentifier otherCrosstool = (CrosstoolConfigurationIdentifier) other;
return Objects.equals(cpu, otherCrosstool.cpu)
- && Objects.equals(compiler, otherCrosstool.compiler)
- && Objects.equals(libc, otherCrosstool.libc);
+ && Objects.equals(compiler, otherCrosstool.compiler);
}
@Override
public int hashCode() {
- return Objects.hash(cpu, compiler, libc);
+ return Objects.hash(cpu, compiler);
}
-
/**
- * Returns a series of command line flags which specify the configuration options.
- * Any of these options may be null, in which case its flag is omitted.
+ * Returns a series of command line flags which specify the configuration options. Any of these
+ * options may be null, in which case its flag is omitted.
*
- * <p>The appended string will be along the lines of
- * " --cpu='cpu' --compiler='compiler' --glibc='libc'".
+ * <p>The appended string will be along the lines of " --cpu='cpu' --compiler='compiler'".
*/
public String describeFlags() {
StringBuilder message = new StringBuilder();
@@ -93,16 +84,12 @@ public final class CrosstoolConfigurationIdentifier implements CrosstoolConfigur
if (getCompiler() != null) {
message.append(" --compiler='").append(getCompiler()).append("'");
}
- if (getLibc() != null) {
- message.append(" --glibc='").append(getLibc()).append("'");
- }
return message.toString();
}
/** Returns true if the specified toolchain is a candidate for use with this crosstool. */
public boolean isCandidateToolchain(CToolchain toolchain) {
return (toolchain.getTargetCpu().equals(getCpu())
- && (getLibc() == null || toolchain.getTargetLibc().equals(getLibc()))
&& (getCompiler() == null || toolchain.getCompiler().equals(
getCompiler())));
}
@@ -121,9 +108,4 @@ public final class CrosstoolConfigurationIdentifier implements CrosstoolConfigur
public String getCompiler() {
return compiler;
}
-
- @Override
- public String getLibc() {
- return libc;
- }
}
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CrosstoolConfigurationLoader.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CrosstoolConfigurationLoader.java
index c1429e1985..caed2d37b6 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CrosstoolConfigurationLoader.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CrosstoolConfigurationLoader.java
@@ -317,7 +317,7 @@ public class CrosstoolConfigurationLoader {
boolean convertLipoToThinLto,
Function<String, String> cpuTransformer)
throws InvalidConfigurationException {
- if ((config.getCompiler() != null) || (config.getLibc() != null)) {
+ if (config.getCompiler() != null) {
ArrayList<CrosstoolConfig.CToolchain> candidateToolchains = new ArrayList<>();
for (CrosstoolConfig.CToolchain toolchain : release.getToolchainList()) {
if (config.isCandidateToolchain(toolchain)) {
@@ -396,6 +396,8 @@ public class CrosstoolConfigurationLoader {
message.append("[\n");
for (CrosstoolConfig.CToolchain toolchain : toolchains) {
message.append(" ");
+ message.append(toolchain.getToolchainIdentifier());
+ message.append(": ");
message.append(
CrosstoolConfigurationIdentifier.fromToolchain(toolchain).describeFlags().trim());
message.append(",\n");
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CrosstoolConfigurationOptions.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CrosstoolConfigurationOptions.java
index 46af308d23..f406d44e74 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CrosstoolConfigurationOptions.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CrosstoolConfigurationOptions.java
@@ -26,8 +26,4 @@ public interface CrosstoolConfigurationOptions {
/** Returns the compiler associated with this crosstool configuration. */
@Nullable
String getCompiler();
-
- /** Returns the libc version associated with this crosstool configuration. */
- @Nullable
- String getLibc();
}
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/AppleCrosstoolTransition.java b/src/main/java/com/google/devtools/build/lib/rules/objc/AppleCrosstoolTransition.java
index 2481612b43..3a2e636a13 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/AppleCrosstoolTransition.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/objc/AppleCrosstoolTransition.java
@@ -77,7 +77,6 @@ public class AppleCrosstoolTransition implements PatchTransition {
// OSX toolchains always use the runtime of the platform they are targeting (i.e. we do not
// support custom production environments).
to.get(CppOptions.class).libcTopLabel = null;
- to.get(CppOptions.class).glibc = null;
// OSX toolchains do not support fission.
to.get(CppOptions.class).fissionModes = ImmutableList.of();