Build compiler-rt using cmake, add arm division and float/int64 conversion routines
Build using the master branch instead of 3.9. By building using cmake, we don't need to build the files that require an upper case Windows.h.
This commit is contained in:
1 parent
8afb6e784f
commit
e22accd247
3 files changed
+377
-54
No files matched your search
+15
-11
@@ -40,8 +40,6 @@ RUN cd llvm/tools/lld && \
|
|||||||
#RUN cd llvm/projects/libcxx && \
|
#RUN cd llvm/projects/libcxx && \
|
||||||
# git am /build/patches/libcxx-*.patch
|
# git am /build/patches/libcxx-*.patch
|
||||||
|
|
||||||
RUN git clone -b release_39 --depth=1 https://github.com/llvm-mirror/compiler-rt.git
|
|
||||||
|
|
||||||
RUN mkdir /build/prefix
|
RUN mkdir /build/prefix
|
||||||
|
|
||||||
# Build LLVM
|
# Build LLVM
|
||||||
@@ -106,20 +104,26 @@ RUN cd mingw-w64/mingw-w64-crt && \
|
|||||||
|
|
||||||
RUN cp /build/mingw-w64/mingw-w64-libraries/winpthreads/include/* $MINGW_PREFIX/include/
|
RUN cp /build/mingw-w64/mingw-w64-libraries/winpthreads/include/* $MINGW_PREFIX/include/
|
||||||
|
|
||||||
#Work around upstream issue with capital W windows.h - this is required
|
|
||||||
#by compiler-rt, see e.g. https://reviews.llvm.org/D23308.
|
|
||||||
RUN ln -s /build/prefix/armv7-w64-mingw32/include/windows.h /build/prefix/armv7-w64-mingw32/include/Windows.h
|
|
||||||
|
|
||||||
COPY patches/compiler-rt-*.patch /build/patches/
|
COPY patches/compiler-rt-*.patch /build/patches/
|
||||||
|
RUN git clone -b master --depth=1 https://github.com/llvm-mirror/compiler-rt.git
|
||||||
RUN cd compiler-rt && \
|
RUN cd compiler-rt && \
|
||||||
git am /build/patches/compiler-rt-*.patch
|
git am /build/patches/compiler-rt-*.patch
|
||||||
|
|
||||||
# Manually build compiler-rt as a standalone project
|
# Manually build compiler-rt as a standalone project
|
||||||
RUN cd compiler-rt && \
|
RUN cd compiler-rt && mkdir build && cd build && cmake \
|
||||||
make clang_mingw-builtins-arm RANLIB=llvm-ranlib AR=llvm-ar
|
-DCMAKE_C_COMPILER=$CC \
|
||||||
|
-DCMAKE_CXX_COMPILER=$CXX \
|
||||||
RUN mkdir -p /build/prefix/lib/clang/3.9.0/lib/windows && \
|
-DCMAKE_SYSTEM_NAME=Windows \
|
||||||
cp /build/compiler-rt/clang_mingw/builtins-arm/libcompiler_rt.a /build/prefix/lib/clang/3.9.0/lib/windows/libclang_rt.builtins-arm.a
|
-DCMAKE_AR=$TOOLCHAIN_PREFIX/bin/$AR \
|
||||||
|
-DCMAKE_RANLIB=$TOOLCHAIN_PREFIX/bin/$RANLIB \
|
||||||
|
-DCMAKE_C_COMPILER_WORKS=1 \
|
||||||
|
-DLLVM_CONFIG_PATH=$TOOLCHAIN_PREFIX/bin/llvm-config \
|
||||||
|
-DCOMPILER_RT_DEFAULT_TARGET_TRIPLE="armv7--windows-gnu" \
|
||||||
|
-DCMAKE_SIZEOF_VOID_P=4 \
|
||||||
|
../lib/builtins && \
|
||||||
|
make -j4 && \
|
||||||
|
mkdir -p /build/prefix/lib/clang/3.9.0/lib/windows && \
|
||||||
|
cp lib/windows/libclang_rt.builtins-arm.a /build/prefix/lib/clang/3.9.0/lib/windows
|
||||||
|
|
||||||
RUN cd mingw-w64/mingw-w64-libraries && cd winstorecompat && \
|
RUN cd mingw-w64/mingw-w64-libraries && cd winstorecompat && \
|
||||||
autoreconf -vif && \
|
autoreconf -vif && \
|
||||||
|
|||||||
+318
-43
@@ -1,55 +1,330 @@
|
|||||||
From 1e1bd1b7ddb2b259a88fcdc3fdeea6fad16d3b11 Mon Sep 17 00:00:00 2001
|
From b362e07e7a8e0d11291d1bc681eebef2cc000b74 Mon Sep 17 00:00:00 2001
|
||||||
From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin@martin.st>
|
From: Martell Malone <martellmalone@gmail.com>
|
||||||
Date: Tue, 9 Aug 2016 23:50:59 +0300
|
Date: Tue, 16 Aug 2016 15:50:50 -0700
|
||||||
Subject: [PATCH] Fix "make clang_mingw-builtins-arm" with latest master
|
Subject: [PATCH 1/2] builtins: add support for windows arm divide functions
|
||||||
|
|
||||||
This does the same to clang_linux.mk as was done in SVN rev
|
The divmod functions work in the same way as the corresponding
|
||||||
258863, git mirror commit 20da67f8d3f8.
|
__rt_*div* functions for windows, but their parameters are swapped.
|
||||||
---
|
---
|
||||||
make/platform/clang_linux.mk | 14 ++------------
|
cmake/base-config-ix.cmake | 2 +-
|
||||||
1 file changed, 2 insertions(+), 12 deletions(-)
|
cmake/builtin-config-ix.cmake | 2 +-
|
||||||
|
lib/builtins/CMakeLists.txt | 25 ++++++++++++++++++++++++-
|
||||||
|
lib/builtins/arm/aeabi_idivmod.S | 9 +++++++++
|
||||||
|
lib/builtins/arm/aeabi_ldivmod.S | 12 ++++++++++++
|
||||||
|
lib/builtins/arm/aeabi_uidivmod.S | 9 +++++++++
|
||||||
|
lib/builtins/arm/aeabi_uldivmod.S | 12 ++++++++++++
|
||||||
|
lib/builtins/fixdfdi.c | 8 ++++++++
|
||||||
|
lib/builtins/fixsfdi.c | 8 ++++++++
|
||||||
|
lib/builtins/fixunsdfdi.c | 8 ++++++++
|
||||||
|
lib/builtins/fixunssfdi.c | 8 ++++++++
|
||||||
|
lib/builtins/floatdidf.c | 8 ++++++++
|
||||||
|
lib/builtins/floatdisf.c | 8 ++++++++
|
||||||
|
lib/builtins/floatundidf.c | 8 ++++++++
|
||||||
|
lib/builtins/floatundisf.c | 8 ++++++++
|
||||||
|
15 files changed, 132 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
diff --git a/make/platform/clang_linux.mk b/make/platform/clang_linux.mk
|
diff --git a/cmake/base-config-ix.cmake b/cmake/base-config-ix.cmake
|
||||||
index 870209f..6dce2e1 100644
|
index 830e443..644cea2 100644
|
||||||
--- a/make/platform/clang_linux.mk
|
--- a/cmake/base-config-ix.cmake
|
||||||
+++ b/make/platform/clang_linux.mk
|
+++ b/cmake/base-config-ix.cmake
|
||||||
@@ -49,16 +49,14 @@ endif
|
@@ -153,7 +153,7 @@ macro(test_targets)
|
||||||
|
elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "mips")
|
||||||
|
test_target_arch(mips "" "-mips32r2" "--target=mips-linux-gnu")
|
||||||
|
test_target_arch(mips64 "" "-mips64r2" "--target=mips64-linux-gnu" "-mabi=64")
|
||||||
|
- elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "arm")
|
||||||
|
+ elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "arm|armv7")
|
||||||
|
if(WIN32)
|
||||||
|
test_target_arch(arm "" "" "")
|
||||||
|
else()
|
||||||
|
diff --git a/cmake/builtin-config-ix.cmake b/cmake/builtin-config-ix.cmake
|
||||||
|
index 9289618..bf15570 100644
|
||||||
|
--- a/cmake/builtin-config-ix.cmake
|
||||||
|
+++ b/cmake/builtin-config-ix.cmake
|
||||||
|
@@ -2,7 +2,7 @@ include(BuiltinTests)
|
||||||
|
include(CheckCSourceCompiles)
|
||||||
|
|
||||||
# Build runtime libraries for i386.
|
# Make all the tests only check the compiler
|
||||||
ifeq ($(call contains,$(SupportedArches),i386),true)
|
-set(TEST_COMPILE_ONLY On)
|
||||||
-Configs += builtins-i386 profile-i386
|
+set(TEST_COMPILE_ONLY TRUE)
|
||||||
+Configs += builtins-i386
|
|
||||||
Arch.builtins-i386 := i386
|
|
||||||
-Arch.profile-i386 := i386
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Build runtime libraries for x86_64.
|
builtin_check_c_compiler_flag(-fPIC COMPILER_RT_HAS_FPIC_FLAG)
|
||||||
ifeq ($(call contains,$(SupportedArches),x86_64),true)
|
builtin_check_c_compiler_flag(-fPIE COMPILER_RT_HAS_FPIE_FLAG)
|
||||||
-Configs += builtins-x86_64 profile-x86_64
|
diff --git a/lib/builtins/CMakeLists.txt b/lib/builtins/CMakeLists.txt
|
||||||
+Configs += builtins-x86_64
|
index a7d665e..18bdee9 100644
|
||||||
Arch.builtins-x86_64 := x86_64
|
--- a/lib/builtins/CMakeLists.txt
|
||||||
-Arch.profile-x86_64 := x86_64
|
+++ b/lib/builtins/CMakeLists.txt
|
||||||
endif
|
@@ -367,7 +367,30 @@ set(arm_Thumb1_SOURCES
|
||||||
|
${arm_Thumb1_VFPv2_SOURCES}
|
||||||
|
${arm_Thumb1_icache_SOURCES})
|
||||||
|
|
||||||
endif
|
-if(NOT WIN32)
|
||||||
@@ -71,17 +69,9 @@ CFLAGS := -Wall -Werror -O3 -fomit-frame-pointer
|
+if(WIN32)
|
||||||
|
+ set(arm_SOURCES
|
||||||
|
+ fixdfdi.c
|
||||||
|
+ fixsfdi.c
|
||||||
|
+ fixunsdfdi.c
|
||||||
|
+ fixunssfdi.c
|
||||||
|
+ floatdidf.c
|
||||||
|
+ floatdisf.c
|
||||||
|
+ floatundidf.c
|
||||||
|
+ floatundisf.c
|
||||||
|
+ arm/aeabi_idivmod.S
|
||||||
|
+ arm/aeabi_ldivmod.S
|
||||||
|
+ arm/aeabi_uidivmod.S
|
||||||
|
+ arm/aeabi_uldivmod.S
|
||||||
|
+ divmoddi4.c
|
||||||
|
+ divmodsi4.c
|
||||||
|
+ divdi3.c
|
||||||
|
+ divsi3.c
|
||||||
|
+ moddi3.c
|
||||||
|
+ udivmoddi4.c
|
||||||
|
+ udivmodsi4.c
|
||||||
|
+ udivsi3.c
|
||||||
|
+ umoddi3.c)
|
||||||
|
+else(WIN32)
|
||||||
|
# TODO the EABI sources should only be added to EABI targets
|
||||||
|
set(arm_SOURCES
|
||||||
|
${arm_SOURCES}
|
||||||
|
diff --git a/lib/builtins/arm/aeabi_idivmod.S b/lib/builtins/arm/aeabi_idivmod.S
|
||||||
|
index 2fcad86..5dab937 100644
|
||||||
|
--- a/lib/builtins/arm/aeabi_idivmod.S
|
||||||
|
+++ b/lib/builtins/arm/aeabi_idivmod.S
|
||||||
|
@@ -15,12 +15,21 @@
|
||||||
|
// return {quot, rem};
|
||||||
|
// }
|
||||||
|
|
||||||
CFLAGS.builtins-i386 := $(CFLAGS) -m32
|
+#ifdef __MINGW32__
|
||||||
CFLAGS.builtins-x86_64 := $(CFLAGS) -m64
|
+#define __aeabi_idivmod __rt_sdiv
|
||||||
-CFLAGS.profile-i386 := $(CFLAGS) -m32
|
+#endif
|
||||||
-CFLAGS.profile-x86_64 := $(CFLAGS) -m64
|
+
|
||||||
|
.syntax unified
|
||||||
|
.p2align 2
|
||||||
|
DEFINE_COMPILERRT_FUNCTION(__aeabi_idivmod)
|
||||||
|
push { lr }
|
||||||
|
sub sp, sp, #4
|
||||||
|
mov r2, sp
|
||||||
|
+#ifdef __MINGW32__
|
||||||
|
+ mov r3, r0
|
||||||
|
+ mov r0, r1
|
||||||
|
+ mov r1, r3
|
||||||
|
+#endif
|
||||||
|
bl SYMBOL_NAME(__divmodsi4)
|
||||||
|
ldr r1, [sp]
|
||||||
|
add sp, sp, #4
|
||||||
|
diff --git a/lib/builtins/arm/aeabi_ldivmod.S b/lib/builtins/arm/aeabi_ldivmod.S
|
||||||
|
index 9f161f3..4821e82 100644
|
||||||
|
--- a/lib/builtins/arm/aeabi_ldivmod.S
|
||||||
|
+++ b/lib/builtins/arm/aeabi_ldivmod.S
|
||||||
|
@@ -16,6 +16,10 @@
|
||||||
|
// return {quot, rem};
|
||||||
|
// }
|
||||||
|
|
||||||
FUNCTIONS.builtins-i386 := $(CommonFunctions) $(ArchFunctions.i386)
|
+#ifdef __MINGW32__
|
||||||
FUNCTIONS.builtins-x86_64 := $(CommonFunctions) $(ArchFunctions.x86_64)
|
+#define __aeabi_ldivmod __rt_sdiv64
|
||||||
-FUNCTIONS.profile-i386 := GCDAProfiling InstrProfiling InstrProfilingBuffer \
|
+#endif
|
||||||
- InstrProfilingFile InstrProfilingPlatformOther \
|
+
|
||||||
- InstrProfilingRuntime InstrProfilingUtil \
|
.syntax unified
|
||||||
- InstrProfilingWriter InstrProfilingValue \
|
.p2align 2
|
||||||
- InstrProfilingMerge InstrProfilingMergeFile
|
DEFINE_COMPILERRT_FUNCTION(__aeabi_ldivmod)
|
||||||
-FUNCTIONS.profile-x86_64 := $(FUNCTIONS.profile-i386)
|
@@ -23,6 +27,14 @@ DEFINE_COMPILERRT_FUNCTION(__aeabi_ldivmod)
|
||||||
|
sub sp, sp, #16
|
||||||
|
add r12, sp, #8
|
||||||
|
str r12, [sp]
|
||||||
|
+#ifdef __MINGW32__
|
||||||
|
+ mov r12, r0
|
||||||
|
+ mov r0, r2
|
||||||
|
+ mov r2, r12
|
||||||
|
+ mov r12, r1
|
||||||
|
+ mov r1, r3
|
||||||
|
+ mov r3, r12
|
||||||
|
+#endif
|
||||||
|
bl SYMBOL_NAME(__divmoddi4)
|
||||||
|
ldr r2, [sp, #8]
|
||||||
|
ldr r3, [sp, #12]
|
||||||
|
diff --git a/lib/builtins/arm/aeabi_uidivmod.S b/lib/builtins/arm/aeabi_uidivmod.S
|
||||||
|
index e1e12d9..6606a50 100644
|
||||||
|
--- a/lib/builtins/arm/aeabi_uidivmod.S
|
||||||
|
+++ b/lib/builtins/arm/aeabi_uidivmod.S
|
||||||
|
@@ -16,12 +16,21 @@
|
||||||
|
// return {quot, rem};
|
||||||
|
// }
|
||||||
|
|
||||||
# Always use optimized variants.
|
+#ifdef __MINGW32__
|
||||||
OPTIMIZED := 1
|
+#define __aeabi_uidivmod __rt_udiv
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
.syntax unified
|
||||||
|
.p2align 2
|
||||||
|
DEFINE_COMPILERRT_FUNCTION(__aeabi_uidivmod)
|
||||||
|
push { lr }
|
||||||
|
sub sp, sp, #4
|
||||||
|
mov r2, sp
|
||||||
|
+#ifdef __MINGW32__
|
||||||
|
+ mov r3, r0
|
||||||
|
+ mov r0, r1
|
||||||
|
+ mov r1, r3
|
||||||
|
+#endif
|
||||||
|
bl SYMBOL_NAME(__udivmodsi4)
|
||||||
|
ldr r1, [sp]
|
||||||
|
add sp, sp, #4
|
||||||
|
diff --git a/lib/builtins/arm/aeabi_uldivmod.S b/lib/builtins/arm/aeabi_uldivmod.S
|
||||||
|
index e8aaef2..60fee45 100644
|
||||||
|
--- a/lib/builtins/arm/aeabi_uldivmod.S
|
||||||
|
+++ b/lib/builtins/arm/aeabi_uldivmod.S
|
||||||
|
@@ -16,6 +16,10 @@
|
||||||
|
// return {quot, rem};
|
||||||
|
// }
|
||||||
|
|
||||||
|
+#ifdef __MINGW32__
|
||||||
|
+#define __aeabi_uldivmod __rt_udiv64
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
.syntax unified
|
||||||
|
.p2align 2
|
||||||
|
DEFINE_COMPILERRT_FUNCTION(__aeabi_uldivmod)
|
||||||
|
@@ -23,6 +27,14 @@ DEFINE_COMPILERRT_FUNCTION(__aeabi_uldivmod)
|
||||||
|
sub sp, sp, #16
|
||||||
|
add r12, sp, #8
|
||||||
|
str r12, [sp]
|
||||||
|
+#ifdef __MINGW32__
|
||||||
|
+ mov r12, r0
|
||||||
|
+ mov r0, r2
|
||||||
|
+ mov r2, r12
|
||||||
|
+ mov r12, r1
|
||||||
|
+ mov r1, r3
|
||||||
|
+ mov r3, r12
|
||||||
|
+#endif
|
||||||
|
bl SYMBOL_NAME(__udivmoddi4)
|
||||||
|
ldr r2, [sp, #8]
|
||||||
|
ldr r3, [sp, #12]
|
||||||
|
diff --git a/lib/builtins/fixdfdi.c b/lib/builtins/fixdfdi.c
|
||||||
|
index 14283ef..4bcd432 100644
|
||||||
|
--- a/lib/builtins/fixdfdi.c
|
||||||
|
+++ b/lib/builtins/fixdfdi.c
|
||||||
|
@@ -44,3 +44,11 @@ __fixdfdi(fp_t a) {
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
+
|
||||||
|
+#ifdef __MINGW32__
|
||||||
|
+COMPILER_RT_ABI di_int
|
||||||
|
+__dtoi64(double a)
|
||||||
|
+{
|
||||||
|
+ return __fixdfdi(a);
|
||||||
|
+}
|
||||||
|
+#endif
|
||||||
|
diff --git a/lib/builtins/fixsfdi.c b/lib/builtins/fixsfdi.c
|
||||||
|
index fab47e2..24f6e83 100644
|
||||||
|
--- a/lib/builtins/fixsfdi.c
|
||||||
|
+++ b/lib/builtins/fixsfdi.c
|
||||||
|
@@ -45,3 +45,11 @@ __fixsfdi(fp_t a) {
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
+
|
||||||
|
+#ifdef __MINGW32__
|
||||||
|
+COMPILER_RT_ABI di_int
|
||||||
|
+__stoi64(float a)
|
||||||
|
+{
|
||||||
|
+ return __fixsfdi(a);
|
||||||
|
+}
|
||||||
|
+#endif
|
||||||
|
diff --git a/lib/builtins/fixunsdfdi.c b/lib/builtins/fixunsdfdi.c
|
||||||
|
index 4b0bc9e..5a8bb5c 100644
|
||||||
|
--- a/lib/builtins/fixunsdfdi.c
|
||||||
|
+++ b/lib/builtins/fixunsdfdi.c
|
||||||
|
@@ -42,3 +42,11 @@ __fixunsdfdi(fp_t a) {
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
+
|
||||||
|
+#ifdef __MINGW32__
|
||||||
|
+COMPILER_RT_ABI du_int
|
||||||
|
+__dtou64(double a)
|
||||||
|
+{
|
||||||
|
+ return __fixunsdfdi(a);
|
||||||
|
+}
|
||||||
|
+#endif
|
||||||
|
diff --git a/lib/builtins/fixunssfdi.c b/lib/builtins/fixunssfdi.c
|
||||||
|
index f8ebab8..72fdf4d 100644
|
||||||
|
--- a/lib/builtins/fixunssfdi.c
|
||||||
|
+++ b/lib/builtins/fixunssfdi.c
|
||||||
|
@@ -43,3 +43,11 @@ __fixunssfdi(fp_t a) {
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
+
|
||||||
|
+#ifdef __MINGW32__
|
||||||
|
+COMPILER_RT_ABI du_int
|
||||||
|
+__stou64(float a)
|
||||||
|
+{
|
||||||
|
+ return __fixunssfdi(a);
|
||||||
|
+}
|
||||||
|
+#endif
|
||||||
|
diff --git a/lib/builtins/floatdidf.c b/lib/builtins/floatdidf.c
|
||||||
|
index 2b023ad..d13f832 100644
|
||||||
|
--- a/lib/builtins/floatdidf.c
|
||||||
|
+++ b/lib/builtins/floatdidf.c
|
||||||
|
@@ -105,3 +105,11 @@ __floatdidf(di_int a)
|
||||||
|
return fb.f;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
+
|
||||||
|
+#ifdef __MINGW32__
|
||||||
|
+COMPILER_RT_ABI double
|
||||||
|
+__i64tod(di_int a)
|
||||||
|
+{
|
||||||
|
+ return __floatdidf(a);
|
||||||
|
+}
|
||||||
|
+#endif
|
||||||
|
diff --git a/lib/builtins/floatdisf.c b/lib/builtins/floatdisf.c
|
||||||
|
index 3e47580..8f9bf9d 100644
|
||||||
|
--- a/lib/builtins/floatdisf.c
|
||||||
|
+++ b/lib/builtins/floatdisf.c
|
||||||
|
@@ -78,3 +78,11 @@ __floatdisf(di_int a)
|
||||||
|
((su_int)a & 0x007FFFFF); /* mantissa */
|
||||||
|
return fb.f;
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+#ifdef __MINGW32__
|
||||||
|
+COMPILER_RT_ABI float
|
||||||
|
+__i64tos(di_int a)
|
||||||
|
+{
|
||||||
|
+ return __floatdisf(a);
|
||||||
|
+}
|
||||||
|
+#endif
|
||||||
|
diff --git a/lib/builtins/floatundidf.c b/lib/builtins/floatundidf.c
|
||||||
|
index cfd3a7a..e7f63bf 100644
|
||||||
|
--- a/lib/builtins/floatundidf.c
|
||||||
|
+++ b/lib/builtins/floatundidf.c
|
||||||
|
@@ -104,3 +104,11 @@ __floatundidf(du_int a)
|
||||||
|
return fb.f;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
+
|
||||||
|
+#ifdef __MINGW32__
|
||||||
|
+COMPILER_RT_ABI double
|
||||||
|
+__u64tod(du_int a)
|
||||||
|
+{
|
||||||
|
+ return __floatundidf(a);
|
||||||
|
+}
|
||||||
|
+#endif
|
||||||
|
diff --git a/lib/builtins/floatundisf.c b/lib/builtins/floatundisf.c
|
||||||
|
index 713a44a..3716ec2 100644
|
||||||
|
--- a/lib/builtins/floatundisf.c
|
||||||
|
+++ b/lib/builtins/floatundisf.c
|
||||||
|
@@ -75,3 +75,11 @@ __floatundisf(du_int a)
|
||||||
|
((su_int)a & 0x007FFFFF); /* mantissa */
|
||||||
|
return fb.f;
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+#ifdef __MINGW32__
|
||||||
|
+COMPILER_RT_ABI float
|
||||||
|
+__u64tos(du_int a)
|
||||||
|
+{
|
||||||
|
+ return __floatundisf(a);
|
||||||
|
+}
|
||||||
|
+#endif
|
||||||
--
|
--
|
||||||
2.7.4
|
2.7.4
|
||||||
|
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
From 608efc9306e10f9e9daf0ea981f53deb98851772 Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin@martin.st>
|
||||||
|
Date: Thu, 25 Aug 2016 10:02:16 +0300
|
||||||
|
Subject: [PATCH 2/2] builtins: Allow building the necessary helper functions
|
||||||
|
for msvc mode with cmake
|
||||||
|
|
||||||
|
---
|
||||||
|
lib/builtins/CMakeLists.txt | 13 ++++++++++++-
|
||||||
|
1 file changed, 12 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/lib/builtins/CMakeLists.txt b/lib/builtins/CMakeLists.txt
|
||||||
|
index 18bdee9..003d5b8 100644
|
||||||
|
--- a/lib/builtins/CMakeLists.txt
|
||||||
|
+++ b/lib/builtins/CMakeLists.txt
|
||||||
|
@@ -367,7 +367,7 @@ set(arm_Thumb1_SOURCES
|
||||||
|
${arm_Thumb1_VFPv2_SOURCES}
|
||||||
|
${arm_Thumb1_icache_SOURCES})
|
||||||
|
|
||||||
|
-if(WIN32)
|
||||||
|
+if(WIN32 AND MINGW)
|
||||||
|
set(arm_SOURCES
|
||||||
|
fixdfdi.c
|
||||||
|
fixsfdi.c
|
||||||
|
@@ -390,6 +390,17 @@ if(WIN32)
|
||||||
|
udivmodsi4.c
|
||||||
|
udivsi3.c
|
||||||
|
umoddi3.c)
|
||||||
|
+elseif(WIN32)
|
||||||
|
+ set(arm_SOURCES
|
||||||
|
+ umoddi3.c
|
||||||
|
+ moddi3.c
|
||||||
|
+ udivmoddi4.c
|
||||||
|
+ divsi3.c
|
||||||
|
+ udivsi3.c
|
||||||
|
+ umodsi3.c
|
||||||
|
+ udivdi3.c
|
||||||
|
+ modsi3.c
|
||||||
|
+ divdi3.c)
|
||||||
|
else(WIN32)
|
||||||
|
# TODO the EABI sources should only be added to EABI targets
|
||||||
|
set(arm_SOURCES
|
||||||
|
--
|
||||||
|
2.7.4
|
||||||
|
|
||||||
Reference in new issue
Block a user