Skip to content

Commit 9789c6d

Browse files
bors[bot]malbarbo
andauthored
Merge #471
471: Fix i686-pc-windows-gnu r=reitermarkus a=malbarbo The build command in mingw.sh script was failing but the script continued to run and returned 0. The result was that the mingw toolchain with sjlj was being used in the image, not the one with dwarf expectation we are trying to build! I set the option -e and fixed the script. Co-authored-by: Marco A L Barbosa <[email protected]>
2 parents 8cb7df5 + 16a64e7 commit 9789c6d

File tree

4 files changed

+18
-14
lines changed

4 files changed

+18
-14
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ terminate.
277277
| `i586-unknown-linux-gnu` | 2.23 | 5.3.1 || N/A ||
278278
| `i586-unknown-linux-musl` | 1.1.20 | 6.3.0 | | N/A ||
279279
| `i686-linux-android` [2] | N/A | 4.9 || N/A ||
280+
| `i686-pc-windows-gnu` | N/A | 7.3.0 || N/A ||
280281
| `i686-unknown-linux-gnu` | 2.15 | 4.6.2 || N/A ||
281282
| `i686-unknown-linux-musl` | 1.1.20 | 6.3.0 | | N/A ||
282283
| `mips-unknown-linux-gnu` | 2.23 | 5.3.1 || 4.1.0 ||

azure-pipelines.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ jobs:
2222
aarch64-unknown-linux-gnu: { TARGET: aarch64-unknown-linux-gnu, CPP: 1, DYLIB: 1, STD: 1, RUN: 1, RUNNERS: qemu-user qemu-system }
2323
arm-unknown-linux-gnueabi: { TARGET: arm-unknown-linux-gnueabi, CPP: 1, DYLIB: 1, STD: 1, RUN: 1 }
2424
arm-unknown-linux-gnueabihf: { TARGET: arm-unknown-linux-gnueabihf, CPP: 1, DYLIB: 1, STD: 1, RUN: 1 }
25-
armv7-unknown-linux-gnueabihf: { TARGET: armv7-unknown-linux-gnueabihf, CPP: 1, DYLIB: 1, STD: 1, RUN: 1, RUNNERS: qemu-user qemu-system }
25+
armv7-unknown-linux-gnueabihf: { TARGET: armv7-unknown-linux-gnueabihf, CPP: 1, DYLIB: 1, STD: 1, RUN: 1, RUNNERS: qemu-user qemu-system }
2626
i586-unknown-linux-gnu: { TARGET: i586-unknown-linux-gnu, CPP: 1, DYLIB: 1, STD: 1, RUN: 1 }
27-
i686-unknown-linux-gnu: { TARGET: i686-unknown-linux-gnu, CPP: 1, DYLIB: 1, STD: 1, RUN: 1, RUNNERS: native qemu-user qemu-system }
27+
i686-unknown-linux-gnu: { TARGET: i686-unknown-linux-gnu, CPP: 1, DYLIB: 1, STD: 1, RUN: 1, RUNNERS: native qemu-user qemu-system }
2828
mips-unknown-linux-gnu: { TARGET: mips-unknown-linux-gnu, CPP: 1, DYLIB: 1, STD: 1, RUN: 1, RUNNERS: qemu-user qemu-system }
2929
mipsel-unknown-linux-gnu: { TARGET: mipsel-unknown-linux-gnu, CPP: 1, DYLIB: 1, STD: 1, RUN: 1, RUNNERS: qemu-user qemu-system }
3030
mips64-unknown-linux-gnuabi64: { TARGET: mips64-unknown-linux-gnuabi64, CPP: 1, DYLIB: 1, STD: 1, RUN: 1 }
@@ -39,7 +39,7 @@ jobs:
3939
aarch64-unknown-linux-musl: { TARGET: aarch64-unknown-linux-musl, STD: 1, RUN: 1 }
4040
arm-unknown-linux-musleabihf: { TARGET: arm-unknown-linux-musleabihf, STD: 1, RUN: 1 }
4141
arm-unknown-linux-musleabi: { TARGET: arm-unknown-linux-musleabi, STD: 1, RUN: 1 }
42-
armv5te-unknown-linux-gnueabi: { TARGET: armv5te-unknown-linux-gnueabi, STD: 1, RUN: 1 }
42+
armv5te-unknown-linux-gnueabi: { TARGET: armv5te-unknown-linux-gnueabi, STD: 1, RUN: 1 }
4343
armv5te-unknown-linux-musleabi: { TARGET: armv5te-unknown-linux-musleabi, STD: 1, RUN: 1 }
4444
armv7-unknown-linux-musleabihf: { TARGET: armv7-unknown-linux-musleabihf, STD: 1, RUN: 1 }
4545
i586-unknown-linux-musl: { TARGET: i586-unknown-linux-musl, STD: 1, RUN: 1 }
@@ -54,8 +54,7 @@ jobs:
5454
x86_64-linux-android: { TARGET: x86_64-linux-android, CPP: 1, STD: 1, RUN: 1 }
5555
x86_64-apple-darwin: { TARGET: x86_64-apple-darwin, CPP: 1, DYLIB: 1, STD: 1, RUN: 1, VM_IMAGE: macOS-latest, DEPLOY: 1 }
5656
x86_64-pc-windows-gnu: { TARGET: x86_64-pc-windows-gnu, CPP: 1, STD: 1, RUN: 1 }
57-
# `cargo build` fails with undefined symbols (https://github.com/rust-lang/rust/issues/32859) on `i686-pc-windows-gnu`.
58-
# i686-pc-windows-gnu: { TARGET: i686-pc-windows-gnu, CPP: 1, STD: 1, RUN: 1 }
57+
i686-pc-windows-gnu: { TARGET: i686-pc-windows-gnu, CPP: 1, STD: 1, RUN: 1 }
5958
# x86_64-unknown-dragonfly: { TARGET: x86_64-unknown-dragonfly, CPP: 1, DYLIB: 1, TOOLCHAIN: nightly }
6059
# i686-unknown-freebsd: { TARGET: i686-unknown-freebsd, DYLIB: 1, STD: 1 }
6160
# x86_64-unknown-freebsd: { TARGET: x86_64-unknown-freebsd, DYLIB: 1, STD: 1 }

docker/disabled/Dockerfile.i686-pc-windows-gnu renamed to docker/Dockerfile.i686-pc-windows-gnu

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ FROM ubuntu:18.04
33
COPY common.sh /
44
RUN /common.sh
55

6+
COPY cmake.sh /
7+
RUN /cmake.sh
8+
69
COPY xargo.sh /
710
RUN /xargo.sh
811

docker/mingw.sh

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
#!/usr/bin/env bash
22

33
set -x
4+
set -euo pipefail
45

56
main() {
67
# Ubuntu mingw packages for i686 uses sjlj exceptions, but rust target
78
# i686-pc-windows-gnu uses dwarf exceptions. So we build mingw packages
89
# that are compatible with rust.
910

11+
# Enable source
12+
sed -i 's/# deb-src/deb-src/g' /etc/apt/sources.list
13+
apt-get update
14+
1015
# Install mingw (with sjlj exceptions) to get the dependencies right
1116
# Later we replace these packages with the new ones
1217
apt-get install --assume-yes --no-install-recommends g++-mingw-w64-i686
@@ -15,7 +20,6 @@ main() {
1520
while IFS='' read -r dep; do dependencies+=("${dep}"); done < \
1621
<(apt-cache showsrc gcc-mingw-w64-i686 | grep Build | cut -d: -f2 | tr , '\n' | cut -d' ' -f2 | sort | uniq)
1722

18-
apt-get update
1923
local purge_list=()
2024
for dep in "${dependencies[@]}"; do
2125
if ! dpkg -L "${dep}" > /dev/null; then
@@ -27,15 +31,13 @@ main() {
2731
local td
2832
td="$(mktemp -d)"
2933

30-
pushd "${td}" || exit 1
34+
pushd "${td}"
3135

3236
apt-get source gcc-mingw-w64-i686
33-
pushd gcc-mingw-w64-* || exit 1
37+
pushd gcc-mingw-w64-*
3438

3539
# We are using dwarf exceptions instead of sjlj
3640
sed -i -e 's/libgcc_s_sjlj-1/libgcc_s_dw2-1/g' debian/gcc-mingw-w64-i686.install
37-
# Do not install gcc with win32 thread model
38-
sed -i -e '/i686-w64-mingw32-gcc-win32/d' debian/gcc-mingw-w64-i686.install
3941

4042
# Only build i686 packages (disable x86_64)
4143
patch -p0 <<'EOF'
@@ -94,8 +96,7 @@ EOF
9496
9597
-targets := i686-w64-mingw32 x86_64-w64-mingw32
9698
+targets := i686-w64-mingw32
97-
-threads := posix win32
98-
+threads := posix
99+
threads := posix win32
99100
100101
# Hardening on the host, none on the target
101102
@@ -216,6 +216,10 @@
@@ -121,8 +122,8 @@ EOF
121122
apt-get purge --assume-yes --auto-remove "${purge_list[@]}"
122123
fi
123124

124-
popd || exit 1
125-
popd || exit 1
125+
popd
126+
popd
126127

127128
rm -rf "${td}"
128129
rm "${0}"

0 commit comments

Comments
 (0)