Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[libc] add uefi fullbuild to workflows #131376

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 30, 2025

Conversation

RossComputerGuy
Copy link
Member

Comes after #131246 to enable UEFI being build. Skips tests until we have set up testing.

@RossComputerGuy
Copy link
Member Author

Tests fail due to:

error: backend data layout 'e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128' does not match expected target description 'e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128'

#120632 fixes it

@RossComputerGuy RossComputerGuy force-pushed the uefi-libc-ci branch 3 times, most recently from 24cd14a to ce8b775 Compare April 23, 2025 04:11
@RossComputerGuy RossComputerGuy marked this pull request as ready for review April 23, 2025 04:37
@llvmbot
Copy link
Member

llvmbot commented Apr 23, 2025

@llvm/pr-subscribers-github-workflow

Author: Tristan Ross (RossComputerGuy)

Changes

Comes after #131246 to enable UEFI being build. Skips tests until we have set up testing.


Full diff: https://github.com/llvm/llvm-project/pull/131376.diff

1 Files Affected:

  • (modified) .github/workflows/libc-fullbuild-tests.yml (+42-21)
diff --git a/.github/workflows/libc-fullbuild-tests.yml b/.github/workflows/libc-fullbuild-tests.yml
index 54d0df99b687e..24d75f58d45e0 100644
--- a/.github/workflows/libc-fullbuild-tests.yml
+++ b/.github/workflows/libc-fullbuild-tests.yml
@@ -19,13 +19,23 @@ jobs:
         include:
           - os: ubuntu-24.04
             ccache-variant: sccache
-            c_compiler: clang-20
-            cpp_compiler: clang++-20
+            c_compiler: clang-21
+            cpp_compiler: clang++-21
+            target: x86_64-unknown-linux-llvm
+            include_scudo: ON
           # TODO: remove ccache logic when https://github.com/hendrikmuhs/ccache-action/issues/279 is resolved.
           - os: ubuntu-24.04-arm
             ccache-variant: ccache
-            c_compiler: clang-20
-            cpp_compiler: clang++-20
+            c_compiler: clang-21
+            cpp_compiler: clang++-21
+            target: aarch64-unknown-linux-llvm
+            include_scudo: ON
+          - os: ubuntu-24.04
+            ccache-variant: ccache
+            c_compiler: clang-21
+            cpp_compiler: clang++-21
+            target: x86_64-unknown-uefi-llvm
+            include_scudo: OFF
           # TODO: add back gcc build when it is fixed
           # - c_compiler: gcc
           #   cpp_compiler: g++
@@ -53,7 +63,7 @@ jobs:
       run: |
         wget https://apt.llvm.org/llvm.sh
         chmod +x llvm.sh
-        sudo ./llvm.sh 20
+        sudo ./llvm.sh 21
         sudo apt-get update
         sudo apt-get install -y libmpfr-dev libgmp-dev libmpc-dev ninja-build linux-libc-dev
         sudo ln -sf /usr/include/$(uname -p)-linux-gnu/asm /usr/include/asm
@@ -68,22 +78,31 @@ jobs:
     # Configure libc fullbuild with scudo.
     # Use MinSizeRel to reduce the size of the build.
     - name: Configure CMake
-      run: >
-        cmake -B ${{ steps.strings.outputs.build-output-dir }}
-        -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-        -DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-        -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-        -DCMAKE_C_COMPILER_LAUNCHER=${{ matrix.ccache-variant }}
-        -DCMAKE_CXX_COMPILER_LAUNCHER=${{ matrix.ccache-variant }}
-        -DCMAKE_INSTALL_PREFIX=${{ steps.strings.outputs.build-install-dir }}
-        -DLLVM_ENABLE_RUNTIMES="libc;compiler-rt"
-        -DLLVM_LIBC_FULL_BUILD=ON
-        -DLLVM_LIBC_INCLUDE_SCUDO=ON
-        -DCOMPILER_RT_BUILD_SCUDO_STANDALONE_WITH_LLVM_LIBC=ON
-        -DCOMPILER_RT_BUILD_GWP_ASAN=OFF
-        -DCOMPILER_RT_SCUDO_STANDALONE_BUILD_SHARED=OFF
-        -G Ninja
-        -S ${{ github.workspace }}/runtimes
+      run: |
+        export RUNTIMES="libc"
+
+        if [[ ${{ matrix.include_scudo}} == "ON" ]]; then
+          export RUNTIMES="$RUNTIMES;compiler-rt"
+          export CMAKE_FLAGS="
+            -DLLVM_LIBC_INCLUDE_SCUDO=ON
+            -DCOMPILER_RT_BUILD_SCUDO_STANDALONE_WITH_LLVM_LIBC=ON
+            -DCOMPILER_RT_BUILD_GWP_ASAN=OFF
+            -DCOMPILER_RT_SCUDO_STANDALONE_BUILD_SHARED=OFF"
+        fi
+
+        cmake -B ${{ steps.strings.outputs.build-output-dir }} \
+        -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} \
+        -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} \
+        -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
+        -DCMAKE_C_COMPILER_LAUNCHER=${{ matrix.ccache-variant }} \
+        -DCMAKE_CXX_COMPILER_LAUNCHER=${{ matrix.ccache-variant }} \
+        -DCMAKE_INSTALL_PREFIX=${{ steps.strings.outputs.build-install-dir }} \
+        -DLLVM_RUNTIMES_TARGET=${{ matrix.target }} \
+        -DLLVM_ENABLE_RUNTIMES="$RUNTIMES" \
+        -DLLVM_LIBC_FULL_BUILD=ON \
+        -G Ninja \
+        -S ${{ github.workspace }}/runtimes \
+        $CMAKE_FLAGS
 
     - name: Build
       run: >
@@ -93,6 +112,8 @@ jobs:
         --target install
 
     - name: Test
+      # Skip UEFI tests until we have testing set up.
+      if: ${{ ! endsWith(matrix.target, '-uefi-llvm') }}
       run: >
         cmake 
         --build ${{ steps.strings.outputs.build-output-dir }} 

@RossComputerGuy
Copy link
Member Author

I had to disable SCUDO because things weren't targeting right there. This hasn't been a problem locally, might be my own problem with configuring it or just due to setting the default target triple when building Clang. Anyway, for now we can live without SCUDO on UEFI and likely work with supporting the built-in allocator for UEFI in the future.

Copy link
Contributor

@SchrodingerZhu SchrodingerZhu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@RossComputerGuy RossComputerGuy merged commit e9193f5 into llvm:main Apr 30, 2025
15 checks passed
@RossComputerGuy RossComputerGuy deleted the uefi-libc-ci branch April 30, 2025 21:27
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
Comes after llvm#131246 to enable UEFI being build. Skips tests until we
have set up testing.
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
Comes after llvm#131246 to enable UEFI being build. Skips tests until we
have set up testing.
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
Comes after llvm#131246 to enable UEFI being build. Skips tests until we
have set up testing.
GeorgeARM pushed a commit to GeorgeARM/llvm-project that referenced this pull request May 7, 2025
Comes after llvm#131246 to enable UEFI being build. Skips tests until we
have set up testing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants