Skip to content

Commit

Permalink
chore: upgrade llvm (#789)
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn authored Feb 22, 2024
1 parent 1469a7d commit 3245ff6
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 37 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,18 @@ jobs:
uses: addnab/docker-run-action@v3
with:
image: ubuntu:jammy
options: '--platform linux/arm64 --user 0:0 -e GITHUB_TOKEN -v ${{ github.workspace }}/lib/llvm-16:/usr/lib/llvm-16'
options: '--platform linux/arm64 --user 0:0 -e GITHUB_TOKEN -v ${{ github.workspace }}/lib/llvm-18:/usr/lib/llvm-18'
run: >-
apt-get update &&
apt-get install -y wget gnupg2 &&
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - &&
echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main" >> /etc/apt/sources.list &&
echo "deb-src http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main" >> /etc/apt/sources.list &&
echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main" >> /etc/apt/sources.list &&
echo "deb-src http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main" >> /etc/apt/sources.list &&
apt-get update &&
apt-get install libc++-16-dev libc++abi-16-dev -y --fix-missing --no-install-recommends &&
rm /usr/lib/llvm-16/lib/libc++abi.so &&
rm /usr/lib/llvm-16/lib/libunwind.so &&
rm /usr/lib/llvm-16/lib/libc++.so
apt-get install libc++-18-dev libc++abi-18-dev -y --fix-missing --no-install-recommends &&
rm /usr/lib/llvm-18/lib/libc++abi.so &&
rm /usr/lib/llvm-18/lib/libunwind.so &&
rm /usr/lib/llvm-18/lib/libc++.so
- name: Build and push Linux aarch64
uses: docker/build-push-action@v5
Expand Down
30 changes: 15 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,37 @@ ENV RUSTUP_HOME=/usr/local/rustup \
CC_x86_64_unknown_linux_gnu=clang \
CXX_x86_64_unknown_linux_gnu=clang++ \
RUST_TARGET=x86_64-unknown-linux-gnu \
LDFLAGS="-fuse-ld=lld --sysroot=/usr/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/sysroot -L/usr/lib/llvm-16/lib" \
LDFLAGS="-fuse-ld=lld --sysroot=/usr/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/sysroot -L/usr/lib/llvm-18/lib" \
CFLAGS="-fuse-ld=lld --sysroot=/usr/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/sysroot" \
CXXFLAGS="-fuse-ld=lld -stdlib=libc++ --sysroot=/usr/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/sysroot"

RUN apt-get update && \
apt-get install -y --fix-missing --no-install-recommends gpg-agent ca-certificates openssl && \
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \
echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main" >> /etc/apt/sources.list && \
echo "deb-src http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main" >> /etc/apt/sources.list && \
curl -sL https://deb.nodesource.com/setup_18.x | bash - && \
echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main" >> /etc/apt/sources.list && \
echo "deb-src http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main" >> /etc/apt/sources.list && \
curl -sL https://deb.nodesource.com/setup_20.x | bash - && \
apt-get update && \
apt-get install -y --fix-missing --no-install-recommends \
curl \
llvm-16 \
clang-16 \
lld-16 \
libc++-16-dev \
libc++abi-16-dev \
llvm-18 \
clang-18 \
lld-18 \
libc++-18-dev \
libc++abi-18-dev \
nodejs \
rcs \
xz-utils \
rcs \
git \
make \
ninja-build && \
ln -sf /usr/bin/clang-16 /usr/bin/clang && \
ln -sf /usr/bin/clang++-16 /usr/bin/clang++ && \
ln -sf /usr/bin/lld-16 /usr/bin/lld && \
rm /usr/lib/llvm-16/lib/libc++abi.so && \
rm /usr/lib/llvm-16/lib/libunwind.so && \
ln -sf /usr/lib/llvm-16/lib/libc++.a /usr/x86_64-unknown-linux-gnu/lib/gcc/x86_64-unknown-linux-gnu/4.8.5/libc++.a && \
ln -sf /usr/bin/clang-18 /usr/bin/clang && \
ln -sf /usr/bin/clang++-18 /usr/bin/clang++ && \
ln -sf /usr/bin/lld-18 /usr/bin/lld && \
rm /usr/lib/llvm-18/lib/libc++abi.so && \
rm /usr/lib/llvm-18/lib/libunwind.so && \
ln -sf /usr/lib/llvm-18/lib/libc++.a /usr/x86_64-unknown-linux-gnu/lib/gcc/x86_64-unknown-linux-gnu/4.8.5/libc++.a && \
npm install --location=global yarn && \
npm cache clean --force && \
curl https://sh.rustup.rs -sSf | sh -s -- -y && \
Expand Down
30 changes: 15 additions & 15 deletions aarch64.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@ ENV RUSTUP_HOME=/usr/local/rustup \
CXX_aarch64_unknown_linux_gnu="clang++ --sysroot=/usr/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/sysroot" \
C_INCLUDE_PATH="/usr/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/sysroot/usr/include" \
CFLAGS="-fuse-ld=lld --sysroot=/usr/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/sysroot" \
CXXFLAGS="--sysroot=/usr/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/sysroot -L/usr/aarch64-unknown-linux-gnu/lib/llvm-16/lib -stdlib=libc++"
CXXFLAGS="--sysroot=/usr/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/sysroot -L/usr/aarch64-unknown-linux-gnu/lib/llvm-18/lib -stdlib=libc++"

ADD ./lib/llvm-16 /usr/aarch64-unknown-linux-gnu/lib/llvm-16
ADD ./lib/llvm-18 /usr/aarch64-unknown-linux-gnu/lib/llvm-18

RUN apt-get update && \
apt-get install -y --fix-missing --no-install-recommends gpg-agent ca-certificates openssl && \
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \
echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main" >> /etc/apt/sources.list && \
echo "deb-src http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main" >> /etc/apt/sources.list && \
curl -sL https://deb.nodesource.com/setup_18.x | bash - && \
echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main" >> /etc/apt/sources.list && \
echo "deb-src http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main" >> /etc/apt/sources.list && \
curl -sL https://deb.nodesource.com/setup_20.x | bash - && \
apt-get install -y --fix-missing --no-install-recommends \
curl \
llvm-16 \
clang-16 \
lld-16 \
libc++-16-dev \
libc++abi-16-dev \
llvm-18 \
clang-18 \
lld-18 \
libc++-18-dev \
libc++abi-18-dev \
nodejs \
xz-utils \
rcs \
Expand All @@ -39,9 +39,9 @@ RUN apt-get update && \
npm install -g yarn pnpm lerna && \
npm cache clean --force && \
npm cache verify && \
ln -sf /usr/bin/clang-16 /usr/bin/clang && \
ln -sf /usr/bin/clang++-16 /usr/bin/clang++ && \
ln -sf /usr/bin/lld-16 /usr/bin/lld && \
ln -sf /usr/bin/clang-16 /usr/bin/cc && \
ln -sf /usr/bin/clang-18 /usr/bin/clang && \
ln -sf /usr/bin/clang++-18 /usr/bin/clang++ && \
ln -sf /usr/bin/lld-18 /usr/bin/lld && \
ln -sf /usr/bin/clang-18 /usr/bin/cc && \
cp -r /usr/aarch64-unknown-linux-gnu/lib/gcc /usr/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/sysroot/lib/ && \
rm -rf /var/lib/apt/lists/*
rm -rf /var/lib/apt/lists/*

0 comments on commit 3245ff6

Please sign in to comment.