1 # This workflow is for pre-commit testing of the LLVM-libc project.
2 name: LLVM-libc Pre-commit Fullbuild Tests
10 - '.github/workflows/libc-fullbuild-tests.yml'
21 # TODO: add back gcc build when it is fixed
25 - uses: actions/checkout@v4
27 # Libc's build is relatively small comparing with other components of LLVM.
28 # A fresh fullbuild takes about 190MiB of uncompressed disk space, which can
29 # be compressed into ~40MiB. Limiting the cache size to 1G should be enough.
30 # Prefer sccache as it is more modern.
31 # Do not use direct GHAC access even though it is supported by sccache. GHAC rejects
32 # frequent small object writes.
34 uses: hendrikmuhs/ccache-action@v1.2
37 key: libc_fullbuild_${{ matrix.c_compiler }}
41 # - MPFR is required by some of the mathlib tests.
42 # - Debian has a multilib setup, so we need to symlink the asm directory.
43 # For more information, see https://wiki.debian.org/Multiarch/LibraryPathOverview
44 - name: Prepare dependencies (Ubuntu)
47 sudo apt-get install -y libmpfr-dev libgmp-dev libmpc-dev ninja-build linux-libc-dev
48 sudo ln -sf /usr/include/$(uname -p)-linux-gnu/asm /usr/include/asm
50 - name: Set reusable strings
54 echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
55 echo "build-install-dir=${{ github.workspace }}/install" >> "$GITHUB_OUTPUT"
57 # Configure libc fullbuild with scudo.
58 # Use MinSizeRel to reduce the size of the build.
59 - name: Configure CMake
61 cmake -B ${{ steps.strings.outputs.build-output-dir }}
62 -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
63 -DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
64 -DCMAKE_BUILD_TYPE=MinSizeRel
65 -DCMAKE_C_COMPILER_LAUNCHER=sccache
66 -DCMAKE_CXX_COMPILER_LAUNCHER=sccache
67 -DCMAKE_INSTALL_PREFIX=${{ steps.strings.outputs.build-install-dir }}
68 -DLLVM_ENABLE_RUNTIMES="libc;compiler-rt"
69 -DLLVM_LIBC_FULL_BUILD=ON
70 -DLLVM_LIBC_INCLUDE_SCUDO=ON
71 -DCOMPILER_RT_BUILD_SCUDO_STANDALONE_WITH_LLVM_LIBC=ON
72 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF
73 -DCOMPILER_RT_SCUDO_STANDALONE_BUILD_SHARED=OFF
75 -S ${{ github.workspace }}/runtimes
80 --build ${{ steps.strings.outputs.build-output-dir }}
87 --build ${{ steps.strings.outputs.build-output-dir }}