Auto merge of #122658 - cuviper:gccjit-archive, r=Mark-Simulacrum
ci: Build gccjit from a git archive A full `git clone` of GCC includes quite a lot of history, and it's completely unnecessary for building it in CI. We can use a GitHub archive URL to get a simple tarball that is much faster to download. Also, the `gcc-build` directory can be removed after install to reduce the image size even further.
This commit is contained in:
commit
0824b300eb
@ -1,5 +1,10 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
GIT_REPO="https://github.com/rust-lang/gcc"
|
||||||
|
|
||||||
|
# This commit hash needs to be updated to use a more recent gcc fork version.
|
||||||
|
GIT_COMMIT="78dc50f0e50e6cd1433149520bd512a4e0eaa1bc"
|
||||||
|
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
cd $1
|
cd $1
|
||||||
@ -7,13 +12,11 @@ cd $1
|
|||||||
source shared.sh
|
source shared.sh
|
||||||
|
|
||||||
# Setting up folders for GCC
|
# Setting up folders for GCC
|
||||||
git clone https://github.com/antoyo/gcc gcc-src
|
curl -L "$GIT_REPO/archive/$GIT_COMMIT.tar.gz" |
|
||||||
cd gcc-src
|
tar -xz --transform "s/gcc-$GIT_COMMIT/gcc-src/"
|
||||||
# This commit hash needs to be updated to use a more recent gcc fork version.
|
|
||||||
git checkout 78dc50f0e50e6cd1433149520bd512a4e0eaa1bc
|
|
||||||
|
|
||||||
mkdir ../gcc-build ../gcc-install
|
mkdir gcc-build gcc-install
|
||||||
cd ../gcc-build
|
pushd gcc-build
|
||||||
|
|
||||||
# Building GCC.
|
# Building GCC.
|
||||||
hide_output \
|
hide_output \
|
||||||
@ -28,6 +31,7 @@ hide_output \
|
|||||||
hide_output make -j$(nproc)
|
hide_output make -j$(nproc)
|
||||||
hide_output make install
|
hide_output make install
|
||||||
|
|
||||||
rm -rf ../gcc-src
|
popd
|
||||||
|
rm -rf gcc-src gcc-build
|
||||||
ln -s /scripts/gcc-install/lib/libgccjit.so /usr/lib/x86_64-linux-gnu/libgccjit.so
|
ln -s /scripts/gcc-install/lib/libgccjit.so /usr/lib/x86_64-linux-gnu/libgccjit.so
|
||||||
ln -s /scripts/gcc-install/lib/libgccjit.so /usr/lib/x86_64-linux-gnu/libgccjit.so.0
|
ln -s /scripts/gcc-install/lib/libgccjit.so /usr/lib/x86_64-linux-gnu/libgccjit.so.0
|
||||||
|
Loading…
Reference in New Issue
Block a user