• R/O
  • HTTP
  • SSH
  • HTTPS

common_source_project-fm7: Commit

Common Source Code Project for Qt (a.k.a for FM-7).


Commit MetaInfo

Revisión48cacef7cf9d2528bc172eaf3bb222471d6eb9bf (tree)
Tiempo2022-02-23 12:51:35
AutorK.Ohta <whatisthis.sowhat@gmai...>
CommiterK.Ohta

Log Message

[CROSS-BUILD][Win32] Update bootstrap scripts for building cross-toolchains.

Cambiar Resumen

Diferencia incremental

--- a/source/tool/cross-build/llvm-mingw/bootstrap.sh
+++ b/source/tool/cross-build/llvm-mingw/bootstrap.sh
@@ -1,11 +1,19 @@
11 #!/usr/bin/bash
22
3-TOOLCHAIN_PREFIX=/opt/llvm-mingw-11
4-TOOLCHAIN_ARCHS="i686 x86_64 armv7 aarch64"
5-TOOLCHAIN_TARGET_OSES="mingw32 mings32uwp"
6-WORKDIR=$PWD/build
7-LLVM_VERSION=llvmorg-11.0.0
8-FORCE_THREADS=8
3+
4+: ${TOOLCHAIN_PREFIX:="/opt/llvm-mingw-13"}
5+WORKDIR_2=$PWD
6+
7+: ${TOOLCHAIN_ARCHS="i686 x86_64 armv7 aarch64"}
8+: ${TOOLCHAIN_TARGET_OSES="mingw32 mings32uwp"}
9+
10+: ${FORCE_THREADS:=$(nproc 2>/dev/null)}
11+: ${FORCE_THREADS:=$(sysctl -n hw.ncpu 2>/dev/null)}
12+: ${FORCE_THREADS:=4}
13+
14+: ${LLVM_VERSION:=llvmorg-13.0.1}
15+: ${FORCE_WORKLOADS:=15.0}
16+: ${NICE_VALUE:=20}
917
1018 typeset -i CLEANING
1119 CLEANING=0
@@ -17,7 +25,13 @@ fi
1725 export TOOLCHAIN_ARCHS
1826 export TOOLCHAIN_PREFIX
1927 export TOOLCHAIN_TARGET_OSES
20-#export WORKDIR
28+
29+export LLVM_VERSION
30+export FORCE_THREADS
31+export FORCE_WORKLOADS
32+export NICE_VALUE
33+
34+export WORKDIR_2
2135
2236 typeset -i ncount
2337 ncount=1
@@ -26,21 +40,24 @@ THREAD_PARAM=""
2640 if [ -n "${FORCE_THREADS}" ] ; then
2741 THREAD_PARAM="--build-threads ${FORCE_THREADS}"
2842 fi
43+if [ -n "${FORCE_WORKLOADS}" ] ; then
44+ THREAD_PARAM="${THREAD_PARAM} --workload ${FORCE_WORKLOADS}"
45+fi
2946
30-mkdir -p "${WORKDIR}/"
31-mkdir -p "${WORKDIR}/scripts"
32-mkdir -p "${WORKDIR}/scripts/wrappers"
33-mkdir -p "${WORKDIR}/build"
47+mkdir -p "${WORKDIR_2}/"
48+mkdir -p "${WORKDIR_2}/scripts"
49+mkdir -p "${WORKDIR_2}/scripts/wrappers"
50+mkdir -p "${WORKDIR_2}/build"
3451
35-cp -ar scripts/ "${WORKDIR}/"
36-cp -ar ${WORKDIR}/scripts/wrappers/* ${WORKDIR}/build/scripts/wrappers
37-cp -ar ${WORKDIR}/scripts/test/* ${WORKDIR}/build/test/
52+cp -ar scripts/*.sh "${WORKDIR_2}/build/"
53+cp -ar ${WORKDIR_2}/scripts/wrappers ${WORKDIR_2}/build/wrappers
54+cp -ar ${WORKDIR_2}/scripts/test ${WORKDIR_2}/build/test/
3855 pushd .
3956
40-cd "${WORKDIR}/build"
41-echo "BUILD LLVM Toolchain for Win32/64 to ${WORKDIR}/build/"
57+cd "${WORKDIR_2}/build"
58+echo "BUILD LLVM Toolchain for Win32/64 to ${WORKDIR_2}/build/"
4259
43-${WORKDIR}/scripts/build-llvm.sh \
60+nice -n ${NICE_VALUE} ${WORKDIR_2}/scripts/build-llvm.sh \
4461 --llvm-version ${LLVM_VERSION} \
4562 ${THREAD_PARAM} \
4663 ${TOOLCHAIN_PREFIX}
@@ -50,7 +67,7 @@ ${WORKDIR}/scripts/build-llvm.sh \
5067 # exit $?
5168 #fi
5269
53-#${WORKDIR}/scripts/strip-llvm.sh \
70+#${WORKDIR_2}/scripts/strip-llvm.sh \
5471 # ${TOOLCHAIN_PREFIX}
5572
5673 #if [ $? -ne 0 ] ; then
@@ -60,9 +77,8 @@ ${WORKDIR}/scripts/build-llvm.sh \
6077
6178 ncount=$((${ncount}+1))
6279
63-${WORKDIR}/scripts/install-wrappers.sh \
64- ${WORKDIR} \
65- ${TOOLCHAIN_PREFIX} \
80+nice -n ${NICE_VALUE} ${WORKDIR_2}/scripts/install-wrappers.sh \
81+ ${TOOLCHAIN_PREFIX}
6682
6783 if [ $? -ne 0 ] ; then
6884 echo "PHASE ${ncount}: script: ${_sc} failed. Abort building"
@@ -72,31 +88,32 @@ ncount=$((${ncount}+1))
7288
7389 export PATH="${TOOLCHAIN_PREFIX}/bin:${PATH}"
7490
75-mkdir -p "${WORKDIR}/build/build"
76-cd "${WORKDIR}/build/build"
77-${WORKDIR}/scripts/build-mingw-w64.sh \
78- ${THREAD_PARAM} \
91+mkdir -p "${WORKDIR_2}/build/build"
92+cd "${WORKDIR_2}/build/build"
93+nice -n ${NICE_VALUE} ${WORKDIR_2}/scripts/build-mingw-w64.sh \
94+ ${THREAD_PARAM} \
7995 ${TOOLCHAIN_PREFIX}
8096
81-cd "${WORKDIR}/build"
82-${WORKDIR}/scripts/build-compiler-rt.sh \
83- ${TOOLCHAIN_PREFIX}
97+cd "${WORKDIR_2}/build"
98+nice -n ${NICE_VALUE} ${WORKDIR_2}/scripts/build-compiler-rt.sh \
99+ ${THREAD_PARAM} \
100+ ${TOOLCHAIN_PREFIX}
84101
85102
86-cd "${WORKDIR}/build/build"
87-${WORKDIR}/scripts/build-mingw-w64-libraries.sh \
88- ${THREAD_PARAM} \
89- ${TOOLCHAIN_PREFIX}
103+cd "${WORKDIR_2}/build/build"
104+nice -n ${NICE_VALUE} ${WORKDIR_2}/scripts/build-mingw-w64-libraries.sh \
105+ ${THREAD_PARAM} \
106+ ${TOOLCHAIN_PREFIX}
90107
91108
92109
93-cd "${WORKDIR}/build"
94-${WORKDIR}/scripts/build-libcxx.sh \
110+cd "${WORKDIR_2}/build"
111+nice -n ${NICE_VALUE} ${WORKDIR_2}/scripts/build-libcxx.sh \
95112 ${THREAD_PARAM} \
96113 ${TOOLCHAIN_PREFIX}
97114
98115
99-#cd "${WORKDIR}/build/test"
116+#cd "${WORKDIR_2}/build/test"
100117 #for arch in $TOOLCHAIN_ARCHS; do
101118 # mkdir -p $arch
102119 # for test in hello hello-tls crt-test setjmp; do
@@ -113,13 +130,15 @@ ${WORKDIR}/scripts/build-libcxx.sh \
113130 # Build sanitizers. Ubsan includes <typeinfo> from the C++ headers, so
114131 # we need to build this after libcxx.
115132 # Sanitizers on windows only support x86.
116-cd "${WORKDIR}/build"
117-${WORKDIR}/scripts/build-compiler-rt.sh \
118- ${TOOLCHAIN_PREFIX} \
119- --build-sanitizers
133+cd "${WORKDIR_2}/build"
134+nice -n ${NICE_VALUE} ${WORKDIR_2}/scripts/build-compiler-rt.sh \
135+ ${THREAD_PARAM} \
136+ ${TOOLCHAIN_PREFIX}
137+
138+# --build-sanitizers \
120139
121140
122-#cd "${WORKDIR}/build/test"
141+#cd "${WORKDIR_2}/build/test"
123142 #for arch in $TOOLCHAIN_ARCHS; do
124143 # case $arch in
125144 # i686|x86_64)
@@ -138,23 +157,23 @@ ${WORKDIR}/scripts/build-compiler-rt.sh \
138157
139158 # Build libssp
140159
141-cd "${WORKDIR}/build"
142-cp "${WORKDIR}/scripts/libssp-Makefile" "${WORKDIR}/build"
160+cd "${WORKDIR_2}/build"
161+cp "${WORKDIR_2}/scripts/libssp-Makefile" "${WORKDIR_2}/build"
143162 _sc=""
144-${WORKDIR}/scripts/build-libssp.sh \
163+nice -n ${NICE_VALUE} ${WORKDIR_2}/scripts/build-libssp.sh \
145164 ${THREAD_PARAM} \
146165 ${TOOLCHAIN_PREFIX} \
147166 #--build-sanitizers
148167
149168
150-#cd "${WORKDIR}/build/test"
169+#cd "${WORKDIR_2}/build/test"
151170 #for arch in $TOOLCHAIN_ARCHS; do
152171 # mkdir -p $arch
153172 # for test in stacksmash; do
154173 # $arch-w64-mingw32-clang $test.c -o $arch/$test.exe -fstack-protector-strong || exit 1
155174 # done
156175 #done
157-#cd "${WORKDIR}/build/test"
176+#cd "${WORKDIR_2}/build/test"
158177 #for arch in $TOOLCHAIN_ARCHS; do
159178 # cp $TOOLCHAIN_PREFIX/$arch-w64-mingw32/bin/*.dll $arch || exit 1
160179 #done
--- a/source/tool/cross-build/llvm-mingw/scripts/build-all.sh
+++ b/source/tool/cross-build/llvm-mingw/scripts/build-all.sh
@@ -11,8 +11,12 @@ FORCE_THREADS=OFF
1111 __NARG=""
1212 while [ $# -gt 0 ]; do
1313 if [ "$1" = "--build-threads" ]; then
14- ${CORES:="$2"}
15- __NARG="--build-threads $2"
14+ ${CORES="$2"}
15+ __NARG="${__NARG} --build-threads $2"
16+ shift
17+ elif [ "$1" = "--workload" ]; then
18+ ${WORKLOADS="$2"}
19+ __NARG="${__NARG} --workload $2"
1620 shift
1721 else
1822 PREFIX="$1"
@@ -21,6 +25,7 @@ while [ $# -gt 0 ]; do
2125 shift
2226 done
2327
28+
2429 ./build-llvm.sh ${__NARG} $PREFIX
2530 ./install-wrappers.sh $PREFIX
2631 ./build-mingw-w64.sh ${__NARG} $PREFIX
--- a/source/tool/cross-build/llvm-mingw/scripts/build-compiler-rt.sh
+++ b/source/tool/cross-build/llvm-mingw/scripts/build-compiler-rt.sh
@@ -11,7 +11,10 @@ while [ $# -gt 0 ]; do
1111 BUILD_SUFFIX=-sanitizers
1212 SANITIZERS=1
1313 elif [ "$1" = "--build-threads" ]; then
14- : ${CORES:=$2}
14+ : ${CORES=$2}
15+ shift
16+ elif [ "$1" = "--workload" ]; then
17+ : ${WORKLOADS=$2}
1518 shift
1619 else
1720 PREFIX="$1"
@@ -23,13 +26,14 @@ if [ -z "$PREFIX" ]; then
2326 exit 1
2427 fi
2528
26- mkdir -p "$PREFIX"
27-PREFIX="$(cd $PREFIX && pwd)"
29+mkdir -p "$PREFIX"
30+PREFIX="$(cd "$PREFIX" && pwd)"
2831 export PATH=$PREFIX/bin:$PATH
2932
3033 : ${CORES:=$(nproc 2>/dev/null)}
3134 : ${CORES:=$(sysctl -n hw.ncpu 2>/dev/null)}
3235 : ${CORES:=4}
36+: ${WORKLOADS:=99.9}
3337 : ${ARCHS:=${TOOLCHAIN_ARCHS-i686 x86_64 armv7 aarch64}}
3438
3539 CLANG_VERSION=$(basename $(dirname $(dirname $(dirname $($PREFIX/bin/clang --print-libgcc-file-name -rtlib=compiler-rt)))))
@@ -42,7 +46,7 @@ fi
4246 # i686-w64-mingw32, but due to the compiler-rt cmake peculiarities, we
4347 # need to refer to it as i386 at this stage.
4448 if [ ! -e $PREFIX/i386-w64-mingw32 ]; then
45- ln -sfn i686-w64-mingw32 $PREFIX/i386-w64-mingw32 || true
49+ ln -sfn i686-w64-mingw32 $PREFIX/i386-w64-mingw32 || true
4650 fi
4751
4852 cd llvm-project/compiler-rt
@@ -78,7 +82,7 @@ for arch in $ARCHS; do
7882 ;;
7983 esac
8084
81- mkdir -p build-$arch$BUILD_SUFFIX
85+ mkdir -p build-$arch$BUILD_SUFFIX
8286 cd build-$arch$BUILD_SUFFIX
8387 cmake \
8488 ${CMAKE_GENERATOR+-G} "$CMAKE_GENERATOR" \
@@ -95,19 +99,19 @@ for arch in $ARCHS; do
9599 -DCOMPILER_RT_DEFAULT_TARGET_ONLY=TRUE \
96100 -DCOMPILER_RT_USE_BUILTINS_LIBRARY=TRUE \
97101 $SRC_DIR
98- make -j$CORES
99- mkdir -p $PREFIX/lib/clang/$CLANG_VERSION/lib/windows
100- mkdir -p $PREFIX/$arch-w64-mingw32/bin
102+ make -j$CORES -l ${WORKLOADS}
103+ mkdir -p $PREFIX/lib/clang/$CLANG_VERSION/lib/windows
104+ mkdir -p $PREFIX/$arch-w64-mingw32/bin
101105 for i in lib/windows/libclang_rt.*-$buildarchname*.a; do
102- cp $i $PREFIX/lib/clang/$CLANG_VERSION/lib/windows/$(basename $i | sed s/$buildarchname/$libarchname/)
106+ cp $i $PREFIX/lib/clang/$CLANG_VERSION/lib/windows/$(basename $i | sed s/$buildarchname/$libarchname/)
103107 done
104108 for i in lib/windows/libclang_rt.*-$buildarchname*.dll; do
105109 if [ -f $i ]; then
106- cp $i $PREFIX/$arch-w64-mingw32/bin
110+ cp $i $PREFIX/$arch-w64-mingw32/bin
107111 fi
108112 done
109113 if [ -n "$SANITIZERS" ]; then
110- make install-compiler-rt-headers
114+ make install-compiler-rt-headers
111115 fi
112116 cd ..
113117 done
--- a/source/tool/cross-build/llvm-mingw/scripts/build-cross-tools.sh
+++ b/source/tool/cross-build/llvm-mingw/scripts/build-cross-tools.sh
@@ -13,7 +13,11 @@ __NARG=""
1313
1414 if [ "$4" = "--build-threads" ]; then
1515 : ${CORES:="$5"}
16- __NARG="--build-threads $5"
16+ __NARG="${__NARG} --build-threads $5"
17+fi
18+if [ "$6" = "--workload" ]; then
19+ : ${WORKLOADS:="$7"}
20+ __NARG="${__NARG} --workload $7"
1721 fi
1822
1923 export PATH=$NATIVE/bin:$PATH
--- a/source/tool/cross-build/llvm-mingw/scripts/build-libcxx.sh
+++ b/source/tool/cross-build/llvm-mingw/scripts/build-libcxx.sh
@@ -15,7 +15,10 @@ while [ $# -gt 0 ]; do
1515 elif [ "$1" = "--enable-static" ]; then
1616 BUILD_STATIC=1
1717 elif [ "$1" = "--build-threads" ]; then
18- : ${CORES:=$2}
18+ : ${CORES=$2}
19+ shift
20+ elif [ "$1" = "--workload" ]; then
21+ : ${WORKLOADS=$2}
1922 shift
2023 else
2124 PREFIX="$1"
@@ -28,7 +31,7 @@ if [ -z "$PREFIX" ]; then
2831 exit 1
2932 fi
3033
31- mkdir -p "$PREFIX"
34+mkdir -p "$PREFIX"
3235 PREFIX="$(cd "$PREFIX" && pwd)"
3336
3437 export PATH=$PREFIX/bin:$PATH
@@ -36,6 +39,8 @@ export PATH=$PREFIX/bin:$PATH
3639 : ${CORES:=$(nproc 2>/dev/null)}
3740 : ${CORES:=$(sysctl -n hw.ncpu 2>/dev/null)}
3841 : ${CORES:=4}
42+: ${WORKLOADS:=99.9}
43+
3944 : ${ARCHS:=${TOOLCHAIN_ARCHS-i686 x86_64 armv7 aarch64}}
4045
4146 if [ ! -d llvm-project/libunwind ] || [ -n "$SYNC" ]; then
@@ -66,7 +71,7 @@ build_all() {
6671
6772 cd libunwind
6873 for arch in $ARCHS; do
69- mkdir -p build-$arch-$type
74+ mkdir -p build-$arch-$type
7075 cd build-$arch-$type
7176 # CXX_SUPPORTS_CXX11 is not strictly necessary here. But if building
7277 # with a stripped llvm install, and the system happens to have an older
@@ -75,7 +80,6 @@ build_all() {
7580 cmake \
7681 ${CMAKE_GENERATOR+-G} "$CMAKE_GENERATOR" \
7782 -DCMAKE_BUILD_TYPE=Release \
78- -DCMAKE_INSTALL_PREFIX=$PREFIX/$arch-w64-mingw32 \
7983 -DCMAKE_C_COMPILER=$arch-w64-mingw32-clang \
8084 -DCMAKE_CXX_COMPILER=$arch-w64-mingw32-clang++ \
8185 -DCMAKE_CROSSCOMPILING=TRUE \
@@ -87,6 +91,8 @@ build_all() {
8791 -DCMAKE_RANLIB=$PREFIX/bin/llvm-ranlib \
8892 -DCXX_SUPPORTS_CXX11=TRUE \
8993 -DCXX_SUPPORTS_CXX_STD=TRUE \
94+ -DCMAKE_INSTALL_PREFIX=$PREFIX/$arch-w64-mingw32/ \
95+ -DLIBUNWIND_INSTALL_PREFIX=$PREFIX/$arch-w64-mingw32/ \
9096 -DLIBUNWIND_USE_COMPILER_RT=TRUE \
9197 -DLIBUNWIND_ENABLE_THREADS=TRUE \
9298 -DLIBUNWIND_ENABLE_SHARED=$SHARED \
@@ -96,11 +102,11 @@ build_all() {
96102 -DCMAKE_C_FLAGS="-Wno-dll-attribute-on-redeclaration" \
97103 -DCMAKE_SHARED_LINKER_FLAGS="-lpsapi" \
98104 ..
99- make -j$CORES
100- make install
105+ make -j$CORES -l ${WORKLOADS}
106+ make install
101107 if [ "$type" = "shared" ]; then
102- mkdir -p $PREFIX/$arch-w64-mingw32/bin
103- cp lib/libunwind.dll $PREFIX/$arch-w64-mingw32/bin
108+ mkdir -p $PREFIX/$arch-w64-mingw32/bin
109+ cp lib/libunwind.dll $PREFIX/$arch-w64-mingw32/bin
104110 else
105111 # Merge libpsapi.a into the static library libunwind.a, to
106112 # avoid having to specify -lpsapi when linking to it.
@@ -114,7 +120,7 @@ build_all() {
114120
115121 cd libcxxabi
116122 for arch in $ARCHS; do
117- mkdir -p build-$arch-$type
123+ mkdir -p build-$arch-$type
118124 cd build-$arch-$type
119125 if [ "$type" = "shared" ]; then
120126 LIBCXXABI_VISIBILITY_FLAGS="-D_LIBCPP_BUILDING_LIBRARY= -U_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS"
@@ -124,7 +130,6 @@ build_all() {
124130 cmake \
125131 ${CMAKE_GENERATOR+-G} "$CMAKE_GENERATOR" \
126132 -DCMAKE_BUILD_TYPE=Release \
127- -DCMAKE_INSTALL_PREFIX=$PREFIX/$arch-w64-mingw32 \
128133 -DCMAKE_C_COMPILER=$arch-w64-mingw32-clang \
129134 -DCMAKE_CXX_COMPILER=$arch-w64-mingw32-clang++ \
130135 -DCMAKE_CROSSCOMPILING=TRUE \
@@ -134,25 +139,32 @@ build_all() {
134139 -DLLVM_COMPILER_CHECKED=TRUE \
135140 -DCMAKE_AR=$PREFIX/bin/llvm-ar \
136141 -DCMAKE_RANLIB=$PREFIX/bin/llvm-ranlib \
142+ -DCMAKE_INSTALL_PREFIX=$PREFIX/$arch-w64-mingw32/ \
143+ -DLIBCXXABI_INSTALL_PREFIX=$PREFIX/$arch-w64-mingw32/ \
137144 -DLIBCXXABI_USE_COMPILER_RT=ON \
138145 -DLIBCXXABI_ENABLE_EXCEPTIONS=ON \
139146 -DLIBCXXABI_ENABLE_THREADS=ON \
140147 -DLIBCXXABI_TARGET_TRIPLE=$arch-w64-mingw32 \
141- -DLIBCXXABI_ENABLE_SHARED=OFF \
148+ -DLIBCXXABI_ENABLE_SHARED=$SHARED \
149+ -DLIBCXXABI_ENABLE_STATIC=$STATIC \
150+ -DLIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS=ON \
151+ -DLIBCXXABI_USE_LLVM_UNWINDER=ON \
142152 -DLIBCXXABI_LIBCXX_INCLUDES=../../libcxx/include \
143153 -DLIBCXXABI_LIBDIR_SUFFIX="" \
144- -DLIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS=OFF \
145- -DCXX_SUPPORTS_CXX_STD=TRUE \
146- -DCMAKE_CXX_FLAGS="$LIBCXXABI_VISIBILITY_FLAGS -D_LIBCPP_HAS_THREAD_API_WIN32" \
147154 ..
148- make -j$CORES
155+ make -j$CORES -l ${WORKLOADS}
156+ make install
157+ if [ "$type" = "shared" ]; then
158+ mkdir -p $PREFIX/$arch-w64-mingw32/bin
159+ cp lib/libc++abi.dll $PREFIX/$arch-w64-mingw32/bin
160+ fi
149161 cd ..
150162 done
151163 cd ..
152-
164+
153165 cd libcxx
154166 for arch in $ARCHS; do
155- mkdir -p build-$arch-$type
167+ mkdir -p build-$arch-$type
156168 cd build-$arch-$type
157169 if [ "$type" = "shared" ]; then
158170 LIBCXX_VISIBILITY_FLAGS="-D_LIBCXXABI_BUILDING_LIBRARY"
@@ -162,7 +174,6 @@ build_all() {
162174 cmake \
163175 ${CMAKE_GENERATOR+-G} "$CMAKE_GENERATOR" \
164176 -DCMAKE_BUILD_TYPE=Release \
165- -DCMAKE_INSTALL_PREFIX=$PREFIX/$arch-w64-mingw32 \
166177 -DCMAKE_C_COMPILER=$arch-w64-mingw32-clang \
167178 -DCMAKE_CXX_COMPILER=$arch-w64-mingw32-clang++ \
168179 -DCMAKE_CROSSCOMPILING=TRUE \
@@ -180,35 +191,33 @@ build_all() {
180191 -DLIBCXX_ENABLE_MONOTONIC_CLOCK=ON \
181192 -DLIBCXX_ENABLE_SHARED=$SHARED \
182193 -DLIBCXX_ENABLE_STATIC=$STATIC \
194+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=$STATIC \
183195 -DLIBCXX_SUPPORTS_STD_EQ_CXX11_FLAG=TRUE \
184196 -DLIBCXX_HAVE_CXX_ATOMICS_WITHOUT_LIB=TRUE \
185197 -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF \
186198 -DLIBCXX_ENABLE_FILESYSTEM=OFF \
187- -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=TRUE \
199+ -DCMAKE_INSTALL_PREFIX=$PREFIX/$arch-w64-mingw32/ \
200+ -DLIBCXX_INSTALL_PREFIX=$PREFIX/$arch-w64-mingw32/ \
188201 -DLIBCXX_CXX_ABI=libcxxabi \
189202 -DLIBCXX_CXX_ABI_INCLUDE_PATHS=../../libcxxabi/include \
190203 -DLIBCXX_CXX_ABI_LIBRARY_PATH=../../libcxxabi/build-$arch-$type/lib \
191204 -DLIBCXX_LIBDIR_SUFFIX="" \
205+ -DLIBCXX_ENABLE_NEW_DELETE_DEFINITIONS=OFF \
192206 -DLIBCXX_INCLUDE_TESTS=FALSE \
193207 -DCMAKE_CXX_FLAGS="$LIBCXX_VISIBILITY_FLAGS" \
194208 -DCMAKE_SHARED_LINKER_FLAGS="-lunwind" \
195209 -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=FALSE \
196210 ..
197- make -j$CORES
198- make install
199- if [ "$type" = "shared" ]; then
200- llvm-ar qcsL \
201- $PREFIX/$arch-w64-mingw32/lib/libc++.dll.a \
202- $PREFIX/$arch-w64-mingw32/lib/libunwind.dll.a
203- cp lib/libc++.dll $PREFIX/$arch-w64-mingw32/bin
204- else
205- llvm-ar qcsL \
206- $PREFIX/$arch-w64-mingw32/lib/libc++.a \
207- $PREFIX/$arch-w64-mingw32/lib/libunwind.a
208- fi
211+ make -j$CORES -l ${WORKLOADS}
212+ make install
213+# if [ "$type" = "shared" ]; then
214+# mkdir -p $PREFIX/$arch-w64-mingw32/bin
215+# cp lib/libc++.dll $PREFIX/$arch-w64-mingw32/bin
216+# fi
209217 cd ..
210218 done
211219 cd ..
220+
212221 }
213222
214223 # Build shared first and static afterwards; the headers for static linking also
--- a/source/tool/cross-build/llvm-mingw/scripts/build-libssp.sh
+++ b/source/tool/cross-build/llvm-mingw/scripts/build-libssp.sh
@@ -8,7 +8,10 @@ if [ $# -lt 1 ]; then
88 fi
99 while [ $# -gt 0 ]; do
1010 if [ "$1" = "--build-threads" ]; then
11- : ${CORES:=$2}
11+ : ${CORES=$2}
12+ shift
13+ elif [ "$1" = "--workload" ]; then
14+ : ${WORKLOADS=$2}
1215 shift
1316 else
1417 PREFIX="$1"
@@ -16,22 +19,23 @@ while [ $# -gt 0 ]; do
1619 fi
1720 shift
1821 done
19- mkdir -p "$PREFIX"
22+mkdir -p "$PREFIX"
2023 PREFIX="$(cd "$PREFIX" && pwd)"
2124 export PATH=$PREFIX/bin:$PATH
2225
2326 : ${CORES:=$(nproc 2>/dev/null)}
2427 : ${CORES:=$(sysctl -n hw.ncpu 2>/dev/null)}
2528 : ${CORES:=4}
29+: ${WORKLOADS:=99.9}
2630 : ${ARCHS:=${TOOLCHAIN_ARCHS-i686 x86_64 armv7 aarch64}}
2731
28-if [ ! -d libssp ]; then
29- svn checkout -q svn://gcc.gnu.org/svn/gcc/tags/gcc_7_3_0_release/libssp
32+if [ ! -d gcc-libssp/libssp ]; then
33+ git clone https://gcc.gnu.org/git/gcc.git gcc-libssp
34+# svn checkout -q svn://gcc.gnu.org/svn/gcc/tags/gcc_7_3_0_release/libssp
3035 fi
31-
32-cp libssp-Makefile libssp/Makefile
33-
34-cd libssp
36+cd gcc-libssp/libssp
37+git checkout releases/gcc-10.3.0
38+cp ../../libssp-Makefile ./Makefile
3539
3640 # gcc/libssp's configure script runs checks for flags that clang doesn't
3741 # implement. We actually just need to set a few HAVE defines and compile
@@ -48,13 +52,13 @@ done
4852 cat ssp/ssp.h.in | sed 's/@ssp_have_usable_vsnprintf@/define/' > ssp/ssp.h
4953
5054 for arch in $ARCHS; do
51- mkdir -p build-$arch
55+ mkdir -p build-$arch
5256 cd build-$arch
53- make -f ../Makefile -j$CORES CROSS=$arch-w64-mingw32-
57+ make -f ../Makefile -j$CORES -l $WORKLOADS CROSS=$arch-w64-mingw32-
5458 mkdir -p $PREFIX/$arch-w64-mingw32/bin
55- cp libssp.a $PREFIX/$arch-w64-mingw32/lib
56- cp libssp_nonshared.a $PREFIX/$arch-w64-mingw32/lib
57- cp libssp.dll.a $PREFIX/$arch-w64-mingw32/lib
58- cp libssp-0.dll $PREFIX/$arch-w64-mingw32/bin
59+ cp libssp.a $PREFIX/$arch-w64-mingw32/lib
60+ cp libssp_nonshared.a $PREFIX/$arch-w64-mingw32/lib
61+ cp libssp.dll.a $PREFIX/$arch-w64-mingw32/lib
62+ cp libssp-0.dll $PREFIX/$arch-w64-mingw32/bin
5963 cd ..
6064 done
--- a/source/tool/cross-build/llvm-mingw/scripts/build-llvm.sh
+++ b/source/tool/cross-build/llvm-mingw/scripts/build-llvm.sh
@@ -6,7 +6,8 @@ ASSERTS=OFF
66 BUILDDIR=build
77 FORCE_THREADS=OFF
88 OVERRIDE_THREADS=0
9-LLVM_VERSION=llvmorg-11.0.0
9+FORCE_WORKLOADS=OFF
10+OVERRIDE_WORKLOADS=0
1011
1112 while [ $# -gt 0 ]; do
1213 if [ "$1" = "--disable-asserts" ]; then
@@ -20,7 +21,12 @@ while [ $# -gt 0 ]; do
2021 elif [ "$1" = "--build-threads" ]; then
2122 FORCE_THREADS=ON
2223 OVERRIDE_THREADS="$2"
23- : ${CORES:="$2"}
24+ : ${CORES="$2"}
25+ shift
26+ elif [ "$1" = "--workload" ]; then
27+ FORCE_WORKLOADS=ON
28+ OVERRIDE_WORKLOADS="$2"
29+ : ${WORKLOADS="$2"}
2430 shift
2531 elif [ "$1" = "--llvm-version" ]; then
2632 LLVM_VERSION="$2"
@@ -43,6 +49,8 @@ fi
4349 : ${CORES:=$(sysctl -n hw.ncpu 2>/dev/null)}
4450 : ${CORES:=4}
4551
52+: ${WORKLOADS:=99.9}
53+
4654 if [ ! -d llvm-project ]; then
4755 # When cloning master and checking out a pinned old hash, we can't use --depth=1.
4856 git clone https://github.com/llvm/llvm-project.git
@@ -162,5 +170,5 @@ cmake \
162170 # ninja -j$CORES install/strip
163171 #else
164172 # make -j$CORES
165- make -j$CORES install/strip
173+ make -j$CORES -l ${WORKLOADS} install/strip
166174 #fi
--- a/source/tool/cross-build/llvm-mingw/scripts/build-mingw-w64-libraries.sh
+++ b/source/tool/cross-build/llvm-mingw/scripts/build-mingw-w64-libraries.sh
@@ -8,10 +8,14 @@ if [ $# -lt 1 ]; then
88 fi
99 while [ $# -gt 0 ]; do
1010 if [ "$1" = "--build-threads" ]; then
11- : ${CORES:=$2}
11+ : ${CORES=$2}
12+ shift
13+ elif [ "$1" = "--workload" ]; then
14+ : ${WORKLOADS=$2}
1215 shift
1316 else
1417 PREFIX="$1"
18+ break
1519 fi
1620 shift
1721 done
@@ -22,6 +26,7 @@ export PATH=$PREFIX/bin:$PATH
2226 : ${CORES:=$(nproc 2>/dev/null)}
2327 : ${CORES:=$(sysctl -n hw.ncpu 2>/dev/null)}
2428 : ${CORES:=4}
29+: ${WORKLOADS:=99.9}
2530 : ${ARCHS:=${TOOLCHAIN_ARCHS-i686 x86_64 armv7 aarch64}}
2631
2732 cd mingw-w64/mingw-w64-libraries
@@ -31,7 +36,7 @@ for lib in winpthreads winstorecompat; do
3136 mkdir -p build-$arch
3237 cd build-$arch
3338 ../configure --host=$arch-w64-mingw32 --prefix=$PREFIX/$arch-w64-mingw32
34- make -j$CORES
39+ make -j$CORES -l ${WORKLOADS}
3540 make install
3641 cd ..
3742 done
--- a/source/tool/cross-build/llvm-mingw/scripts/build-mingw-w64.sh
+++ b/source/tool/cross-build/llvm-mingw/scripts/build-mingw-w64.sh
@@ -8,8 +8,13 @@ DEFAULT_MSVCRT=ucrt
88 while [ $# -gt 0 ]; do
99 case "$1" in
1010 --build-threads)
11- : ${CORES:="$2"}
12- __NARG="--build-threads $2"
11+ : ${CORES="$2"}
12+ __NARG="${__NARG} --build-threads $2"
13+ shift
14+ ;;
15+ --workload)
16+ : ${WORKLOADS="$2"}
17+ __NARG="${__NARG} --workload $2"
1318 shift
1419 ;;
1520 --skip-include-triplet-prefix)
@@ -48,6 +53,7 @@ fi
4853 : ${CORES:=$(nproc 2>/dev/null)}
4954 : ${CORES:=$(sysctl -n hw.ncpu 2>/dev/null)}
5055 : ${CORES:=4}
56+: ${WORKLOADS:=99.9}
5157 : ${ARCHS:=${TOOLCHAIN_ARCHS-i686 x86_64 armv7 aarch64}}
5258
5359 if [ ! -d mingw-w64 ]; then
@@ -59,7 +65,8 @@ cd mingw-w64
5965
6066 if [ -n "$SYNC" ] || [ -n "$CHECKOUT" ]; then
6167 [ -z "$SYNC" ] || git fetch
62- git checkout 0a1d495478d8ed1a94fc77b9dbb428b7e0372588
68+ git checkout v8.x
69+# git checkout 0a1d495478d8ed1a94fc77b9dbb428b7e0372588
6370 fi
6471
6572 # If crosscompiling the toolchain itself, we already have a mingw-w64
@@ -107,7 +114,7 @@ if [ -z "$HOST" ]; then
107114 esac
108115 FLAGS="$FLAGS --with-default-msvcrt=$DEFAULT_MSVCRT"
109116 ../configure --host=$arch-w64-mingw32 --prefix=$PREFIX/$arch-w64-mingw32 $FLAGS
110- make -j$CORES
117+ make -j$CORES -l $WORKLOADS
111118 make install
112119 cd ..
113120 done
@@ -144,7 +151,7 @@ for arch in $ARCHS; do
144151 mkdir -p build-$CROSS_NAME$arch
145152 cd build-$CROSS_NAME$arch
146153 ../configure --prefix=$PREFIX --target=$arch-w64-mingw32 $CONFIGFLAGS LDFLAGS="-Wl,-s"
147- make -j$CORES
154+ make -j$CORES -l $WORKLOADS
148155 make install
149156 cd ..
150157 done
--- a/source/tool/cross-build/llvm-mingw/scripts/install-wrappers.sh
+++ b/source/tool/cross-build/llvm-mingw/scripts/install-wrappers.sh
@@ -7,10 +7,9 @@ if [ $# -lt 1 ]; then
77 exit 1
88 fi
99
10-WORKDIR="$1"
11-PREFIX="$2"
10+PREFIX="$1"
1211
13- mkdir -p "$PREFIX"
12+mkdir -p "$PREFIX"
1413 PREFIX="$(cd "$PREFIX" && pwd)"
1514
1615 : ${ARCHS:=${TOOLCHAIN_ARCHS-i686 x86_64 armv7 aarch64}}
@@ -32,19 +31,18 @@ if [ -n "$EXEEXT" ]; then
3231 WRAPPER_FLAGS="$WRAPPER_FLAGS -municode -DCLANG=\"clang-$CLANG_MAJOR\""
3332 fi
3433
35- mkdir -p $PREFIX/bin
36- install ${WORKDIR}/scripts/wrappers/*-wrapper.sh $PREFIX/bin
34+mkdir -p $PREFIX/bin
35+cp wrappers/*-wrapper.sh $PREFIX/bin
3736 if [ -n "$HOST" ]; then
3837 # TODO: If building natively on msys, pick up the default HOST value from there.
3938 WRAPPER_FLAGS="$WRAPPER_FLAGS -DDEFAULT_TARGET=\"$HOST\""
40- for i in ${WORKDIR}/scripts/wrappers/*-wrapper.sh ; do
39+ for i in wrappers/*-wrapper.sh; do
4140 cat $i | sed 's/^DEFAULT_TARGET=.*/DEFAULT_TARGET='$HOST/ > $PREFIX/bin/$(basename $i)
42- chmod ugo+rx $PREFIX/bin/$(basename $i)
4341 done
4442 fi
45-$CC ${WORKDIR}/scripts/wrappers/clang-target-wrapper.c -o $PREFIX/bin/clang-target-wrapper$EXEEXT -O2 -Wl,-s $WRAPPER_FLAGS
46-$CC ${WORKDIR}/scripts/wrappers/windres-wrapper.c -o $PREFIX/bin/windres-wrapper$EXEEXT -O2 -Wl,-s $WRAPPER_FLAGS
47-$CC ${WORKDIR}/scripts/wrappers/llvm-wrapper.c -o $PREFIX/bin/llvm-wrapper$EXEEXT -O2 -Wl,-s $WRAPPER_FLAGS
43+$CC wrappers/clang-target-wrapper.c -o $PREFIX/bin/clang-target-wrapper$EXEEXT -O2 -Wl,-s $WRAPPER_FLAGS
44+$CC wrappers/windres-wrapper.c -o $PREFIX/bin/windres-wrapper$EXEEXT -O2 -Wl,-s $WRAPPER_FLAGS
45+$CC wrappers/llvm-wrapper.c -o $PREFIX/bin/llvm-wrapper$EXEEXT -O2 -Wl,-s $WRAPPER_FLAGS
4846 if [ -n "$EXEEXT" ]; then
4947 # For Windows, we should prefer the executable wrapper, which also works
5048 # when invoked from outside of MSYS.
@@ -65,27 +63,27 @@ for arch in $ARCHS; do
6563 else
6664 link_target=llvm-$exec
6765 fi
68- ln -sf $link_target$EXEEXT $arch-w64-$target_os-$exec$EXEEXT || true
66+ ln -sf $link_target$EXEEXT $arch-w64-$target_os-$exec$EXEEXT || true
6967 done
7068 for exec in windres; do
71- ln -sf $exec-wrapper$EXEEXT $arch-w64-$target_os-$exec$EXEEXT
69+ ln -sf $exec-wrapper$EXEEXT $arch-w64-$target_os-$exec$EXEEXT
7270 done
7371 for exec in ld objdump dlltool; do
74- ln -sf $exec-wrapper.sh $arch-w64-$target_os-$exec
72+ ln -sf $exec-wrapper.sh $arch-w64-$target_os-$exec
7573 done
7674 done
7775 done
7876 if [ -n "$EXEEXT" ]; then
7977 if [ ! -L clang$EXEEXT ] && [ -f clang$EXEEXT ] && [ ! -f clang-$CLANG_MAJOR$EXEEXT ]; then
80- mv clang$EXEEXT clang-$CLANG_MAJOR$EXEEXT
78+ mv clang$EXEEXT clang-$CLANG_MAJOR$EXEEXT
8179 fi
8280 if [ -z "$HOST" ]; then
8381 HOST=$(./clang-$CLANG_MAJOR -dumpmachine | sed 's/-.*//')-w64-mingw32
8482 fi
8583 for exec in clang clang++ gcc g++ cc c99 c11 c++ addr2line ar ranlib nm objcopy strings strip windres; do
86- ln -sf $HOST-$exec$EXEEXT $exec$EXEEXT
84+ ln -sf $HOST-$exec$EXEEXT $exec$EXEEXT
8785 done
8886 for exec in ld objdump dlltool; do
89- ln -sf $HOST-$exec $exec
87+ ln -sf $HOST-$exec $exec
9088 done
9189 fi
Show on old repository browser