diff --git a/build.rs b/build.rs index cbebca6207f2a..18004edfeb1b4 100644 --- a/build.rs +++ b/build.rs @@ -52,7 +52,7 @@ const CHECK_CFG_EXTRA: &[(&str, &[&str])] = &[ ]; /// Musl architectures that set `#define _REDIR_TIME64 1`. -const MUSL_REDIR_TIME64_ARCHES: &[&str] = &["arm", "mips", "powerpc", "x86"]; +const MUSL_REDIR_TIME64_ARCHES: &[&str] = &["arm", "hexagon", "mips", "powerpc", "x86"]; fn main() { // Avoid unnecessary re-building. @@ -110,8 +110,8 @@ fn main() { // OpenHarmony uses a fork of the musl libc let musl = target_env == "musl" || target_env == "ohos"; - // loongarch64 and ohos only exist with recent musl - if target_arch == "loongarch64" || target_env == "ohos" { + // loongarch64, hexagon, and ohos only exist with recent musl + if target_arch == "loongarch64" || target_arch == "hexagon" || target_env == "ohos" { musl_v1_2_3 = true; } diff --git a/libc-test/build.rs b/libc-test/build.rs index 1cbacfde9d979..68b224c8b9972 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -3685,6 +3685,7 @@ fn test_linux(target: &str) { let gnueabihf = target.contains("gnueabihf"); let x86_64_gnux32 = target.contains("gnux32") && x86_64; let riscv64 = target.contains("riscv64"); + let hexagon = target.contains("hexagon"); let loongarch64 = target.contains("loongarch64"); let wasm32 = target.contains("wasm32"); let uclibc = target.contains("uclibc"); @@ -3699,9 +3700,9 @@ fn test_linux(target: &str) { let old_musl = musl && !musl_v1_2_3; let mut cfg = ctest_cfg(); - if (musl_v1_2_3 || loongarch64) && musl { + if (musl_v1_2_3 || loongarch64 || hexagon) && musl { cfg.cfg("musl_v1_2_3", None); - if arm || ppc32 || x86_32 || mips32 { + if arm || hexagon || ppc32 || x86_32 || mips32 { cfg.cfg("musl32_time64", None); cfg.cfg("linux_time_bits64", None); }