Switch to a preconfigured Clang for k8 and armv7

This one reuses more of Bazel's builtin features to remain up to date
more easily, and it's easier to expand support for more platforms. This
also takes care of upgrading to a newer Clang.

This will require updating to raspios bullseye on the Raspberry Pis.
This also renames armhf-debian to armv7 to match the broader Bazel
ecosystem's name for this architecture.

Change-Id: I3e2a4f4efea43e76314ca34a9293c7b4b45edd2c
Signed-off-by: Brian Silverman <bsilver16834@gmail.com>
diff --git a/tools/cpp/toolchain_config.bzl b/tools/cpp/toolchain_config.bzl
index 32b98eb..fb6576c 100644
--- a/tools/cpp/toolchain_config.bzl
+++ b/tools/cpp/toolchain_config.bzl
@@ -11,16 +11,12 @@
 load("@bazel_tools//tools/build_defs/cc:action_names.bzl", "ACTION_NAMES")
 
 def _impl(ctx):
-    if ctx.attr.cpu == "armhf-debian":
-        toolchain_identifier = "clang_linux_armhf"
-    elif ctx.attr.cpu == "rp2040":
+    if ctx.attr.cpu == "rp2040":
         toolchain_identifier = "rp2040"
     elif ctx.attr.cpu == "cortex-m4f":
         toolchain_identifier = "cortex-m4f"
     elif ctx.attr.cpu == "cortex-m4f-k22":
         toolchain_identifier = "cortex-m4f-k22"
-    elif ctx.attr.cpu == "k8":
-        toolchain_identifier = "k8_linux"
     elif ctx.attr.cpu == "roborio":
         toolchain_identifier = "roborio_linux"
     elif ctx.attr.cpu == "armeabi-v7a":
@@ -30,21 +26,16 @@
 
     if ctx.attr.cpu == "armeabi-v7a":
         host_system_name = "armeabi-v7a"
-    elif ctx.attr.cpu == "armhf-debian":
-        host_system_name = "linux"
     elif (ctx.attr.cpu == "rp2040" or
           ctx.attr.cpu == "cortex-m4f" or
-          ctx.attr.cpu == "cortex-m4f-k22" or
-          ctx.attr.cpu == "k8"):
+          ctx.attr.cpu == "cortex-m4f-k22"):
         host_system_name = "local"
     elif ctx.attr.cpu == "roborio":
         host_system_name = "roborio"
     else:
         fail("Unreachable")
 
-    if ctx.attr.cpu == "armhf-debian":
-        target_system_name = "arm_a15"
-    elif ctx.attr.cpu == "armeabi-v7a":
+    if ctx.attr.cpu == "armeabi-v7a":
         target_system_name = "armeabi-v7a"
     elif ctx.attr.cpu == "rp2040":
         target_system_name = "rp2040"
@@ -52,8 +43,6 @@
         target_system_name = "cortex-m4f"
     elif ctx.attr.cpu == "cortex-m4f-k22":
         target_system_name = "cortex-m4f-k22"
-    elif ctx.attr.cpu == "k8":
-        target_system_name = "k8"
     elif ctx.attr.cpu == "roborio":
         target_system_name = "roborio"
     else:
@@ -61,16 +50,12 @@
 
     if ctx.attr.cpu == "armeabi-v7a":
         target_cpu = "armeabi-v7a"
-    elif ctx.attr.cpu == "armhf-debian":
-        target_cpu = "armhf-debian"
     elif ctx.attr.cpu == "rp2040":
         target_cpu = "rp2040"
     elif ctx.attr.cpu == "cortex-m4f":
         target_cpu = "cortex-m4f"
     elif ctx.attr.cpu == "cortex-m4f-k22":
         target_cpu = "cortex-m4f-k22"
-    elif ctx.attr.cpu == "k8":
-        target_cpu = "k8"
     elif ctx.attr.cpu == "roborio":
         target_cpu = "roborio"
     else:
@@ -84,19 +69,12 @@
         target_libc = "cortex-m4f"
     elif ctx.attr.cpu == "cortex-m4f-k22":
         target_libc = "cortex-m4f-k22"
-    elif ctx.attr.cpu == "armhf-debian":
-        target_libc = "glibc_2.19"
-    elif ctx.attr.cpu == "k8":
-        target_libc = "local"
     elif ctx.attr.cpu == "roborio":
         target_libc = "roborio"
     else:
         fail("Unreachable")
 
-    if (ctx.attr.cpu == "armhf-debian" or
-        ctx.attr.cpu == "k8"):
-        compiler = "clang"
-    elif ctx.attr.cpu == "armeabi-v7a":
+    if ctx.attr.cpu == "armeabi-v7a":
         compiler = "compiler"
     elif (ctx.attr.cpu == "rp2040" or
           ctx.attr.cpu == "cortex-m4f" or
@@ -108,16 +86,12 @@
 
     if ctx.attr.cpu == "armeabi-v7a":
         abi_version = "armeabi-v7a"
-    elif ctx.attr.cpu == "armhf-debian":
-        abi_version = "clang_6.0"
     elif ctx.attr.cpu == "rp2040":
         abi_version = "rp2040"
     elif ctx.attr.cpu == "cortex-m4f":
         abi_version = "cortex-m4f"
     elif ctx.attr.cpu == "cortex-m4f-k22":
         abi_version = "cortex-m4f-k22"
-    elif ctx.attr.cpu == "k8":
-        abi_version = "local"
     elif ctx.attr.cpu == "roborio":
         abi_version = "roborio"
     else:
@@ -131,10 +105,6 @@
         abi_libc_version = "cortex-m4f"
     elif ctx.attr.cpu == "cortex-m4f-k22":
         abi_libc_version = "cortex-m4f-k22"
-    elif ctx.attr.cpu == "armhf-debian":
-        abi_libc_version = "glibc_2.19"
-    elif ctx.attr.cpu == "k8":
-        abi_libc_version = "local"
     elif ctx.attr.cpu == "roborio":
         abi_libc_version = "roborio"
     else:
@@ -202,20 +172,6 @@
                 ),
             ],
         )
-    elif ctx.attr.cpu == "armhf-debian":
-        objcopy_embed_data_action = action_config(
-            action_name = "objcopy_embed_data",
-            enabled = True,
-            tools = [
-                tool(path = "linaro_linux_gcc/arm-linux-gnueabihf-objcopy"),
-            ],
-        )
-    elif ctx.attr.cpu == "k8":
-        objcopy_embed_data_action = action_config(
-            action_name = "objcopy_embed_data",
-            enabled = True,
-            tools = [tool(path = "clang_6p0/x86_64-linux-gnu-objcopy")],
-        )
     elif (ctx.attr.cpu == "rp2040" or
           ctx.attr.cpu == "cortex-m4f" or
           ctx.attr.cpu == "cortex-m4f-k22"):
@@ -229,11 +185,9 @@
 
     if ctx.attr.cpu == "armeabi-v7a":
         action_configs = []
-    elif (ctx.attr.cpu == "armhf-debian" or
-          ctx.attr.cpu == "rp2040" or
+    elif (ctx.attr.cpu == "rp2040" or
           ctx.attr.cpu == "cortex-m4f" or
           ctx.attr.cpu == "cortex-m4f-k22" or
-          ctx.attr.cpu == "k8" or
           ctx.attr.cpu == "roborio"):
         action_configs = [objcopy_embed_data_action]
     else:
@@ -258,100 +212,7 @@
 
     supports_pic_feature = feature(name = "supports_pic", enabled = True)
 
-    if ctx.attr.cpu == "k8":
-        default_compile_flags_feature = feature(
-            name = "default_compile_flags",
-            enabled = True,
-            flag_sets = [
-                flag_set(
-                    actions = [
-                        ACTION_NAMES.assemble,
-                        ACTION_NAMES.preprocess_assemble,
-                        ACTION_NAMES.linkstamp_compile,
-                        ACTION_NAMES.c_compile,
-                        ACTION_NAMES.cpp_compile,
-                        ACTION_NAMES.cpp_header_parsing,
-                        ACTION_NAMES.cpp_module_compile,
-                        ACTION_NAMES.cpp_module_codegen,
-                        ACTION_NAMES.lto_backend,
-                        ACTION_NAMES.clif_match,
-                    ],
-                    flag_groups = [
-                        flag_group(
-                            flags = [
-                                "--sysroot=external/amd64_debian_sysroot",
-                                "-nostdinc",
-                                "-isystem",
-                                "external/amd64_debian_sysroot/usr/include/c++/7",
-                                "-isystem",
-                                "external/amd64_debian_sysroot/usr/include/x86_64-linux-gnu/c++/7",
-                                "-isystem",
-                                "external/amd64_debian_sysroot/usr/include/c++/8/backward",
-                                "-isystem",
-                                "external/amd64_debian_sysroot/usr/lib/gcc/x86_64-linux-gnu/8/include",
-                                "-isystem",
-                                "external/clang_6p0_repo/usr/lib/llvm-6.0/lib/clang/6.0.0/include",
-                                "-isystem",
-                                "external/amd64_debian_sysroot/usr/include/x86_64-linux-gnu",
-                                "-isystem",
-                                "external/amd64_debian_sysroot/usr/include",
-                                "-D__STDC_FORMAT_MACROS",
-                                "-D__STDC_CONSTANT_MACROS",
-                                "-D__STDC_LIMIT_MACROS",
-                                "-D_FILE_OFFSET_BITS=64",
-                                "-U_FORTIFY_SOURCE",
-                                "-D_FORTIFY_SOURCE=1",
-                                "-fstack-protector",
-                                "-fPIE",
-                                "-fcolor-diagnostics",
-                                "-fmessage-length=80",
-                                "-fmacro-backtrace-limit=0",
-                                "-Wall",
-                                "-Wextra",
-                                "-Wpointer-arith",
-                                "-Wstrict-aliasing",
-                                "-Wcast-qual",
-                                "-Wcast-align",
-                                "-Wwrite-strings",
-                                "-Wtype-limits",
-                                "-Wsign-compare",
-                                "-Wformat=2",
-                                "-Werror",
-                                "-fno-omit-frame-pointer",
-                                "-pipe",
-                                "-ggdb3",
-                            ],
-                        ),
-                    ],
-                ),
-                flag_set(
-                    actions = [
-                        ACTION_NAMES.assemble,
-                        ACTION_NAMES.preprocess_assemble,
-                        ACTION_NAMES.linkstamp_compile,
-                        ACTION_NAMES.c_compile,
-                        ACTION_NAMES.cpp_compile,
-                        ACTION_NAMES.cpp_header_parsing,
-                        ACTION_NAMES.cpp_module_compile,
-                        ACTION_NAMES.cpp_module_codegen,
-                        ACTION_NAMES.lto_backend,
-                        ACTION_NAMES.clif_match,
-                    ],
-                    flag_groups = [
-                        flag_group(
-                            flags = [
-                                "-O2",
-                                "-DNDEBUG",
-                                "-ffunction-sections",
-                                "-fdata-sections",
-                            ],
-                        ),
-                    ],
-                    with_features = [with_feature_set(features = ["opt"])],
-                ),
-            ],
-        )
-    elif ctx.attr.cpu == "cortex-m4f-k22":
+    if ctx.attr.cpu == "cortex-m4f-k22":
         default_compile_flags_feature = feature(
             name = "default_compile_flags",
             enabled = True,
@@ -607,133 +468,10 @@
                 ),
             ],
         )
-    elif ctx.attr.cpu == "armhf-debian":
-        default_compile_flags_feature = feature(
-            name = "default_compile_flags",
-            enabled = True,
-            flag_sets = [
-                flag_set(
-                    actions = [
-                        ACTION_NAMES.assemble,
-                        ACTION_NAMES.preprocess_assemble,
-                        ACTION_NAMES.linkstamp_compile,
-                        ACTION_NAMES.c_compile,
-                        ACTION_NAMES.cpp_compile,
-                        ACTION_NAMES.cpp_header_parsing,
-                        ACTION_NAMES.cpp_module_compile,
-                        ACTION_NAMES.cpp_module_codegen,
-                        ACTION_NAMES.lto_backend,
-                        ACTION_NAMES.clif_match,
-                    ],
-                    flag_groups = [
-                        flag_group(
-                            flags = [
-                                "-target",
-                                "armv7a-arm-linux-gnueabif",
-                                "--sysroot=external/armhf_debian_rootfs",
-                                "-mfloat-abi=hard",
-                                "-mfpu=vfpv3-d16",
-                                "-nostdinc",
-                                "-isystem",
-                                "external/linaro_linux_gcc_repo/lib/gcc/arm-linux-gnueabihf/7.4.1/include",
-                                "-isystem",
-                                "external/linaro_linux_gcc_repo/lib/gcc/arm-linux-gnueabihf/7.4.1/include-fixed",
-                                "-isystem",
-                                "external/linaro_linux_gcc_repo/arm-linux-gnueabihf/include/c++/7.4.1/arm-linux-gnueabihf",
-                                "-isystem",
-                                "external/linaro_linux_gcc_repo/arm-linux-gnueabihf/include/c++/7.4.1",
-                                "-isystem",
-                                "external/linaro_linux_gcc_repo/include/c++/7.4.1/arm-linux-gnueabihf",
-                                "-isystem",
-                                "external/linaro_linux_gcc_repo/include/c++/7.4.1",
-                                "-isystem",
-                                "external/armhf_debian_rootfs/usr/include",
-                                "-isystem",
-                                "external/armhf_debian_rootfs/usr/include/arm-linux-gnueabihf",
-                                "-isystem",
-                                "external/org_frc971/third_party",
-                                "-D__STDC_FORMAT_MACROS",
-                                "-D__STDC_CONSTANT_MACROS",
-                                "-D__STDC_LIMIT_MACROS",
-                                "-D_FILE_OFFSET_BITS=64",
-                                "-DAOS_ARCHITECTURE_armhf",
-                                "-U_FORTIFY_SOURCE",
-                                "-fstack-protector",
-                                "-fPIE",
-                                "-fdiagnostics-color=always",
-                                "-Wall",
-                                "-Wextra",
-                                "-Wpointer-arith",
-                                "-Wstrict-aliasing",
-                                "-Wcast-qual",
-                                "-Wcast-align",
-                                "-Wwrite-strings",
-                                "-Wtype-limits",
-                                "-Wsign-compare",
-                                "-Wformat=2",
-                                "-Werror",
-                                "-Wunused-local-typedefs",
-                                "-fno-omit-frame-pointer",
-                                "-pipe",
-                                "-ggdb3",
-                            ],
-                        ),
-                    ],
-                ),
-                flag_set(
-                    actions = [
-                        ACTION_NAMES.assemble,
-                        ACTION_NAMES.preprocess_assemble,
-                        ACTION_NAMES.linkstamp_compile,
-                        ACTION_NAMES.c_compile,
-                        ACTION_NAMES.cpp_compile,
-                        ACTION_NAMES.cpp_header_parsing,
-                        ACTION_NAMES.cpp_module_compile,
-                        ACTION_NAMES.cpp_module_codegen,
-                        ACTION_NAMES.lto_backend,
-                        ACTION_NAMES.clif_match,
-                    ],
-                    flag_groups = [
-                        flag_group(
-                            flags = [
-                                "-O2",
-                                "-DNDEBUG",
-                                "-D_FORTIFY_SOURCE=1",
-                                "-ffunction-sections",
-                                "-fdata-sections",
-                            ],
-                        ),
-                    ],
-                    with_features = [with_feature_set(features = ["opt"])],
-                ),
-            ],
-        )
     else:
         default_compile_flags_feature = None
 
-    if (ctx.attr.cpu == "armhf-debian" or
-        ctx.attr.cpu == "k8"):
-        dbg_feature = feature(
-            name = "dbg",
-            flag_sets = [
-                flag_set(
-                    actions = [
-                        ACTION_NAMES.preprocess_assemble,
-                        ACTION_NAMES.c_compile,
-                        ACTION_NAMES.cpp_compile,
-                        ACTION_NAMES.cpp_header_parsing,
-                        "c++-header-preprocessing",
-                        ACTION_NAMES.cpp_module_compile,
-                    ],
-                    flag_groups = [
-                        flag_group(flags = ["-DAOS_DEBUG=1"]),
-                        flag_group(flags = ["-fno-omit-frame-pointer"]),
-                    ],
-                ),
-            ],
-            implies = ["all_modes"],
-        )
-    elif ctx.attr.cpu == "roborio":
+    if ctx.attr.cpu == "roborio":
         dbg_feature = feature(
             name = "dbg",
             flag_sets = [
@@ -776,26 +514,7 @@
     else:
         dbg_feature = None
 
-    if (ctx.attr.cpu == "armhf-debian" or
-        ctx.attr.cpu == "k8"):
-        fastbuild_feature = feature(
-            name = "fastbuild",
-            flag_sets = [
-                flag_set(
-                    actions = [
-                        ACTION_NAMES.preprocess_assemble,
-                        ACTION_NAMES.c_compile,
-                        ACTION_NAMES.cpp_compile,
-                        ACTION_NAMES.cpp_header_parsing,
-                        "c++-header-preprocessing",
-                        ACTION_NAMES.cpp_module_compile,
-                    ],
-                    flag_groups = [flag_group(flags = ["-DAOS_DEBUG=0"])],
-                ),
-            ],
-            implies = ["all_modes"],
-        )
-    elif ctx.attr.cpu == "roborio":
+    if ctx.attr.cpu == "roborio":
         fastbuild_feature = feature(
             name = "fastbuild",
             flag_sets = [
@@ -869,25 +588,6 @@
             ],
             implies = ["opt_post"],
         )
-    elif (ctx.attr.cpu == "armhf-debian" or
-          ctx.attr.cpu == "k8"):
-        opt_feature = feature(
-            name = "opt",
-            flag_sets = [
-                flag_set(
-                    actions = [
-                        ACTION_NAMES.preprocess_assemble,
-                        ACTION_NAMES.c_compile,
-                        ACTION_NAMES.cpp_compile,
-                        ACTION_NAMES.cpp_header_parsing,
-                        "c++-header-preprocessing",
-                        ACTION_NAMES.cpp_module_compile,
-                    ],
-                    flag_groups = [flag_group(flags = ["-DAOS_DEBUG=0"])],
-                ),
-            ],
-            implies = ["all_modes"],
-        )
     elif (ctx.attr.cpu == "rp2040" or
           ctx.attr.cpu == "cortex-m4f" or
           ctx.attr.cpu == "cortex-m4f-k22"):
@@ -1119,88 +819,6 @@
                 # TODO(austin): I'd love to turn --gc-sections on, but that breaks things.
             ],
         )
-    elif ctx.attr.cpu == "k8":
-        default_link_flags_feature = feature(
-            name = "default_link_flags",
-            enabled = True,
-            flag_sets = [
-                flag_set(
-                    actions = all_link_actions,
-                    flag_groups = [
-                        flag_group(
-                            flags = [
-                                "-nodefaultlibs",
-                                "--sysroot=external/amd64_debian_sysroot",
-                                "-lstdc++",
-                                "-lc",
-                                "-lgcc",
-                                "-lgcc_s",
-                                "-Bexternal/clang_6p0_repo/usr/bin/",
-                                "-Ltools/cpp/clang_6p0/clang_more_libs",
-                                "-Lexternal/amd64_debian_sysroot/usr/lib/gcc/x86_64-linux-gnu/7/",
-                                "-Lexternal/amd64_debian_sysroot/usr/lib/x86_64-linux-gnu/",
-                                "-Lexternal/amd64_debian_sysroot/usr/lib/",
-                                "-Lexternal/amd64_debian_sysroot/lib/x86_64-linux-gnu/",
-                                "-Lexternal/amd64_debian_sysroot/lib/",
-                                "-no-canonical-prefixes",
-                                "-fuse-ld=gold",
-                                "-Wl,-z,relro,-z,now",
-                                "-lm",
-                                "-Wl,--build-id=md5",
-                                "-Wl,--hash-style=gnu",
-                                "-Wl,--warn-execstack",
-                                "-Wl,--detect-odr-violations",
-                            ],
-                        ),
-                    ],
-                ),
-                flag_set(
-                    actions = all_link_actions,
-                    flag_groups = [flag_group(flags = ["-Wl,--gc-sections"])],
-                    with_features = [with_feature_set(features = ["opt"])],
-                ),
-            ],
-        )
-    elif ctx.attr.cpu == "armhf-debian":
-        default_link_flags_feature = feature(
-            name = "default_link_flags",
-            enabled = True,
-            flag_sets = [
-                flag_set(
-                    actions = all_link_actions,
-                    flag_groups = [
-                        flag_group(
-                            flags = [
-                                "-target",
-                                "armv7a-arm-linux-gnueabif",
-                                "--sysroot=external/armhf_debian_rootfs",
-                                "-lstdc++",
-                                "-Ltools/cpp/linaro_linux_gcc/clang_more_libs",
-                                "-Lexternal/armhf_debian_rootfs/usr/lib/gcc/arm-linux-gnueabihf/8",
-                                "-Lexternal/armhf_debian_rootfs/lib/arm-linux-gnueabihf",
-                                "-Lexternal/armhf_debian_rootfs/usr/lib/arm-linux-gnueabihf",
-                                "-Lexternal/armhf_debian_rootfs/lib",
-                                "-Lexternal/armhf_debian_rootfs/usr/lib",
-                                "-Lexternal/linaro_linux_gcc_repo/lib/gcc/arm-linux-gnueabihf/7.4.1",
-                                "-Bexternal/linaro_linux_gcc_repo/lib/gcc/arm-linux-gnueabihf/7.4.1",
-                                "-Bexternal/linaro_linux_gcc_repo/arm-linux-gnueabihf/bin",
-                                "-Wl,--dynamic-linker=/lib/ld-linux-armhf.so.3",
-                                "-no-canonical-prefixes",
-                                "-Wl,-z,relro,-z,now",
-                                "-lm",
-                                "-Wl,--build-id=md5",
-                                "-Wl,--hash-style=gnu",
-                            ],
-                        ),
-                    ],
-                ),
-                flag_set(
-                    actions = all_link_actions,
-                    flag_groups = [flag_group(flags = ["-Wl,--gc-sections"])],
-                    with_features = [with_feature_set(features = ["opt"])],
-                ),
-            ],
-        )
     else:
         default_link_flags_feature = None
 
@@ -1274,71 +892,15 @@
                 ),
             ],
         )
-    elif ctx.attr.cpu == "armhf-debian":
-        all_modes_feature = feature(
-            name = "all_modes",
-            flag_sets = [
-                flag_set(
-                    actions = [
-                        ACTION_NAMES.preprocess_assemble,
-                        ACTION_NAMES.assemble,
-                        ACTION_NAMES.c_compile,
-                    ],
-                    flag_groups = [flag_group(flags = ["-std=gnu99"])],
-                ),
-                flag_set(
-                    actions = [
-                        ACTION_NAMES.cpp_compile,
-                        ACTION_NAMES.cpp_header_parsing,
-                        "c++-header-preprocessing",
-                        ACTION_NAMES.cpp_module_compile,
-                    ],
-                    flag_groups = [flag_group(flags = ["-std=gnu++1z"])],
-                ),
-                flag_set(
-                    actions = [
-                        ACTION_NAMES.preprocess_assemble,
-                        ACTION_NAMES.assemble,
-                        "c++-link",
-                        ACTION_NAMES.cpp_compile,
-                        ACTION_NAMES.cpp_header_parsing,
-                        "c++-header-preprocessing",
-                        ACTION_NAMES.cpp_module_compile,
-                        ACTION_NAMES.c_compile,
-                    ],
-                    flag_groups = [flag_group(flags = ["-pthread"])],
-                ),
-            ],
-        )
-    elif ctx.attr.cpu == "k8":
-        all_modes_feature = feature(
-            name = "all_modes",
-            flag_sets = [
-                flag_set(
-                    actions = [
-                        ACTION_NAMES.preprocess_assemble,
-                        ACTION_NAMES.assemble,
-                        ACTION_NAMES.c_compile,
-                    ],
-                    flag_groups = [flag_group(flags = ["-std=gnu99"])],
-                ),
-                flag_set(
-                    actions = [
-                        ACTION_NAMES.cpp_compile,
-                        ACTION_NAMES.cpp_header_parsing,
-                        "c++-header-preprocessing",
-                        ACTION_NAMES.cpp_module_compile,
-                    ],
-                    flag_groups = [flag_group(flags = ["-std=gnu++1z"])],
-                ),
-            ],
-        )
     else:
         all_modes_feature = None
 
     supports_dynamic_linker_feature = feature(name = "supports_dynamic_linker", enabled = True)
 
-    if ctx.attr.cpu == "k8":
+    if (ctx.attr.cpu == "rp2040" or
+        ctx.attr.cpu == "cortex-m4f" or
+        ctx.attr.cpu == "cortex-m4f-k22" or
+        ctx.attr.cpu == "roborio"):
         unfiltered_compile_flags_feature = feature(
             name = "unfiltered_compile_flags",
             enabled = True,
@@ -1364,79 +926,6 @@
                                 "-D__DATE__=\"redacted\"",
                                 "-D__TIMESTAMP__=\"redacted\"",
                                 "-D__TIME__=\"redacted\"",
-                                "-Wno-varargs",
-                                "-Wno-null-pointer-arithmetic",
-                                "-Wno-mismatched-new-delete",
-                            ],
-                        ),
-                    ],
-                ),
-            ],
-        )
-    elif (ctx.attr.cpu == "rp2040" or
-          ctx.attr.cpu == "cortex-m4f" or
-          ctx.attr.cpu == "cortex-m4f-k22" or
-          ctx.attr.cpu == "roborio"):
-        unfiltered_compile_flags_feature = feature(
-            name = "unfiltered_compile_flags",
-            enabled = True,
-            flag_sets = [
-                flag_set(
-                    actions = [
-                        ACTION_NAMES.assemble,
-                        ACTION_NAMES.preprocess_assemble,
-                        ACTION_NAMES.linkstamp_compile,
-                        ACTION_NAMES.c_compile,
-                        ACTION_NAMES.cpp_compile,
-                        ACTION_NAMES.cpp_header_parsing,
-                        ACTION_NAMES.cpp_module_compile,
-                        ACTION_NAMES.cpp_module_codegen,
-                        ACTION_NAMES.lto_backend,
-                        ACTION_NAMES.clif_match,
-                    ],
-                    flag_groups = [
-                        flag_group(
-                            flags = [
-                                "-no-canonical-prefixes",
-                                "-Wno-builtin-macro-redefined",
-                                "-D__DATE__=\"redacted\"",
-                                "-D__TIMESTAMP__=\"redacted\"",
-                                "-D__TIME__=\"redacted\"",
-                            ],
-                        ),
-                    ],
-                ),
-            ],
-        )
-    elif ctx.attr.cpu == "armhf-debian":
-        unfiltered_compile_flags_feature = feature(
-            name = "unfiltered_compile_flags",
-            enabled = True,
-            flag_sets = [
-                flag_set(
-                    actions = [
-                        ACTION_NAMES.assemble,
-                        ACTION_NAMES.preprocess_assemble,
-                        ACTION_NAMES.linkstamp_compile,
-                        ACTION_NAMES.c_compile,
-                        ACTION_NAMES.cpp_compile,
-                        ACTION_NAMES.cpp_header_parsing,
-                        ACTION_NAMES.cpp_module_compile,
-                        ACTION_NAMES.cpp_module_codegen,
-                        ACTION_NAMES.lto_backend,
-                        ACTION_NAMES.clif_match,
-                    ],
-                    flag_groups = [
-                        flag_group(
-                            flags = [
-                                "-no-canonical-prefixes",
-                                "-Wno-builtin-macro-redefined",
-                                "-Wno-mismatched-new-delete",
-                                "-Wno-null-pointer-arithmetic",
-                                "-Wno-varargs",
-                                "-D__DATE__=\"redacted\"",
-                                "-D__TIMESTAMP__=\"redacted\"",
-                                "-D__TIME__=\"redacted\"",
                             ],
                         ),
                     ],
@@ -1653,22 +1142,6 @@
             sysroot_feature,
             unfiltered_compile_flags_feature,
         ]
-    elif (ctx.attr.cpu == "armhf-debian" or
-          ctx.attr.cpu == "k8"):
-        features = [
-            default_compile_flags_feature,
-            default_link_flags_feature,
-            opt_feature,
-            dbg_feature,
-            fastbuild_feature,
-            all_modes_feature,
-            pie_for_linking_feature,
-            supports_dynamic_linker_feature,
-            supports_pic_feature,
-            user_compile_flags_feature,
-            sysroot_feature,
-            unfiltered_compile_flags_feature,
-        ]
     elif ctx.attr.cpu == "roborio":
         features = [
             default_link_flags_feature,
@@ -1703,22 +1176,6 @@
             "%package(@arm_frc_linux_gnueabi_repo//arm-frc2020-linux-gnueabi/usr/include/c++/7.3.0/arm-frc2020-linux-gnueabi)%",
             "%package(@arm_frc_linux_gnueabi_repo//arm-frc2020-linux-gnueabi/usr/include/c++/7.3.0/backward)%",
         ]
-    elif ctx.attr.cpu == "k8":
-        cxx_builtin_include_directories = [
-            "%package(@clang_6p0_repo//usr)%/lib/llvm-6.0/lib/clang/6.0.0/include",
-            "%package(@amd64_debian_sysroot//usr)%/include",
-            "%package(@amd64_debian_sysroot//usr)%/lib/gcc/x86_64-linux-gnu/7/include",
-            "%package(@amd64_debian_sysroot//usr)%/lib/gcc/x86_64-linux-gnu/7/include-fixed",
-        ]
-    elif ctx.attr.cpu == "armhf-debian":
-        cxx_builtin_include_directories = [
-            "%package(@linaro_linux_gcc_repo//include)%",
-            "%package(@armhf_debian_rootfs//usr/include)%",
-            "%package(@linaro_linux_gcc_repo//include)%/c++/7.4.1",
-            "%package(@linaro_linux_gcc_repo//lib/gcc/arm-linux-gnueabihf/7.4.1/include)%",
-            "%package(@linaro_linux_gcc_repo//lib/gcc/arm-linux-gnueabihf/7.4.1/include-fixed)%",
-            "%package(@linaro_linux_gcc_repo//arm-linux-gnueabihf/include)%/c++/7.4.1",
-        ]
     elif (ctx.attr.cpu == "rp2040" or
           ctx.attr.cpu == "cortex-m4f" or
           ctx.attr.cpu == "cortex-m4f-k22"):
@@ -1783,53 +1240,6 @@
                 path = "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-strip",
             ),
         ]
-    elif ctx.attr.cpu == "k8":
-        tool_paths = [
-            tool_path(
-                name = "ar",
-                path = "clang_6p0/x86_64-linux-gnu-ar",
-            ),
-            tool_path(
-                name = "compat-ld",
-                path = "clang_6p0/x86_64-linux-gnu-ld",
-            ),
-            tool_path(
-                name = "cpp",
-                path = "clang_6p0/x86_64-linux-gnu-cpp",
-            ),
-            tool_path(
-                name = "dwp",
-                path = "clang_6p0/x86_64-linux-gnu-dwp",
-            ),
-            tool_path(
-                name = "gcc",
-                path = "clang_6p0/x86_64-linux-gnu-clang-6.0",
-            ),
-            tool_path(
-                name = "gcov",
-                path = "clang_6p0/x86_64-linux-gnu-gcov",
-            ),
-            tool_path(
-                name = "ld",
-                path = "clang_6p0/x86_64-linux-gnu-ld",
-            ),
-            tool_path(
-                name = "nm",
-                path = "clang_6p0/x86_64-linux-gnu-nm",
-            ),
-            tool_path(
-                name = "objcopy",
-                path = "clang_6p0/x86_64-linux-gnu-objcopy",
-            ),
-            tool_path(
-                name = "objdump",
-                path = "clang_6p0/x86_64-linux-gnu-objdump",
-            ),
-            tool_path(
-                name = "strip",
-                path = "clang_6p0/x86_64-linux-gnu-strip",
-            ),
-        ]
     elif (ctx.attr.cpu == "rp2040" or
           ctx.attr.cpu == "cortex-m4f" or
           ctx.attr.cpu == "cortex-m4f-k22"):
@@ -1879,53 +1289,6 @@
                 path = "gcc_arm_none_eabi/arm-none-eabi-strip",
             ),
         ]
-    elif ctx.attr.cpu == "armhf-debian":
-        tool_paths = [
-            tool_path(
-                name = "ar",
-                path = "linaro_linux_gcc/arm-linux-gnueabihf-ar",
-            ),
-            tool_path(
-                name = "compat-ld",
-                path = "linaro_linux_gcc/arm-linux-gnueabihf-ld",
-            ),
-            tool_path(
-                name = "cpp",
-                path = "linaro_linux_gcc/clang_bin/clang",
-            ),
-            tool_path(
-                name = "dwp",
-                path = "linaro_linux_gcc/arm-linux-gnueabihf-dwp",
-            ),
-            tool_path(
-                name = "gcc",
-                path = "linaro_linux_gcc/clang_bin/clang",
-            ),
-            tool_path(
-                name = "gcov",
-                path = "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-gcov-4.9",
-            ),
-            tool_path(
-                name = "ld",
-                path = "linaro_linux_gcc/arm-linux-gnueabihf-ld",
-            ),
-            tool_path(
-                name = "nm",
-                path = "linaro_linux_gcc/arm-linux-gnueabihf-nm",
-            ),
-            tool_path(
-                name = "objcopy",
-                path = "linaro_linux_gcc/arm-linux-gnueabihf-objcopy",
-            ),
-            tool_path(
-                name = "objdump",
-                path = "linaro_linux_gcc/arm-linux-gnueabihf-objdump",
-            ),
-            tool_path(
-                name = "strip",
-                path = "linaro_linux_gcc/arm-linux-gnueabihf-strip",
-            ),
-        ]
     elif ctx.attr.cpu == "armeabi-v7a":
         tool_paths = [
             tool_path(name = "ar", path = "/bin/false"),
@@ -1973,7 +1336,7 @@
 cc_toolchain_config = rule(
     implementation = _impl,
     attrs = {
-        "cpu": attr.string(mandatory = True, values = ["armeabi-v7a", "armhf-debian", "cortex-m4f", "cortex-m4f-k22", "k8", "roborio", "rp2040"]),
+        "cpu": attr.string(mandatory = True, values = ["armeabi-v7a", "cortex-m4f", "cortex-m4f-k22", "roborio", "rp2040"]),
     },
     provides = [CcToolchainConfigInfo],
     executable = True,