Add loongarch64 support (#1149)
This commit is contained in:
Родитель
47a03cc552
Коммит
56798731f1
|
@ -324,6 +324,8 @@ namespace vcpkg
|
|||
THUMB = 0x1c2, // Thumb
|
||||
WCEMIPSV2 = 0x169, // MIPS little-endian WCE v2
|
||||
LLVM_BITCODE = 0x4342, // LLVM bitcode https://www.llvm.org/docs/BitCodeFormat.html#llvm-ir-magic-number
|
||||
LOONGARCH32 = 0x6232, // LoongArch 32-bit processor family
|
||||
LOONGARCH64 = 0x6264, // LoongArch 64-bit processor family
|
||||
};
|
||||
|
||||
enum class PEType
|
||||
|
|
|
@ -13,5 +13,7 @@ namespace vcpkg
|
|||
PPC64LE,
|
||||
RISCV32,
|
||||
RISCV64,
|
||||
LOONGARCH32,
|
||||
LOONGARCH64,
|
||||
};
|
||||
}
|
||||
|
|
|
@ -155,6 +155,8 @@ namespace vcpkg
|
|||
if (Strings::case_insensitive_ascii_equals(arch, "ppc64le")) return CPUArchitecture::PPC64LE;
|
||||
if (Strings::case_insensitive_ascii_equals(arch, "riscv32")) return CPUArchitecture::RISCV32;
|
||||
if (Strings::case_insensitive_ascii_equals(arch, "riscv64")) return CPUArchitecture::RISCV64;
|
||||
if (Strings::case_insensitive_ascii_equals(arch, "loongarch32")) return CPUArchitecture::LOONGARCH32;
|
||||
if (Strings::case_insensitive_ascii_equals(arch, "loongarch64")) return CPUArchitecture::LOONGARCH64;
|
||||
|
||||
return nullopt;
|
||||
}
|
||||
|
@ -172,6 +174,8 @@ namespace vcpkg
|
|||
case CPUArchitecture::PPC64LE: return "ppc64le";
|
||||
case CPUArchitecture::RISCV32: return "riscv32";
|
||||
case CPUArchitecture::RISCV64: return "riscv64";
|
||||
case CPUArchitecture::LOONGARCH32: return "loongarch32";
|
||||
case CPUArchitecture::LOONGARCH64: return "loongarch64";
|
||||
default: Checks::exit_with_message(VCPKG_LINE_INFO, "unexpected vcpkg::CPUArchitecture");
|
||||
}
|
||||
}
|
||||
|
@ -269,6 +273,10 @@ namespace vcpkg
|
|||
return CPUArchitecture::RISCV32;
|
||||
#elif defined(__riscv) && defined(__riscv_xlen) && (__riscv_xlen == 64)
|
||||
return CPUArchitecture::RISCV64;
|
||||
#elif defined(__loongarch32) || defined(__loongarch__) && (__loongarch_grlen == 32)
|
||||
return CPUArchitecture::LOONGARCH32;
|
||||
#elif defined(__loongarch64) || defined(__loongarch__) && (__loongarch_grlen == 64)
|
||||
return CPUArchitecture::LOONGARCH64;
|
||||
#else // choose architecture
|
||||
#error "Unknown host architecture"
|
||||
#endif // choose architecture
|
||||
|
|
|
@ -575,6 +575,8 @@ namespace vcpkg
|
|||
case MachineType::THUMB: return "thumb";
|
||||
case MachineType::WCEMIPSV2: return "mips-le-wce-v2";
|
||||
case MachineType::LLVM_BITCODE: return "llvm-bitcode";
|
||||
case MachineType::LOONGARCH32: return "loongarch32";
|
||||
case MachineType::LOONGARCH64: return "loongarch64";
|
||||
default: return fmt::format("unknown-{}", static_cast<uint16_t>(machine_type));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -84,6 +84,14 @@ namespace vcpkg
|
|||
{
|
||||
return CPUArchitecture::RISCV64;
|
||||
}
|
||||
if (Strings::starts_with(this->canonical_name(), "loongarch32-"))
|
||||
{
|
||||
return CPUArchitecture::LOONGARCH32;
|
||||
}
|
||||
if (Strings::starts_with(this->canonical_name(), "loongarch64-"))
|
||||
{
|
||||
return CPUArchitecture::LOONGARCH64;
|
||||
}
|
||||
|
||||
return nullopt;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче