From: Martin Storsjö martin@martin.st
The arm assembly only can be built on arm. The functions aren't needed in other configurations, so only include them for the arm/msvc configuration by wrapping them in "#if defined(__arm__) && defined(_MSC_VER)" conditions. --- libs/compiler-rt/arm/aeabi_idivmod.S | 3 ++- libs/compiler-rt/arm/aeabi_ldivmod.S | 3 ++- libs/compiler-rt/arm/aeabi_uidivmod.S | 3 ++- libs/compiler-rt/arm/aeabi_uldivmod.S | 3 ++- libs/compiler-rt/arm/divmodsi4.S | 3 ++- libs/compiler-rt/arm/udivmodsi4.S | 3 ++- libs/compiler-rt/divdi3.c | 2 ++ libs/compiler-rt/divmoddi4.c | 2 ++ libs/compiler-rt/fixdfdi.c | 2 ++ libs/compiler-rt/fixsfdi.c | 2 ++ libs/compiler-rt/fixunsdfdi.c | 2 ++ libs/compiler-rt/fixunssfdi.c | 2 ++ libs/compiler-rt/floatdidf.c | 2 ++ libs/compiler-rt/floatdisf.c | 2 ++ libs/compiler-rt/floatundidf.c | 2 ++ libs/compiler-rt/floatundisf.c | 2 ++ libs/compiler-rt/mingw_fixfloat.c | 2 ++ libs/compiler-rt/udivmoddi4.c | 2 ++ 18 files changed, 36 insertions(+), 6 deletions(-)
diff --git a/libs/compiler-rt/arm/aeabi_idivmod.S b/libs/compiler-rt/arm/aeabi_idivmod.S index dadffb3ca87..fd464c2dfca 100644 --- a/libs/compiler-rt/arm/aeabi_idivmod.S +++ b/libs/compiler-rt/arm/aeabi_idivmod.S @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===//
+#if defined(__arm__) && defined(_MSC_VER) #include "../assembly.h"
// struct { int quot, int rem} __aeabi_idivmod(int numerator, int denominator) { @@ -48,4 +49,4 @@ DEFINE_COMPILERRT_FUNCTION(__aeabi_idivmod) END_COMPILERRT_FUNCTION(__aeabi_idivmod)
NO_EXEC_STACK_DIRECTIVE - +#endif diff --git a/libs/compiler-rt/arm/aeabi_ldivmod.S b/libs/compiler-rt/arm/aeabi_ldivmod.S index ca47e42cf15..dbe77f7439f 100644 --- a/libs/compiler-rt/arm/aeabi_ldivmod.S +++ b/libs/compiler-rt/arm/aeabi_ldivmod.S @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===//
+#if defined(__arm__) && defined(_MSC_VER) #include "../assembly.h"
// struct { int64_t quot, int64_t rem} @@ -43,4 +44,4 @@ DEFINE_COMPILERRT_FUNCTION(__aeabi_ldivmod) END_COMPILERRT_FUNCTION(__aeabi_ldivmod)
NO_EXEC_STACK_DIRECTIVE - +#endif diff --git a/libs/compiler-rt/arm/aeabi_uidivmod.S b/libs/compiler-rt/arm/aeabi_uidivmod.S index 06462c9cf35..095807c2ae7 100644 --- a/libs/compiler-rt/arm/aeabi_uidivmod.S +++ b/libs/compiler-rt/arm/aeabi_uidivmod.S @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===//
+#if defined(__arm__) && defined(_MSC_VER) #include "../assembly.h"
// struct { unsigned quot, unsigned rem} @@ -55,4 +56,4 @@ LOCAL_LABEL(case_denom_larger): END_COMPILERRT_FUNCTION(__aeabi_uidivmod)
NO_EXEC_STACK_DIRECTIVE - +#endif diff --git a/libs/compiler-rt/arm/aeabi_uldivmod.S b/libs/compiler-rt/arm/aeabi_uldivmod.S index 689a54ce1ee..501fa3a112e 100644 --- a/libs/compiler-rt/arm/aeabi_uldivmod.S +++ b/libs/compiler-rt/arm/aeabi_uldivmod.S @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===//
+#if defined(__arm__) && defined(_MSC_VER) #include "../assembly.h"
// struct { uint64_t quot, uint64_t rem} @@ -43,4 +44,4 @@ DEFINE_COMPILERRT_FUNCTION(__aeabi_uldivmod) END_COMPILERRT_FUNCTION(__aeabi_uldivmod)
NO_EXEC_STACK_DIRECTIVE - +#endif diff --git a/libs/compiler-rt/arm/divmodsi4.S b/libs/compiler-rt/arm/divmodsi4.S index 8a027b741ef..9aadd91aef9 100644 --- a/libs/compiler-rt/arm/divmodsi4.S +++ b/libs/compiler-rt/arm/divmodsi4.S @@ -13,6 +13,7 @@ * *===----------------------------------------------------------------------===*/
+#if defined(__arm__) && defined(_MSC_VER) #include "../assembly.h"
#define ESTABLISH_FRAME \ @@ -68,4 +69,4 @@ LOCAL_LABEL(divzero): END_COMPILERRT_FUNCTION(__divmodsi4)
NO_EXEC_STACK_DIRECTIVE - +#endif diff --git a/libs/compiler-rt/arm/udivmodsi4.S b/libs/compiler-rt/arm/udivmodsi4.S index ee3950c9b0e..7b8a2566bf3 100644 --- a/libs/compiler-rt/arm/udivmodsi4.S +++ b/libs/compiler-rt/arm/udivmodsi4.S @@ -12,6 +12,7 @@ * *===----------------------------------------------------------------------===*/
+#if defined(__arm__) && defined(_MSC_VER) #include "../assembly.h"
.syntax unified @@ -177,4 +178,4 @@ LOCAL_LABEL(divby0): END_COMPILERRT_FUNCTION(__udivmodsi4)
NO_EXEC_STACK_DIRECTIVE - +#endif diff --git a/libs/compiler-rt/divdi3.c b/libs/compiler-rt/divdi3.c index b8eebcb2046..1ab4d4ae780 100644 --- a/libs/compiler-rt/divdi3.c +++ b/libs/compiler-rt/divdi3.c @@ -12,6 +12,7 @@ * ===----------------------------------------------------------------------=== */
+#if defined(__arm__) && defined(_MSC_VER) #include "int_lib.h"
/* Returns: a / b */ @@ -27,3 +28,4 @@ __divdi3(di_int a, di_int b) s_a ^= s_b; /*sign of quotient */ return (__udivmoddi4(a, b, (du_int*)0) ^ s_a) - s_a; /* negate if s_a == -1 */ } +#endif diff --git a/libs/compiler-rt/divmoddi4.c b/libs/compiler-rt/divmoddi4.c index 0d4df67a63e..60433ce9c22 100644 --- a/libs/compiler-rt/divmoddi4.c +++ b/libs/compiler-rt/divmoddi4.c @@ -12,6 +12,7 @@ * ===----------------------------------------------------------------------=== */
+#if defined(__arm__) && defined(_MSC_VER) #include "int_lib.h"
/* Returns: a / b, *rem = a % b */ @@ -23,3 +24,4 @@ __divmoddi4(di_int a, di_int b, di_int* rem) *rem = a - (d*b); return d; } +#endif diff --git a/libs/compiler-rt/fixdfdi.c b/libs/compiler-rt/fixdfdi.c index 54e312d3c8f..a13d798823c 100644 --- a/libs/compiler-rt/fixdfdi.c +++ b/libs/compiler-rt/fixdfdi.c @@ -8,6 +8,7 @@ * ===----------------------------------------------------------------------=== */
+#if defined(__arm__) && defined(_MSC_VER) #define DOUBLE_PRECISION #include "fp_lib.h"
@@ -53,3 +54,4 @@ AEABI_RTABI di_int __aeabi_d2lz(fp_t a) { AEABI_RTABI di_int __aeabi_d2lz(fp_t a) COMPILER_RT_ALIAS(__fixdfdi); #endif #endif +#endif diff --git a/libs/compiler-rt/fixsfdi.c b/libs/compiler-rt/fixsfdi.c index 32e87c60889..7b85d993076 100644 --- a/libs/compiler-rt/fixsfdi.c +++ b/libs/compiler-rt/fixsfdi.c @@ -8,6 +8,7 @@ * ===----------------------------------------------------------------------=== */
+#if defined(__arm__) && defined(_MSC_VER) #define SINGLE_PRECISION #include "fp_lib.h"
@@ -53,3 +54,4 @@ AEABI_RTABI di_int __aeabi_f2lz(fp_t a) { AEABI_RTABI di_int __aeabi_f2lz(fp_t a) COMPILER_RT_ALIAS(__fixsfdi); #endif #endif +#endif diff --git a/libs/compiler-rt/fixunsdfdi.c b/libs/compiler-rt/fixunsdfdi.c index bfe4dbb2565..e4f75dd8507 100644 --- a/libs/compiler-rt/fixunsdfdi.c +++ b/libs/compiler-rt/fixunsdfdi.c @@ -8,6 +8,7 @@ * ===----------------------------------------------------------------------=== */
+#if defined(__arm__) && defined(_MSC_VER) #define DOUBLE_PRECISION #include "fp_lib.h"
@@ -50,3 +51,4 @@ AEABI_RTABI du_int __aeabi_d2ulz(fp_t a) { AEABI_RTABI du_int __aeabi_d2ulz(fp_t a) COMPILER_RT_ALIAS(__fixunsdfdi); #endif #endif +#endif diff --git a/libs/compiler-rt/fixunssfdi.c b/libs/compiler-rt/fixunssfdi.c index 080a25bb1e9..97687342bec 100644 --- a/libs/compiler-rt/fixunssfdi.c +++ b/libs/compiler-rt/fixunssfdi.c @@ -8,6 +8,7 @@ * ===----------------------------------------------------------------------=== */
+#if defined(__arm__) && defined(_MSC_VER) #define SINGLE_PRECISION #include "fp_lib.h"
@@ -51,3 +52,4 @@ AEABI_RTABI du_int __aeabi_f2ulz(fp_t a) { AEABI_RTABI du_int __aeabi_f2ulz(fp_t a) COMPILER_RT_ALIAS(__fixunssfdi); #endif #endif +#endif diff --git a/libs/compiler-rt/floatdidf.c b/libs/compiler-rt/floatdidf.c index 36b856e078d..4022f72857a 100644 --- a/libs/compiler-rt/floatdidf.c +++ b/libs/compiler-rt/floatdidf.c @@ -12,6 +12,7 @@ *===----------------------------------------------------------------------=== */
+#if defined(__arm__) && defined(_MSC_VER) #include "int_lib.h"
/* Returns: convert a to a double, rounding toward even. */ @@ -113,3 +114,4 @@ AEABI_RTABI double __aeabi_l2d(di_int a) { AEABI_RTABI double __aeabi_l2d(di_int a) COMPILER_RT_ALIAS(__floatdidf); #endif #endif +#endif diff --git a/libs/compiler-rt/floatdisf.c b/libs/compiler-rt/floatdisf.c index a2f09eb2ed2..e71fcb9e5ad 100644 --- a/libs/compiler-rt/floatdisf.c +++ b/libs/compiler-rt/floatdisf.c @@ -12,6 +12,7 @@ *===----------------------------------------------------------------------=== */
+#if defined(__arm__) && defined(_MSC_VER) /* Returns: convert a to a float, rounding toward even.*/
/* Assumption: float is a IEEE 32 bit floating point type @@ -86,3 +87,4 @@ AEABI_RTABI float __aeabi_l2f(di_int a) { AEABI_RTABI float __aeabi_l2f(di_int a) COMPILER_RT_ALIAS(__floatdisf); #endif #endif +#endif diff --git a/libs/compiler-rt/floatundidf.c b/libs/compiler-rt/floatundidf.c index 8bc2a096324..a28c9c39f4c 100644 --- a/libs/compiler-rt/floatundidf.c +++ b/libs/compiler-rt/floatundidf.c @@ -12,6 +12,7 @@ * ===----------------------------------------------------------------------=== */
+#if defined(__arm__) && defined(_MSC_VER) /* Returns: convert a to a double, rounding toward even. */
/* Assumption: double is a IEEE 64 bit floating point type @@ -112,3 +113,4 @@ AEABI_RTABI double __aeabi_ul2d(du_int a) { AEABI_RTABI double __aeabi_ul2d(du_int a) COMPILER_RT_ALIAS(__floatundidf); #endif #endif +#endif diff --git a/libs/compiler-rt/floatundisf.c b/libs/compiler-rt/floatundisf.c index 844786ea777..7d8f7c3d977 100644 --- a/libs/compiler-rt/floatundisf.c +++ b/libs/compiler-rt/floatundisf.c @@ -12,6 +12,7 @@ *===----------------------------------------------------------------------=== */
+#if defined(__arm__) && defined(_MSC_VER) /* Returns: convert a to a float, rounding toward even. */
/* Assumption: float is a IEEE 32 bit floating point type @@ -83,3 +84,4 @@ AEABI_RTABI float __aeabi_ul2f(du_int a) { AEABI_RTABI float __aeabi_ul2f(du_int a) COMPILER_RT_ALIAS(__floatundisf); #endif #endif +#endif diff --git a/libs/compiler-rt/mingw_fixfloat.c b/libs/compiler-rt/mingw_fixfloat.c index c462e0dbf65..d94bcbd4262 100644 --- a/libs/compiler-rt/mingw_fixfloat.c +++ b/libs/compiler-rt/mingw_fixfloat.c @@ -8,6 +8,7 @@ * ===----------------------------------------------------------------------=== */
+#if defined(__arm__) && defined(_MSC_VER) #include "int_lib.h"
COMPILER_RT_ABI di_int __fixdfdi(double a); @@ -34,3 +35,4 @@ COMPILER_RT_ABI float __i64tos(di_int a) { return __floatdisf(a); } COMPILER_RT_ABI double __u64tod(du_int a) { return __floatundidf(a); }
COMPILER_RT_ABI float __u64tos(du_int a) { return __floatundisf(a); } +#endif diff --git a/libs/compiler-rt/udivmoddi4.c b/libs/compiler-rt/udivmoddi4.c index 0c8b4ff4647..5338287ecf0 100644 --- a/libs/compiler-rt/udivmoddi4.c +++ b/libs/compiler-rt/udivmoddi4.c @@ -12,6 +12,7 @@ * ===----------------------------------------------------------------------=== */
+#if defined(__arm__) && defined(_MSC_VER) #include "int_lib.h"
/* Effects: if rem != 0, *rem = a % b @@ -229,3 +230,4 @@ __udivmoddi4(du_int a, du_int b, du_int* rem) *rem = r.all; return q.all; } +#endif