Skip to content

Commit

Permalink
Remove code after --incompatible_disable_cc_toolchain_label_from_cros…
Browse files Browse the repository at this point in the history
…stool_proto flip

#6382

RELNOTES: None.
PiperOrigin-RevId: 222424240
  • Loading branch information
hlopko authored and Copybara-Service committed Nov 21, 2018
1 parent 4b8cb05 commit 734934d
Show file tree
Hide file tree
Showing 18 changed files with 29 additions and 429 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,19 @@
public class BazelRulesModule extends BlazeModule {
/** This is where deprecated options go to die. */
public static class GraveyardOptions extends OptionsBase {
@Option(
name = "incompatible_disable_cc_toolchain_label_from_crosstool_proto",
defaultValue = "true",
documentationCategory = OptionDocumentationCategory.UNDOCUMENTED,
effectTags = {OptionEffectTag.LOADING_AND_ANALYSIS, OptionEffectTag.EAGERNESS_TO_EXIT},
metadataTags = {
OptionMetadataTag.DEPRECATED,
OptionMetadataTag.INCOMPATIBLE_CHANGE,
OptionMetadataTag.TRIGGERED_BY_ALL_INCOMPATIBLE_CHANGES
},
help = "Deprecated no-op.")
public boolean disableCcToolchainFromCrosstool;

@Option(
name = "incompatible_disable_cc_configuration_make_variables",
defaultValue = "true",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,12 @@
package com.google.devtools.build.lib.bazel.rules.android.ndkcrosstools.r10e;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.devtools.build.lib.bazel.rules.android.ndkcrosstools.NdkPaths;
import com.google.devtools.build.lib.bazel.rules.android.ndkcrosstools.StlImpl;
import com.google.devtools.build.lib.view.config.crosstool.CrosstoolConfig.CToolchain;
import com.google.devtools.build.lib.view.config.crosstool.CrosstoolConfig.CrosstoolRelease;
import com.google.devtools.build.lib.view.config.crosstool.CrosstoolConfig.DefaultCpuToolchain;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
* Generates a CrosstoolRelease proto for the Android NDK.
Expand All @@ -46,7 +43,6 @@ static CrosstoolRelease create(NdkPaths ndkPaths, StlImpl stlImpl, String hostPl
.setMajorVersion("android")
.setMinorVersion("")
.setDefaultTargetCpu("armeabi")
.addAllDefaultToolchain(getDefaultCpuToolchains(stlImpl))
.addAllToolchain(createToolchains(ndkPaths, stlImpl, hostPlatform))
.build();
}
Expand Down Expand Up @@ -77,36 +73,4 @@ private static ImmutableList<CToolchain> createToolchains(

return toolchains.build();
}

private static ImmutableList<DefaultCpuToolchain> getDefaultCpuToolchains(StlImpl stlImpl) {
// TODO(bazel-team): It would be better to auto-generate this somehow.

ImmutableMap<String, String> defaultCpus = ImmutableMap.<String, String>builder()
// arm
.put("armeabi", "arm-linux-androideabi-4.9")
.put("armeabi-v7a", "arm-linux-androideabi-4.9-v7a")
.put("armeabi-v7a-hard", "arm-linux-androideabi-4.9-v7a-hard")
.put("armeabi-thumb", "arm-linux-androideabi-4.9-thumb")
.put("armeabi-v7a-thumb", "arm-linux-androideabi-4.9-v7a-thumb")
.put("armeabi-v7a-hard-thumb", "arm-linux-androideabi-4.9-v7a-hard-thumb")
.put("arm64-v8a", "aarch64-linux-android-4.9")

// mips
.put("mips", "mipsel-linux-android-4.9")
.put("mips64", "mips64el-linux-android-4.9")

// x86
.put("x86", "x86-4.9")
.put("x86_64", "x86_64-4.9")
.build();

ImmutableList.Builder<DefaultCpuToolchain> defaultCpuToolchains = ImmutableList.builder();
for (Map.Entry<String, String> defaultCpu : defaultCpus.entrySet()) {
defaultCpuToolchains.add(DefaultCpuToolchain.newBuilder()
.setCpu(defaultCpu.getKey())
.setToolchainIdentifier(defaultCpu.getValue() + "-" + stlImpl.getName())
.build());
}
return defaultCpuToolchains.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,12 @@
package com.google.devtools.build.lib.bazel.rules.android.ndkcrosstools.r11;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.devtools.build.lib.bazel.rules.android.ndkcrosstools.NdkPaths;
import com.google.devtools.build.lib.bazel.rules.android.ndkcrosstools.StlImpl;
import com.google.devtools.build.lib.view.config.crosstool.CrosstoolConfig.CToolchain;
import com.google.devtools.build.lib.view.config.crosstool.CrosstoolConfig.CrosstoolRelease;
import com.google.devtools.build.lib.view.config.crosstool.CrosstoolConfig.DefaultCpuToolchain;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
* Generates a CrosstoolRelease proto for the Android NDK.
Expand All @@ -49,7 +46,6 @@ public static CrosstoolRelease create(NdkPaths ndkPaths, StlImpl stlImpl, String
.setMajorVersion("android")
.setMinorVersion("")
.setDefaultTargetCpu("armeabi")
.addAllDefaultToolchain(getDefaultCpuToolchains(stlImpl))
.addAllToolchain(createToolchains(ndkPaths, stlImpl, hostPlatform))
.build();
}
Expand Down Expand Up @@ -80,36 +76,4 @@ private static ImmutableList<CToolchain> createToolchains(

return toolchains.build();
}

private static ImmutableList<DefaultCpuToolchain> getDefaultCpuToolchains(StlImpl stlImpl) {
// TODO(bazel-team): It would be better to auto-generate this somehow.

ImmutableMap<String, String> defaultCpus = ImmutableMap.<String, String>builder()
// arm
.put("armeabi", "arm-linux-androideabi-4.9")
.put("armeabi-v7a", "arm-linux-androideabi-4.9-v7a")
.put("armeabi-v7a-hard", "arm-linux-androideabi-4.9-v7a-hard")
.put("armeabi-thumb", "arm-linux-androideabi-4.9-thumb")
.put("armeabi-v7a-thumb", "arm-linux-androideabi-4.9-v7a-thumb")
.put("armeabi-v7a-hard-thumb", "arm-linux-androideabi-4.9-v7a-hard-thumb")
.put("arm64-v8a", "aarch64-linux-android-4.9")

// mips
.put("mips", "mipsel-linux-android-4.9")
.put("mips64", "mips64el-linux-android-4.9")

// x86
.put("x86", "x86-4.9")
.put("x86_64", "x86_64-4.9")
.build();

ImmutableList.Builder<DefaultCpuToolchain> defaultCpuToolchains = ImmutableList.builder();
for (Map.Entry<String, String> defaultCpu : defaultCpus.entrySet()) {
defaultCpuToolchains.add(DefaultCpuToolchain.newBuilder()
.setCpu(defaultCpu.getKey())
.setToolchainIdentifier(defaultCpu.getValue() + "-" + stlImpl.getName())
.build());
}
return defaultCpuToolchains.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,12 @@
package com.google.devtools.build.lib.bazel.rules.android.ndkcrosstools.r12;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.devtools.build.lib.bazel.rules.android.ndkcrosstools.NdkPaths;
import com.google.devtools.build.lib.bazel.rules.android.ndkcrosstools.StlImpl;
import com.google.devtools.build.lib.view.config.crosstool.CrosstoolConfig.CToolchain;
import com.google.devtools.build.lib.view.config.crosstool.CrosstoolConfig.CrosstoolRelease;
import com.google.devtools.build.lib.view.config.crosstool.CrosstoolConfig.DefaultCpuToolchain;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/** Generates a CrosstoolRelease proto for the Android NDK. */
final class AndroidNdkCrosstoolsR12 {
Expand All @@ -46,7 +43,6 @@ static CrosstoolRelease create(NdkPaths ndkPaths, StlImpl stlImpl, String hostPl
.setMajorVersion("android")
.setMinorVersion("")
.setDefaultTargetCpu("armeabi")
.addAllDefaultToolchain(getDefaultCpuToolchains(stlImpl))
.addAllToolchain(createToolchains(ndkPaths, stlImpl, hostPlatform))
.build();
}
Expand Down Expand Up @@ -77,34 +73,4 @@ private static ImmutableList<CToolchain> createToolchains(

return toolchains.build();
}

private static ImmutableList<DefaultCpuToolchain> getDefaultCpuToolchains(StlImpl stlImpl) {
// TODO(bazel-team): It would be better to auto-generate this somehow.

ImmutableMap<String, String> defaultCpus =
ImmutableMap.<String, String>builder()
// arm
.put("armeabi", "arm-linux-androideabi-4.9")
.put("armeabi-v7a", "arm-linux-androideabi-4.9-v7a")
.put("arm64-v8a", "aarch64-linux-android-4.9")

// mips
.put("mips", "mipsel-linux-android-4.9")
.put("mips64", "mips64el-linux-android-4.9")

// x86
.put("x86", "x86-4.9")
.put("x86_64", "x86_64-4.9")
.build();

ImmutableList.Builder<DefaultCpuToolchain> defaultCpuToolchains = ImmutableList.builder();
for (Map.Entry<String, String> defaultCpu : defaultCpus.entrySet()) {
defaultCpuToolchains.add(
DefaultCpuToolchain.newBuilder()
.setCpu(defaultCpu.getKey())
.setToolchainIdentifier(defaultCpu.getValue() + "-" + stlImpl.getName())
.build());
}
return defaultCpuToolchains.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,12 @@
package com.google.devtools.build.lib.bazel.rules.android.ndkcrosstools.r13;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.devtools.build.lib.bazel.rules.android.ndkcrosstools.NdkPaths;
import com.google.devtools.build.lib.bazel.rules.android.ndkcrosstools.StlImpl;
import com.google.devtools.build.lib.view.config.crosstool.CrosstoolConfig.CToolchain;
import com.google.devtools.build.lib.view.config.crosstool.CrosstoolConfig.CrosstoolRelease;
import com.google.devtools.build.lib.view.config.crosstool.CrosstoolConfig.DefaultCpuToolchain;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/** Generates a CrosstoolRelease proto for the Android NDK. */
final class AndroidNdkCrosstoolsR13 {
Expand All @@ -44,7 +41,6 @@ static CrosstoolRelease create(
.setMajorVersion("android")
.setMinorVersion("")
.setDefaultTargetCpu("armeabi")
.addAllDefaultToolchain(getDefaultCpuToolchains(stlImpl))
.addAllToolchain(createToolchains(ndkPaths, stlImpl, hostPlatform, clangVersion))
.build();
}
Expand Down Expand Up @@ -76,34 +72,4 @@ private static ImmutableList<CToolchain> createToolchains(

return toolchains.build();
}

private static ImmutableList<DefaultCpuToolchain> getDefaultCpuToolchains(StlImpl stlImpl) {
// TODO(bazel-team): It would be better to auto-generate this somehow.

ImmutableMap<String, String> defaultCpus =
ImmutableMap.<String, String>builder()
// arm
.put("armeabi", "arm-linux-androideabi-clang3.8")
.put("armeabi-v7a", "arm-linux-androideabi-clang3.8-v7a")
.put("arm64-v8a", "aarch64-linux-android-clang3.8")

// mips
.put("mips", "mipsel-linux-android-clang3.8")
.put("mips64", "mips64el-linux-android-clang3.8")

// x86
.put("x86", "x86-clang3.8")
.put("x86_64", "x86_64-clang3.8")
.build();

ImmutableList.Builder<DefaultCpuToolchain> defaultCpuToolchains = ImmutableList.builder();
for (Map.Entry<String, String> defaultCpu : defaultCpus.entrySet()) {
defaultCpuToolchains.add(
DefaultCpuToolchain.newBuilder()
.setCpu(defaultCpu.getKey())
.setToolchainIdentifier(defaultCpu.getValue() + "-" + stlImpl.getName())
.build());
}
return defaultCpuToolchains.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,12 @@
package com.google.devtools.build.lib.bazel.rules.android.ndkcrosstools.r15;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.devtools.build.lib.bazel.rules.android.ndkcrosstools.NdkPaths;
import com.google.devtools.build.lib.bazel.rules.android.ndkcrosstools.StlImpl;
import com.google.devtools.build.lib.view.config.crosstool.CrosstoolConfig.CToolchain;
import com.google.devtools.build.lib.view.config.crosstool.CrosstoolConfig.CrosstoolRelease;
import com.google.devtools.build.lib.view.config.crosstool.CrosstoolConfig.DefaultCpuToolchain;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/** Generates a CrosstoolRelease proto for the Android NDK. */
final class AndroidNdkCrosstoolsR15 {
Expand All @@ -44,7 +41,6 @@ static CrosstoolRelease create(
.setMajorVersion("android")
.setMinorVersion("")
.setDefaultTargetCpu("armeabi")
.addAllDefaultToolchain(getDefaultCpuToolchains(stlImpl, clangVersion))
.addAllToolchain(createToolchains(ndkPaths, stlImpl, hostPlatform, clangVersion))
.build();
}
Expand Down Expand Up @@ -82,35 +78,4 @@ private static ImmutableList<CToolchain> createToolchains(

return toolchains.build();
}

private static ImmutableList<DefaultCpuToolchain> getDefaultCpuToolchains(
StlImpl stlImpl, String clangVersion) {
// TODO(bazel-team): It would be better to auto-generate this somehow.

ImmutableMap<String, String> defaultCpus =
ImmutableMap.<String, String>builder()
// arm
.put("armeabi", "arm-linux-androideabi-clang" + clangVersion)
.put("armeabi-v7a", "arm-linux-androideabi-clang" + clangVersion + "-v7a")
.put("arm64-v8a", "aarch64-linux-android-clang" + clangVersion)

// mips
.put("mips", "mipsel-linux-android-clang" + clangVersion)
.put("mips64", "mips64el-linux-android-clang" + clangVersion)

// x86
.put("x86", "x86-clang" + clangVersion)
.put("x86_64", "x86_64-clang" + clangVersion)
.build();

ImmutableList.Builder<DefaultCpuToolchain> defaultCpuToolchains = ImmutableList.builder();
for (Map.Entry<String, String> defaultCpu : defaultCpus.entrySet()) {
defaultCpuToolchains.add(
DefaultCpuToolchain.newBuilder()
.setCpu(defaultCpu.getKey())
.setToolchainIdentifier(defaultCpu.getValue() + "-" + stlImpl.getName())
.build());
}
return defaultCpuToolchains.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,12 @@
package com.google.devtools.build.lib.bazel.rules.android.ndkcrosstools.r17;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.devtools.build.lib.bazel.rules.android.ndkcrosstools.NdkPaths;
import com.google.devtools.build.lib.bazel.rules.android.ndkcrosstools.StlImpl;
import com.google.devtools.build.lib.view.config.crosstool.CrosstoolConfig.CToolchain;
import com.google.devtools.build.lib.view.config.crosstool.CrosstoolConfig.CrosstoolRelease;
import com.google.devtools.build.lib.view.config.crosstool.CrosstoolConfig.DefaultCpuToolchain;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/** Generates a CrosstoolRelease proto for the Android NDK. */
final class AndroidNdkCrosstoolsR17 {
Expand All @@ -44,7 +41,6 @@ static CrosstoolRelease create(
.setMajorVersion("android")
.setMinorVersion("")
.setDefaultTargetCpu("armeabi")
.addAllDefaultToolchain(getDefaultCpuToolchains(stlImpl, clangVersion))
.addAllToolchain(createToolchains(ndkPaths, stlImpl, hostPlatform, clangVersion))
.build();
}
Expand Down Expand Up @@ -80,30 +76,4 @@ private static ImmutableList<CToolchain> createToolchains(

return toolchains.build();
}

private static ImmutableList<DefaultCpuToolchain> getDefaultCpuToolchains(
StlImpl stlImpl, String clangVersion) {
// TODO(bazel-team): It would be better to auto-generate this somehow.

ImmutableMap<String, String> defaultCpus =
ImmutableMap.<String, String>builder()
// arm
.put("armeabi-v7a", "arm-linux-androideabi-clang" + clangVersion + "-v7a")
.put("arm64-v8a", "aarch64-linux-android-clang" + clangVersion)

// x86
.put("x86", "x86-clang" + clangVersion)
.put("x86_64", "x86_64-clang" + clangVersion)
.build();

ImmutableList.Builder<DefaultCpuToolchain> defaultCpuToolchains = ImmutableList.builder();
for (Map.Entry<String, String> defaultCpu : defaultCpus.entrySet()) {
defaultCpuToolchains.add(
DefaultCpuToolchain.newBuilder()
.setCpu(defaultCpu.getKey())
.setToolchainIdentifier(defaultCpu.getValue() + "-" + stlImpl.getName())
.build());
}
return defaultCpuToolchains.build();
}
}
Loading

0 comments on commit 734934d

Please sign in to comment.