Skip to content

Commit

Permalink
promote i586-unknown-linux-gnu to Tier2+hosttools
Browse files Browse the repository at this point in the history
  • Loading branch information
goshhhy committed Mar 3, 2023
1 parent 13471d3 commit 1266e8d
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
COPY scripts/cross-apt-packages.sh /scripts/
RUN sh /scripts/cross-apt-packages.sh

COPY scripts/crosstool-ng-1.24.sh /scripts/
RUN sh /scripts/crosstool-ng-1.24.sh

COPY scripts/rustbuild-setup.sh /scripts/
RUN sh /scripts/rustbuild-setup.sh
WORKDIR /tmp

COPY host-x86_64/dist-i586-gnu-i586-i686-musl/i586-linux-gnu.config \
host-x86_64/dist-i586-gnu-i586-i686-musl/build-i586-gnu-toolchain.sh \
/tmp/
RUN su rustbuild -c ./build-i586-gnu-toolchain.sh
ENV PATH=$PATH:/x-tools/i586-unknown-linux-gnu/bin
ENV \
CC_i586_unknown_linux_gnu=i586-unknown-linux-gnu-gcc \
AR_i586_unknown_linux_gnu=i586-unknown-linux-gnu-ar

WORKDIR /build/
COPY scripts/musl.sh /build/
RUN CC=gcc CFLAGS="-m32 -Wa,-mrelax-relocations=no" \
Expand Down Expand Up @@ -68,10 +52,9 @@ ENV RUST_CONFIGURE_ARGS \
#
# See: https://github.com/rust-lang/rust/issues/34978
ENV CFLAGS_i686_unknown_linux_musl=-Wa,-mrelax-relocations=no
ENV CFLAGS_i586_unknown_linux_gnu=-Wa,-mrelax-relocations=no
ENV CFLAGS_i586_unknown_linux_musl=-Wa,-mrelax-relocations=no

ENV TARGETS=i586-unknown-linux-gnu,i686-unknown-linux-musl
ENV TARGETS=i686-unknown-linux-musl

ENV SCRIPT \
python3 ../x.py --stage 2 test --host='' --target $TARGETS && \
Expand Down
56 changes: 56 additions & 0 deletions src/ci/docker/host-x86_64/dist-i586-linux/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
FROM ubuntu:22.04

ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
g++-multilib \
make \
ninja-build \
file \
curl \
ca-certificates \
python3 \
git \
cmake \
xz-utils \
sudo \
gdb \
patch \
libssl-dev \
pkg-config

COPY scripts/cross-apt-packages.sh /scripts/
RUN sh /scripts/cross-apt-packages.sh

COPY scripts/crosstool-ng-1.24.sh /scripts/
RUN sh /scripts/crosstool-ng-1.24.sh

COPY scripts/rustbuild-setup.sh /scripts/
RUN sh /scripts/rustbuild-setup.sh
WORKDIR /tmp

COPY host-x86_64/dist-i586-linux/i586-linux-gnu.config \
host-x86_64/dist-i586-linux/build-i586-gnu-toolchain.sh \
/tmp/
RUN su rustbuild -c ./build-i586-gnu-toolchain.sh
ENV PATH=$PATH:/x-tools/i586-unknown-linux-gnu/bin
ENV \
CC_i586_unknown_linux_gnu=i586-unknown-linux-gnu-gcc \
AR_i586_unknown_linux_gnu=i586-unknown-linux-gnu-ar

COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh

ENV RUST_CONFIGURE_ARGS \
--enable-full-tools \
--disable-docs

# Newer binutils broke things on some vms/distros (i.e., linking against
# unknown relocs disabled by the following flag), so we need to go out of our
# way to produce "super compatible" binaries.
#
# See: https://github.com/rust-lang/rust/issues/34978
ENV CFLAGS_i586_unknown_linux_gnu=-Wa,-mrelax-relocations=no

ENV HOSTS=i586-unknown-linux-gnu
ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $HOSTS

5 changes: 4 additions & 1 deletion src/ci/github-actions/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,10 @@ jobs:
- name: dist-armv7-linux
<<: *job-linux-xl

- name: dist-i586-gnu-i586-i686-musl
- name: dist-i586-i686-musl
<<: *job-linux-xl

- name: dist-i586-linux
<<: *job-linux-xl

- name: dist-i686-linux
Expand Down
2 changes: 1 addition & 1 deletion src/doc/rustc/src/platform-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ target | notes
`arm-unknown-linux-gnueabi` | ARMv6 Linux (kernel 3.2, glibc 2.17)
`arm-unknown-linux-gnueabihf` | ARMv6 Linux, hardfloat (kernel 3.2, glibc 2.17)
`armv7-unknown-linux-gnueabihf` | ARMv7 Linux, hardfloat (kernel 3.2, glibc 2.17)
`i586-unknown-linux-gnu` | 32-bit Linux w/o SSE (kernel 3.2, glibc 2.17)
`mips-unknown-linux-gnu` | MIPS Linux (kernel 4.4, glibc 2.23)
`mips64-unknown-linux-gnuabi64` | MIPS64 Linux, n64 ABI (kernel 4.4, glibc 2.23)
`mips64el-unknown-linux-gnuabi64` | MIPS64 (LE) Linux, n64 ABI (kernel 4.4, glibc 2.23)
Expand Down Expand Up @@ -146,7 +147,6 @@ target | std | notes
`armv7r-none-eabihf` | * | Bare ARMv7-R, hardfloat
`asmjs-unknown-emscripten` | ✓ | asm.js via Emscripten
`i586-pc-windows-msvc` | * | 32-bit Windows w/o SSE
`i586-unknown-linux-gnu` | ✓ | 32-bit Linux w/o SSE (kernel 3.2, glibc 2.17)
`i586-unknown-linux-musl` | ✓ | 32-bit Linux w/o SSE, MUSL
[`i686-linux-android`](platform-support/android.md) | ✓ | 32-bit x86 Android
`i686-unknown-freebsd` | ✓ | 32-bit FreeBSD
Expand Down

0 comments on commit 1266e8d

Please sign in to comment.