diff --git a/src/conditions/BUILD b/src/conditions/BUILD index 6fd49f313a20dc..7b12cd5fd52e9a 100644 --- a/src/conditions/BUILD +++ b/src/conditions/BUILD @@ -84,6 +84,15 @@ config_setting( visibility = ["//visibility:public"], ) +config_setting( + name = "linux_loongarch64", + constraint_values = [ + "@platforms//os:linux", + "@platforms//cpu:loongarch64", + ], + visibility = ["//visibility:public"], +) + config_setting( name = "linux_x86_64", constraint_values = [ diff --git a/src/conditions/BUILD.tools b/src/conditions/BUILD.tools index aafdb4fb34786f..6641d43f983c94 100644 --- a/src/conditions/BUILD.tools +++ b/src/conditions/BUILD.tools @@ -69,6 +69,15 @@ config_setting( visibility = ["//visibility:public"], ) +config_setting( + name = "linux_loongarch64", + constraint_values = [ + "@platforms//os:linux", + "@platforms//cpu:loongarch64", + ], + visibility = ["//visibility:public"], +) + config_setting( name = "linux_x86_64", constraint_values = [ diff --git a/src/main/java/com/google/devtools/build/lib/analysis/config/AutoCpuConverter.java b/src/main/java/com/google/devtools/build/lib/analysis/config/AutoCpuConverter.java index 6581faddd57d55..3cef313834a5d1 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/config/AutoCpuConverter.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/config/AutoCpuConverter.java @@ -56,6 +56,7 @@ public String convert(String input) throws OptionsParsingException { case S390X -> "s390x"; case MIPS64 -> "mips64"; case RISCV64 -> "riscv64"; + case LOONGARCH64 -> "loongarch64"; default -> "unknown"; }; default -> "unknown"; diff --git a/src/main/java/com/google/devtools/build/lib/util/CPU.java b/src/main/java/com/google/devtools/build/lib/util/CPU.java index 88ae4a32f3de77..04f3e7d00951c8 100644 --- a/src/main/java/com/google/devtools/build/lib/util/CPU.java +++ b/src/main/java/com/google/devtools/build/lib/util/CPU.java @@ -29,6 +29,7 @@ public enum CPU { S390X("s390x", ImmutableSet.of("s390x", "s390")), MIPS64("mips64", ImmutableSet.of("mips64el", "mips64")), RISCV64("riscv64", ImmutableSet.of("riscv64")), + LOONGARCH64("loongarch64", ImmutableSet.of("loongarch64")), UNKNOWN("unknown", ImmutableSet.of()); private final String canonicalName;