Skip to content

Commit

Permalink
Build libgccjit in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Mar 3, 2024
1 parent 7151f60 commit 391bb9c
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 5 deletions.
26 changes: 26 additions & 0 deletions src/ci/docker/host-x86_64/dist-x86_64-linux/build-gccjit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/sh

set -ex

cd $1

# Setting up folders for GCC
git clone https://github.com/antoyo/gcc gcc-src
cd gcc-src
git checkout $(head -1 /scripts/libgccjit.version)

mkdir ../gcc-build ../gcc-install
cd ../gcc-build

# Building GCC.
../gcc-src/configure \
--enable-host-shared \
--enable-languages=jit \
--enable-checking=release \
--disable-bootstrap \
--disable-multilib \
--prefix=$(pwd)/../gcc-install
make
make install

rm -rf ../gcc-src
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cf9554126
1 change: 0 additions & 1 deletion src/ci/docker/host-x86_64/x86_64-gnu-llvm-16/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
xz-utils \
nodejs \
mingw-w64 \
libgccjit-12-dev \
&& rm -rf /var/lib/apt/lists/*

# Note: libgccjit needs to match the default gcc version for the linker to find it.
Expand Down
1 change: 0 additions & 1 deletion src/ci/docker/host-x86_64/x86_64-gnu-llvm-17/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
xz-utils \
nodejs \
mingw-w64 \
libgccjit-13-dev \
&& rm -rf /var/lib/apt/lists/*

# Note: libgccjit needs to match the default gcc version for the linker to find it.
Expand Down
15 changes: 12 additions & 3 deletions src/ci/docker/host-x86_64/x86_64-gnu-tools/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
sudo \
xz-utils \
tidy \
libgccjit-12-dev \
\
# Install dependencies for chromium browser
gconf-service \
Expand Down Expand Up @@ -57,13 +56,17 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
lsb-release \
xdg-utils \
wget \
# libgccjit dependencies
flex \
libmpfr-dev \
libgmp-dev \
libmpc3 \
libmpc-dev \
&& rm -rf /var/lib/apt/lists/*

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

# Make `libgccjit.so` accessible.
RUN ln -s /usr/lib/gcc/x86_64-linux-gnu/12/libgccjit.so /usr/lib/x86_64-linux-gnu/libgccjit.so
# Fix rustc_codegen_gcc lto issues.
ENV GCC_EXEC_PREFIX="/usr/lib/gcc/"

Expand Down Expand Up @@ -92,6 +95,12 @@ ENV RUST_CONFIGURE_ARGS \

ENV HOST_TARGET x86_64-unknown-linux-gnu

COPY host-x86_64/dist-x86_64-linux/libgccjit.version /scripts/
COPY host-x86_64/dist-x86_64-linux/build-gccjit.sh /scripts/

RUN sh /scripts/build-gccjit.sh /scripts
COPY /scripts/gcc-install/lib/libgccjit.so /usr/lib/x86_64-linux-gnu/libgccjit.so

ENV SCRIPT /tmp/checktools.sh ../x.py && \
NODE_PATH=`npm root -g` python3 ../x.py test tests/rustdoc-gui --stage 2 \
--test-args "'--no-sandbox --jobs 1'"

0 comments on commit 391bb9c

Please sign in to comment.