Skip to content

Commit f5797ba

Browse files
committed
Use cache file for libc standalone build.
1 parent 14b3572 commit f5797ba

File tree

2 files changed

+16
-19
lines changed

2 files changed

+16
-19
lines changed

.github/workflows/libc-fullbuild-tests.yml

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,49 +24,42 @@ jobs:
2424
cpp_compiler: clang++-22
2525
target: x86_64-unknown-linux-llvm
2626
include_scudo: ON
27-
enable_baremetal_build: OFF
2827
- os: ubuntu-24.04
2928
build_type: Release
3029
c_compiler: clang-22
3130
cpp_compiler: clang++-22
3231
target: x86_64-unknown-linux-llvm
3332
include_scudo: ON
34-
enable_baremetal_build: OFF
3533
- os: ubuntu-24.04
3634
build_type: MinSizeRel
3735
c_compiler: clang-22
3836
cpp_compiler: clang++-22
3937
target: x86_64-unknown-linux-llvm
4038
include_scudo: ON
41-
enable_baremetal_build: OFF
4239
- os: ubuntu-24.04-arm
4340
build_type: Debug
4441
c_compiler: clang-22
4542
cpp_compiler: clang++-22
4643
target: aarch64-unknown-linux-llvm
4744
include_scudo: ON
48-
enable_baremetal_build: OFF
4945
- os: ubuntu-24.04
5046
build_type: Debug
5147
c_compiler: clang-22
5248
cpp_compiler: clang++-22
5349
target: x86_64-unknown-uefi-llvm
5450
include_scudo: OFF
55-
enable_baremetal_build: OFF
5651
- os: ubuntu-24.04
5752
build__type: Release
5853
c_compiler: clang-22
5954
cpp_compiler: clang++-22
6055
target: armv6m-none-eabi
6156
include_scudo: OFF
62-
enable_baremetal_build: ON
6357
- os: ubuntu-24.04
6458
build__type: Release
6559
c_compiler: clang-22
6660
cpp_compiler: clang++-22
6761
target: armv7m-none-eabi
6862
include_scudo: OFF
69-
enable_baremetal_build: ON
7063
# TODO: add back gcc build when it is fixed
7164
# - c_compiler: gcc
7265
# cpp_compiler: g++
@@ -121,7 +114,7 @@ jobs:
121114
-DCOMPILER_RT_SCUDO_STANDALONE_BUILD_SHARED=OFF"
122115
fi
123116
124-
if [[ ${{ matrix.enable_baremetal_build}} == "ON" ]]; then
117+
if [[ ${{ contains(matrix.target, '-none-') }} ]]; then
125118
cmake -B ${{ steps.strings.outputs.build-output-dir }} \
126119
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} \
127120
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }} \
@@ -130,19 +123,12 @@ jobs:
130123
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache \
131124
-DCMAKE_INSTALL_PREFIX=${{ steps.strings.outputs.build-install-dir }} \
132125
-DLLVM_RUNTIME_TARGETS=${{ matrix.target }} \
133-
-DLLVM_ENABLE_RUNTIMES="$RUNTIMES" \
134-
-DLLVM_LIBC_FULL_BUILD=ON \
135-
-G Ninja \
136-
-S ${{ github.workspace }}/runtimes \
137-
-DCMAKE_BUILD_TYPE=Release \
138-
-DLLVM_LIBC_FULL_BUILD=ON \
139126
-DCMAKE_C_COMPILER_TARGET=${{ matrix.target }} \
140127
-DCMAKE_CXX_COMPILER_TARGET=${{ matrix.target }} \
141128
-DCMAKE_ASM_COMPILER_TARGET=${{ matrix.target }} \
142-
-DCMAKE_C_FLAGS=-mfloat-abi=soft \
143-
-DCMAKE_CXX_FLAGS=-mfloat-abi=soft \
144-
-DCMAKE_C_COMPILER_WORKS=ON \
145-
-DCMAKE_CXX_COMPILER_WORKS=ON
129+
-G Ninja \
130+
-S ${{ github.workspace }}/runtimes \
131+
-C ${{ github.workspace }}/clang/cmake/caches/Standalone_libc_baremetal.cache
146132
else
147133
cmake -B ${{ steps.strings.outputs.build-output-dir }} \
148134
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} \
@@ -168,7 +154,7 @@ jobs:
168154
169155
- name: Test
170156
# Skip UEFI tests until we have testing set up.
171-
if: ${{ ! endsWith(matrix.target, '-uefi-llvm') }} && ${{ matrix.enable_baremetal_build }} == "OFF"
157+
if: ${{ ! endsWith(matrix.target, '-uefi-llvm') }} && ${{ ! contains(matrix.target, '-none-') }}
172158
run: >
173159
cmake
174160
--build ${{ steps.strings.outputs.build-output-dir }}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
set(LLVM_ENABLE_RUNTIMES "libc" CACHE STRING "")
2+
set(LLVM_LIBC_FULL_BUILD "ON" CACHE BOOL "")
3+
set(CMAKE_C_COMPILER_WORKS ON CACHE BOOL "")
4+
set(CMAKE_CXX_COMPILER_WORKS ON CACHE BOOL "")
5+
set(CMAKE_C_FLAGS "-mfloat-abi=soft -mthumb" CACHE STRING "")
6+
set(CMAKE_CXX_FLAGS "-mfloat-abi=soft -mthumb" CACHE STRING "")
7+
set(CMAKE_SYSROOT "" CACHE STRING "")
8+
set(CMAKE_SYSTEM_NAME Generic CACHE STRING "")
9+
set(CMAKE_SYSTEM_PROCESSOR arm CACHE STRING "")
10+
11+
set(LLVM_INCLUDE_TESTS OFF CACHE BOOL "")

0 commit comments

Comments
 (0)