Adjust cmake invocations for building compiler-rt
This fixes cross-building for i686.
This commit is contained in:
1 parent
3e1dfb2e79
commit
f672db193b
2 files changed
+10
-63
No files matched your search
+10
-15
@@ -141,11 +141,6 @@ RUN git clone -b master https://github.com/llvm-mirror/compiler-rt.git && \
|
||||
cd compiler-rt && \
|
||||
git checkout 8293838e866814d904640f6359954d00852f2421
|
||||
|
||||
COPY patches/compiler-rt-*.patch /build/patches/
|
||||
|
||||
RUN cd compiler-rt && \
|
||||
git am /build/patches/compiler-rt-*.patch
|
||||
|
||||
# Manually build compiler-rt as a standalone project
|
||||
RUN cd compiler-rt && \
|
||||
mkdir build-armv7 && cd build-armv7 && cmake \
|
||||
@@ -155,12 +150,12 @@ RUN cd compiler-rt && \
|
||||
-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 \
|
||||
-DCMAKE_C_COMPILER_TARGET=armv7-windows-gnu \
|
||||
-DCOMPILER_RT_DEFAULT_TARGET_ONLY=TRUE \
|
||||
../lib/builtins && \
|
||||
make -j4 && \
|
||||
mkdir -p /build/prefix/lib/clang/6.0.0/lib/windows && \
|
||||
cp lib/windows/libclang_rt.builtins-arm.a /build/prefix/lib/clang/6.0.0/lib/windows && \
|
||||
cp lib/windows/libclang_rt.builtins-armv7.a /build/prefix/lib/clang/6.0.0/lib/windows/libclang_rt.builtins-arm.a && \
|
||||
cd .. && \
|
||||
mkdir build-aarch64 && cd build-aarch64 && cmake \
|
||||
-DCMAKE_C_COMPILER=aarch64-w64-mingw32-clang \
|
||||
@@ -169,8 +164,8 @@ RUN cd compiler-rt && \
|
||||
-DCMAKE_RANLIB=$TOOLCHAIN_PREFIX/bin/$RANLIB \
|
||||
-DCMAKE_C_COMPILER_WORKS=1 \
|
||||
-DLLVM_CONFIG_PATH=$TOOLCHAIN_PREFIX/bin/llvm-config \
|
||||
-DCOMPILER_RT_DEFAULT_TARGET_TRIPLE="aarch64--windows-gnu" \
|
||||
-DCMAKE_SIZEOF_VOID_P=8 \
|
||||
-DCMAKE_C_COMPILER_TARGET=aarch64-windows-gnu \
|
||||
-DCOMPILER_RT_DEFAULT_TARGET_ONLY=TRUE \
|
||||
../lib/builtins && \
|
||||
make -j4 && \
|
||||
mkdir -p /build/prefix/lib/clang/6.0.0/lib/windows && \
|
||||
@@ -183,12 +178,12 @@ RUN cd compiler-rt && \
|
||||
-DCMAKE_RANLIB=$TOOLCHAIN_PREFIX/bin/$RANLIB \
|
||||
-DCMAKE_C_COMPILER_WORKS=1 \
|
||||
-DLLVM_CONFIG_PATH=$TOOLCHAIN_PREFIX/bin/llvm-config \
|
||||
-DCOMPILER_RT_DEFAULT_TARGET_TRIPLE="i686--windows-gnu" \
|
||||
-DCMAKE_SIZEOF_VOID_P=4 \
|
||||
-DCMAKE_C_COMPILER_TARGET=i686-windows-gnu \
|
||||
-DCOMPILER_RT_DEFAULT_TARGET_ONLY=TRUE \
|
||||
../lib/builtins && \
|
||||
make -j4 && \
|
||||
mkdir -p /build/prefix/lib/clang/6.0.0/lib/windows && \
|
||||
cp lib/windows/libclang_rt.builtins-i386.a /build/prefix/lib/clang/6.0.0/lib/windows/libclang_rt.builtins-i686.a && \
|
||||
cp lib/windows/libclang_rt.builtins-i686.a /build/prefix/lib/clang/6.0.0/lib/windows && \
|
||||
cd .. && \
|
||||
mkdir build-x86_64 && cd build-x86_64 && cmake \
|
||||
-DCMAKE_C_COMPILER=x86_64-w64-mingw32-clang \
|
||||
@@ -197,8 +192,8 @@ RUN cd compiler-rt && \
|
||||
-DCMAKE_RANLIB=$TOOLCHAIN_PREFIX/bin/$RANLIB \
|
||||
-DCMAKE_C_COMPILER_WORKS=1 \
|
||||
-DLLVM_CONFIG_PATH=$TOOLCHAIN_PREFIX/bin/llvm-config \
|
||||
-DCOMPILER_RT_DEFAULT_TARGET_TRIPLE="x86_64--windows-gnu" \
|
||||
-DCMAKE_SIZEOF_VOID_P=8 \
|
||||
-DCMAKE_C_COMPILER_TARGET=x86_64-windows-gnu \
|
||||
-DCOMPILER_RT_DEFAULT_TARGET_ONLY=TRUE \
|
||||
../lib/builtins && \
|
||||
make -j4 && \
|
||||
mkdir -p /build/prefix/lib/clang/6.0.0/lib/windows && \
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
From 5d4ad66bdde2ff103c848dc2709a5a67f4d2844f Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin@martin.st>
|
||||
Date: Tue, 22 Aug 2017 13:25:25 +0300
|
||||
Subject: [PATCH] Fix cross compilation of compiler-rt for i386 mingw64
|
||||
|
||||
---
|
||||
This patch hasn't been sent for review anywhere yet - the real issue hasn't
|
||||
been analyzed properly yet.
|
||||
---
|
||||
cmake/base-config-ix.cmake | 18 +++++++++---------
|
||||
1 file changed, 9 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/cmake/base-config-ix.cmake b/cmake/base-config-ix.cmake
|
||||
index b38c6ca..103bca0 100644
|
||||
--- a/cmake/base-config-ix.cmake
|
||||
+++ b/cmake/base-config-ix.cmake
|
||||
@@ -134,19 +134,19 @@ macro(test_targets)
|
||||
if(COMPILER_RT_DEFAULT_TARGET_ONLY)
|
||||
add_default_target_arch(${COMPILER_RT_DEFAULT_TARGET_ARCH})
|
||||
elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "i[2-6]86|x86|amd64")
|
||||
- if(NOT MSVC)
|
||||
- test_target_arch(x86_64 "" "-m64")
|
||||
- # FIXME: We build runtimes for both i686 and i386, as "clang -m32" may
|
||||
- # target different variant than "$CMAKE_C_COMPILER -m32". This part should
|
||||
- # be gone after we resolve PR14109.
|
||||
- test_target_arch(i686 __i686__ "-m32")
|
||||
- test_target_arch(i386 __i386__ "-m32")
|
||||
- else()
|
||||
+# if(NOT MSVC)
|
||||
+# test_target_arch(x86_64 "" "-m64")
|
||||
+# # FIXME: We build runtimes for both i686 and i386, as "clang -m32" may
|
||||
+# # target different variant than "$CMAKE_C_COMPILER -m32". This part should
|
||||
+# # be gone after we resolve PR14109.
|
||||
+# test_target_arch(i686 __i686__ "-m32")
|
||||
+# test_target_arch(i386 __i386__ "-m32")
|
||||
+# else()
|
||||
if (CMAKE_SIZEOF_VOID_P EQUAL 4)
|
||||
test_target_arch(i386 "" "")
|
||||
else()
|
||||
test_target_arch(x86_64 "" "")
|
||||
- endif()
|
||||
+# endif()
|
||||
endif()
|
||||
elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "powerpc")
|
||||
TEST_BIG_ENDIAN(HOST_IS_BIG_ENDIAN)
|
||||
--
|
||||
2.7.4
|
||||
|
||||
Reference in new issue
Block a user