@@ -17,7 +17,7 @@ pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}"
17
17
$( [[ ${CARCH} == i686 ]] || echo " ${MINGW_PACKAGE_PREFIX} -rust-wasm" )
18
18
" ${MINGW_PACKAGE_PREFIX} -rust-src" )
19
19
pkgver=1.83.0
20
- pkgrel=3
20
+ pkgrel=4
21
21
pkgdesc=" Systems programming language focused on safety, speed and concurrency (mingw-w64)"
22
22
arch=(' any' )
23
23
mingw_arch=(' mingw32' ' mingw64' ' ucrt64' ' clang64' ' clangarm64' )
@@ -172,12 +172,22 @@ build() {
172
172
cp -r ../${_realname} c-${pkgver} -src/.cargo .
173
173
sed -i " s|directory = \" vendor\" |directory = \" ../${_realname} c-${pkgver} -src/vendor\" |" .cargo/config.toml
174
174
175
- local -a _rust_build=()
176
- _rust_build+=(" --stage" " 2" )
177
- # _rust_build+=("--verbose")
178
-
179
- # create the install at a temporary directory
180
- DESTDIR=" $PWD " /dest-rust python ../${_realname} c-${pkgver} -src/x.py install " ${_rust_build[@]} "
175
+ if [[ ${CARCH} == x86_64 ]]; then
176
+ # build opt-dist tool which manages PGO build
177
+ python ../${_realname} c-${pkgver} -src/x.py build opt-dist
178
+
179
+ # run opt-dist to get rustc optimized with PGO
180
+ ./build/$OSTYPE /stage0-tools-bin/opt-dist local \
181
+ --target-triple=" $OSTYPE " \
182
+ --checkout-dir=" ${srcdir} /${_realname} c-${pkgver} -src" \
183
+ --llvm-dir=" ${MINGW_PREFIX} " \
184
+ --python=" ${MINGW_PREFIX} /bin/python.exe" \
185
+ --llvm-shared=no -- \
186
+ DESTDIR=" $PWD " /dest-rust python ../${_realname} c-${pkgver} -src/x.py install --stage 2
187
+ else
188
+ # create the install at a temporary directory
189
+ DESTDIR=" $PWD " /dest-rust python ../${_realname} c-${pkgver} -src/x.py install --stage 2
190
+ fi
181
191
182
192
if [[ ${CARCH} != i686 ]]; then
183
193
# move wasm32-* targets out of the way for splitting
0 commit comments