From a75a49990cf4ba1fd790600caabf29d2837dda96 Mon Sep 17 00:00:00 2001 From: Paolo Teti Date: Fri, 19 Jan 2018 09:04:57 +0100 Subject: [PATCH 1/2] Skip aeabi_cdcmp and aeabi_cfcmp on big-endian targets First of all aeabi_cdcmp and aeabi_cfcmp are never called LLVM. Second are little-endian only, so build fail on big-endian targets. Temporally workaround: exclude these files for big-endian targets. --- build.rs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/build.rs b/build.rs index cc3121e..0b27598 100644 --- a/build.rs +++ b/build.rs @@ -5430,10 +5430,6 @@ mod c { if target_arch == "arm" && target_os != "ios" { sources.extend( &[ - "arm/aeabi_cdcmp.S", - "arm/aeabi_cdcmpeq_check_nan.c", - "arm/aeabi_cfcmp.S", - "arm/aeabi_cfcmpeq_check_nan.c", "arm/aeabi_dcmp.S", "arm/aeabi_div0.c", "arm/aeabi_drsub.c", @@ -5467,6 +5463,20 @@ mod c { // "arm/udivsi3.S", ], ); + + // First of all aeabi_cdcmp and aeabi_cfcmp are never called LLVM. + // Second are little-endian only, so build fail on big-endian targets. + // Temporally workaround: exclude these files for big-endian targets. + if !llvm_target[0].starts_with("thumbeb") && + !llvm_target[0].starts_with("armeb") { + sources.extend( + &[ + "arm/aeabi_cdcmp.S", + "arm/aeabi_cdcmpeq_check_nan.c", + "arm/aeabi_cfcmp.S", + "arm/aeabi_cfcmpeq_check_nan.c", + ], + ); } if llvm_target[0] == "armv7" { From 083f107c5ed3f2cc83fc5de8b1472ed3a47cd68a Mon Sep 17 00:00:00 2001 From: Paolo Teti Date: Fri, 19 Jan 2018 19:27:25 +0100 Subject: [PATCH 2/2] Fix build issue and comments Fix an unclosed if block --- build.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.rs b/build.rs index 0b27598..cb8f810 100644 --- a/build.rs +++ b/build.rs @@ -5464,7 +5464,7 @@ mod c { ], ); - // First of all aeabi_cdcmp and aeabi_cfcmp are never called LLVM. + // First of all aeabi_cdcmp and aeabi_cfcmp are never called by LLVM. // Second are little-endian only, so build fail on big-endian targets. // Temporally workaround: exclude these files for big-endian targets. if !llvm_target[0].starts_with("thumbeb") && @@ -5477,6 +5477,7 @@ mod c { "arm/aeabi_cfcmpeq_check_nan.c", ], ); + } } if llvm_target[0] == "armv7" {