FIX Hot fix for gnu linux build.
#4
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: llvm-x86_64-unknown-linux-gnu | |
| on: | |
| push: | |
| tags: | |
| - 'llvm-x86_64-unknown-linux-gnu-v*.*.*' | |
| jobs: | |
| build-llvm: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: messense/manylinux_2_28-cross:x86_64 | |
| permissions: | |
| contents: write | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - name: Generating Unique ID | |
| run: | | |
| BASE_NAME=$(echo "$GITHUB_REF" | sed 's|^refs/tags/||') | |
| BUILD_ID="${BASE_NAME}-$GITHUB_RUN_ID" | |
| echo "BUILD_ID=$BUILD_ID" >> $GITHUB_ENV | |
| echo "BASE_NAME=$BASE_NAME" >> $GITHUB_ENV | |
| echo "Unique ID: $BUILD_ID" | |
| echo "Base name: $BASE_NAME" | |
| - name: Installing dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential cmake ninja-build python3 wget libz-dev binutils xz-utils gcc g++ lld | |
| sudo apt-get remove -y llvm-16* clang-16* || true | |
| sudo rm -rf /usr/lib/llvm-16 | |
| sudo apt-get install -y clang | |
| - name: Downloading LLVM project | |
| run: | | |
| wget https://github.com/llvm/llvm-project/releases/download/llvmorg-17.0.6/llvm-project-17.0.6.src.tar.xz | |
| - name: Unpacking LLVM project | |
| run: | | |
| tar -xf llvm-project-17.0.6.src.tar.xz | |
| mv llvm-project-17.0.6.src llvm-project | |
| - name: Creating cross-compilation build directory | |
| run: | | |
| mkdir -p llvm-build | |
| - name: Configure LLVM for cross-compilation to musl | |
| run: | | |
| cmake ../llvm-project/llvm -G Ninja \ | |
| -DCMAKE_BUILD_TYPE=MinSizeRel \ | |
| -DCMAKE_C_COMPILER=clang \ | |
| -DCMAKE_CXX_COMPILER=clang++ \ | |
| -DCMAKE_SYSROOT=/usr/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/sysroot \ | |
| -DCMAKE_C_FLAGS="--target=x86_64-unknown-linux-gnu --sysroot=/usr/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/sysroot" \ | |
| -DCMAKE_CXX_FLAGS="--target=x86_64-unknown-linux-gnu --sysroot=/usr/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/sysroot" \ | |
| -DCMAKE_ASM_FLAGS="--target=x86_64-unknown-linux-gnu --sysroot=/usr/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/sysroot" \ | |
| -DLLVM_ENABLE_PROJECTS="llvm" \ | |
| -DLLVM_ENABLE_TERMINFO=OFF \ | |
| -DLLVM_ENABLE_ZLIB=ON \ | |
| -DLLVM_ENABLE_LIBXML2=OFF \ | |
| -DCMAKE_INSTALL_PREFIX="dist" \ | |
| -DLLVM_TARGETS_TO_BUILD=all \ | |
| -DLLVM_BUILD_TESTS=OFF \ | |
| -DLLVM_BUILD_EXAMPLES=OFF \ | |
| -DLLVM_INCLUDE_TESTS=OFF \ | |
| -DLLVM_INCLUDE_EXAMPLES=OFF \ | |
| -DLLVM_INCLUDE_DOCS=OFF | |
| working-directory: llvm-build | |
| - name: Building LLVM | |
| run: | | |
| ninja -j$(nproc) | |
| working-directory: llvm-build | |
| - name: Installing LLVM | |
| run: | | |
| ninja install | |
| working-directory: llvm-build | |
| - name: Cleaning LLVM Binaries | |
| run: | | |
| find llvm-build/dist/bin -type f -executable ! -name "llvm-config" -delete | |
| - name: Preparing distribution files | |
| run: | | |
| mkdir -p tempDir/lib | |
| mkdir -p tempDir/bin | |
| mkdir -p tempDir/include | |
| cp -r llvm-build/dist/lib/* tempDir/lib/ | |
| cp -r llvm-build/dist/bin/* tempDir/bin/ | |
| cp -r llvm-build/dist/include/* tempDir/include/ | |
| - name: Packaging LLVM (LLVM Libraries, Binaries & Includes) | |
| run: | | |
| tar --format=pax -cJf llvm-x86_64-unknown-linux-gnu.tar.xz --exclude='*/*.cmake' --exclude='*/*.o' --exclude='*/*.d' lib bin include | |
| working-directory: tempDir | |
| - name: Releasing LLVM | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ env.BUILD_ID }} | |
| name: "llvm-x86_64-unknown-linux-gnu" | |
| body: | | |
| ## llvm-x86_64-unknown-linux-gnu | |
| LLVM precompiled for x86_64-unknown-linux-gnu host target triple. | |
| The LLVM backend has been precompiled specifically for linking to a system that follows the triple-target convention. | |
| This precompilation is intended solely for building the Thrush Compiler. Both LLVM and Thrush maintain their ability to perform cross-compilation for multiple targets. | |
| files: | | |
| tempDir/llvm-x86_64-unknown-linux-gnu.tar.xz | |
| draft: false |