From 4d2b8146d2c88b0c1f0fa3c6f064f8aa8137a238 Mon Sep 17 00:00:00 2001 From: WANG Rui Date: Tue, 14 Nov 2023 18:43:39 +0800 Subject: [PATCH] Add compiler-rt fallbacks on loongarch64-musl --- build.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/build.rs b/build.rs index 6268fd2f..1b901b7e 100644 --- a/build.rs +++ b/build.rs @@ -514,6 +514,24 @@ mod c { ]); } + if target_arch == "loongarch64" { + sources.extend(&[ + ("__extenddftf2", "extenddftf2.c"), + ("__netf2", "comparetf2.c"), + ("__addtf3", "addtf3.c"), + ("__multf3", "multf3.c"), + ("__subtf3", "subtf3.c"), + ("__fixtfsi", "fixtfsi.c"), + ("__floatsitf", "floatsitf.c"), + ("__fixunstfsi", "fixunstfsi.c"), + ("__floatunsitf", "floatunsitf.c"), + ("__fe_getround", "fp_mode.c"), + ("__divtf3", "divtf3.c"), + ("__trunctfdf2", "trunctfdf2.c"), + ("__trunctfsf2", "trunctfsf2.c"), + ]); + } + // Remove the assembly implementations that won't compile for the target if llvm_target[0] == "thumbv6m" || llvm_target[0] == "thumbv8m.base" || target_os == "uefi" {