Skip to content

Commit 7bd738c

Browse files
committed
Address review comments
* Clean up toolchain cache files * Modify tar usage * Merge ldflags and shared_ldflags matrix configuration
1 parent 295fc9a commit 7bd738c

File tree

6 files changed

+17
-88
lines changed

6 files changed

+17
-88
lines changed

.github/actions/download-directory/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ runs:
3131
run: |
3232
New-Item -ItemType Directory -Path "${{ inputs.path }}" -Force | Out-Null
3333
$TarFile = Join-Path "${{ steps.create-temp-dir.outputs.temp-dir }}" "${{ inputs.name }}.tar.gz"
34-
tar -xzf $TarFile -C ${{ inputs.path }}
34+
tar xzf $TarFile -C ${{ inputs.path }}

.github/actions/upload-directory/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ runs:
1919
$TempDir = New-TemporaryFile | % { Remove-Item $_; New-Item -ItemType Directory -Path $_ }
2020
$TarFile = Join-Path $TempDir "${{ inputs.name }}.tar.gz"
2121
echo "tar-file=$TarFile" >> $env:GITHUB_OUTPUT
22-
tar -czf $TarFile -C "${{ inputs.path }}" .
22+
tar cfz $TarFile -C "${{ inputs.path }}" .
2323
2424
- uses: actions/upload-artifact@v4
2525
with:

.github/workflows/build-toolchain.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -317,9 +317,8 @@ jobs:
317317
"cflags": "${{ steps.context.outputs.WINDOWS_CMAKE_C_FLAGS }}",
318318
"cxx": "cl",
319319
"cxxflags": "${{ steps.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}",
320-
"ldflags": "${{ steps.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}",
321-
"shared_ldflags": "${{ steps.context.outputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}",
322320
"swiftflags": "${{ steps.context.outputs.WINDOWS_CMAKE_Swift_FLAGS }}",
321+
"cmake_linker_flags": "-D CMAKE_EXE_LINKER_FLAGS=\"${{ steps.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}\" -D CMAKE_SHARED_LINKER_FLAGS=\"${{ steps.context.outputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}\"",
323322
"extra_flags": "-D CMAKE_SYSTEM_PROCESSOR=AMD64 -D CMAKE_MT=mt"
324323
},
325324
{
@@ -330,8 +329,7 @@ jobs:
330329
"cxx": "cl",
331330
"cxxflags": "${{ steps.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}",
332331
"swiftflags": "${{ steps.context.outputs.WINDOWS_CMAKE_Swift_FLAGS }}",
333-
"ldflags": "${{ steps.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}",
334-
"shared_ldflags": "${{ steps.context.outputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}",
332+
"cmake_linker_flags": "-D CMAKE_EXE_LINKER_FLAGS=\"${{ steps.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}\" -D CMAKE_SHARED_LINKER_FLAGS=\"${{ steps.context.outputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}\"",
335333
"extra_flags": "-D CMAKE_SYSTEM_PROCESSOR=ARM64 -D CMAKE_MT=mt"
336334
}
337335
]
@@ -437,8 +435,7 @@ jobs:
437435
"cxx": "clang++",
438436
"cxxflags": "${{ steps.context.outputs.DARWIN_CMAKE_CXX_FLAGS }}",
439437
"swiftflags": "${{ steps.context.outputs.DARWIN_CMAKE_Swift_FLAGS }}",
440-
"ldflags": "${{ steps.context.outputs.DARWIN_CMAKE_EXE_LINKER_FLAGS }}",
441-
"shared_ldflags": "${{ steps.context.outputs.DARWIN_CMAKE_SHARED_LINKER_FLAGS }}",
438+
"cmake_linker_flags": "-D CMAKE_EXE_LINKER_FLAGS=\"${{ steps.context.outputs.DARWIN_CMAKE_EXE_LINKER_FLAGS }}\" -D CMAKE_SHARED_LINKER_FLAGS=\"${{ steps.context.outputs.DARWIN_CMAKE_SHARED_LINKER_FLAGS }}\"",
442439
"extra_flags": "-D CMAKE_SYSTEM_PROCESSOR=x86_64 -D CMAKE_OSX_DEPLOYMENT_TARGET=10.15 -D CMAKE_OSX_ARCHITECTURES=x86_64"
443440
},
444441
{
@@ -449,8 +446,7 @@ jobs:
449446
"cxx": "clang++",
450447
"cxxflags": "${{ steps.context.outputs.DARWIN_CMAKE_CXX_FLAGS }}",
451448
"swiftflags": "${{ steps.context.outputs.DARWIN_CMAKE_Swift_FLAGS }}",
452-
"ldflags": "${{ steps.context.outputs.DARWIN_CMAKE_EXE_LINKER_FLAGS }}",
453-
"shared_ldflags": "${{ steps.context.outputs.DARWIN_CMAKE_SHARED_LINKER_FLAGS }}",
449+
"cmake_linker_flags": "-D CMAKE_EXE_LINKER_FLAGS=${{ steps.context.outputs.DARWIN_CMAKE_EXE_LINKER_FLAGS }} -D CMAKE_SHARED_LINKER_FLAGS=${{ steps.context.outputs.DARWIN_CMAKE_SHARED_LINKER_FLAGS }}",
454450
"extra_flags": "-D CMAKE_SYSTEM_PROCESSOR=arm64 -D CMAKE_OSX_DEPLOYMENT_TARGET=10.15 -D CMAKE_OSX_ARCHITECTURES=arm64"
455451
}
456452
]

.github/workflows/swift-toolchain.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,9 +1032,8 @@ jobs:
10321032
-D CMAKE_Swift_COMPILER="${SWIFTC}" `
10331033
-D CMAKE_Swift_COMPILER_WORKS=YES `
10341034
-D CMAKE_Swift_FLAGS="-sdk `"${SDKROOT}`" -Xcc -D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH" `
1035-
-D CMAKE_EXE_LINKER_FLAGS="${{ matrix.ldflags }}" `
1035+
${{ matrix.cmake_linker_flags }} `
10361036
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr `
1037-
-D CMAKE_SHARED_LINKER_FLAGS="${{ matrix.shared_ldflags }}" `
10381037
@EXTRA_FLAGS `
10391038
-G Ninja `
10401039
-S ${{ github.workspace }}/SourceCache/llvm-project/llvm `

Darwin-arm64.cmake

Lines changed: 5 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# test args
2-
3-
set(LLVM_LIT_ARGS "--xunit-xml-output=testresults.xunit.xml -v" CACHE STRING "")
4-
51
set(LLVM_ENABLE_PROJECTS
62
clang
73
clang-tools-extra
@@ -19,12 +15,11 @@ set(LLVM_ENABLE_RUNTIMES
1915
CACHE STRING "")
2016

2117
# This forces libc++ to be built so disable it.
22-
set(LLDB_INCLUDE_TESTS OFF CACHE BOOL "")
18+
set(LLDB_INCLUDE_TESTS NO CACHE BOOL "")
2319

24-
# Compiler-RT configuration for macOS. For some reason, enabling `compiler-rt` in
25-
# `LLVM_ENABLE_RUNTIMES` is not enough.
26-
set(LLVM_BUILD_EXTERNAL_COMPILER_RT ON CACHE BOOL "Build Compiler-RT with just-built clang")
27-
set(COMPILER_RT_ENABLE_IOS ON CACHE BOOL "Build iOS Compiler-RT libraries")
20+
# Compiler-RT configuration for macOS.
21+
set(LLVM_BUILD_EXTERNAL_COMPILER_RT YES CACHE BOOL "Build Compiler-RT with just-built clang")
22+
set(COMPILER_RT_ENABLE_IOS YES CACHE BOOL "Build iOS Compiler-RT libraries")
2823

2924
# NOTE(compnerd) always enable assertions, the toolchain will not provide enough
3025
# context to resolve issues otherwise and may silently generate invalid output.
@@ -39,35 +34,7 @@ set(LLVM_DEFAULT_TARGET_TRIPLE aarch64-apple-darwin CACHE STRING "")
3934
set(LLVM_APPEND_VC_REV NO CACHE BOOL "")
4035
set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR YES CACHE BOOL "")
4136
set(LLVM_ENABLE_PYTHON YES CACHE BOOL "")
42-
43-
set(CMAKE_CXX_SCAN_FOR_MODULES OFF CACHE BOOL "")
44-
45-
# Setting any of the stuff below causes issues with configure (?).
46-
# set(LLVM_BUILTIN_TARGETS
47-
# aarch64-apple-darwin x86_64-apple-darwin
48-
# CACHE STRING "")
49-
50-
# The runtime targets are used to build the compiler-rt profile library.
51-
# set(LLVM_RUNTIME_TARGETS
52-
# aarch64-apple-darwin x86_64-apple-darwin
53-
# CACHE STRING "")
54-
55-
# foreach(target ${LLVM_RUNTIME_TARGETS})
56-
# set(BUILTINS_${target}_LLVM_ENABLE_RUNTIMES
57-
# compiler-rt
58-
# CACHE STRING "")
59-
# set(BUILTINS_${target}_CMAKE_SYSTEM_NAME Darwin CACHE STRING "")
60-
# set(BUILTINS_${target}_CMAKE_BUILD_TYPE Release CACHE STRING "")
61-
# set(RUNTIMES_${target}_COMPILER_RT_BUILD_BUILTINS NO CACHE BOOL "")
62-
# set(BUILTINS_${target}_COMPILER_RT_BUILD_CRT NO CACHE BOOL "")
63-
# set(BUILTINS_${target}_COMPILER_RT_BUILD_LIBFUZZER NO CACHE BOOL "")
64-
# set(BUILTINS_${target}_COMPILER_RT_BUILD_PROFILE YES CACHE BOOL "")
65-
# set(BUILTINS_${target}_COMPILER_RT_BUILD_SANITIZERS NO CACHE BOOL "")
66-
# set(BUILTINS_${target}_COMPILER_RT_BUILD_XRAY NO CACHE BOOL "")
67-
# endforeach()
68-
69-
set(CMAKE_MACOSX_RPATH ON CACHE BOOL "")
70-
set(LLVM_ENABLE_MODULES OFF CACHE BOOL "")
37+
set(CMAKE_MACOSX_RPATH YES CACHE BOOL "")
7138

7239
set(LLVM_TARGETS_TO_BUILD AArch64 ARM WebAssembly X86 CACHE STRING "")
7340

Darwin-x86_64.cmake

Lines changed: 5 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# test args
2-
3-
set(LLVM_LIT_ARGS "--xunit-xml-output=testresults.xunit.xml -v" CACHE STRING "")
4-
51
set(LLVM_ENABLE_PROJECTS
62
clang
73
clang-tools-extra
@@ -19,12 +15,11 @@ set(LLVM_ENABLE_RUNTIMES
1915
CACHE STRING "")
2016

2117
# This forces libc++ to be built so disable it.
22-
set(LLDB_INCLUDE_TESTS OFF CACHE BOOL "")
18+
set(LLDB_INCLUDE_TESTS NO CACHE BOOL "")
2319

24-
# Compiler-RT configuration for macOS. For some reason, enabling `compiler-rt` in
25-
# `LLVM_ENABLE_RUNTIMES` is not enough.
26-
set(LLVM_BUILD_EXTERNAL_COMPILER_RT ON CACHE BOOL "Build Compiler-RT with just-built clang")
27-
set(COMPILER_RT_ENABLE_IOS ON CACHE BOOL "Build iOS Compiler-RT libraries")
20+
# Compiler-RT configuration for macOS.
21+
set(LLVM_BUILD_EXTERNAL_COMPILER_RT YES CACHE BOOL "Build Compiler-RT with just-built clang")
22+
set(COMPILER_RT_ENABLE_IOS YES CACHE BOOL "Build iOS Compiler-RT libraries")
2823

2924
# NOTE(compnerd) always enable assertions, the toolchain will not provide enough
3025
# context to resolve issues otherwise and may silently generate invalid output.
@@ -39,35 +34,7 @@ set(LLVM_DEFAULT_TARGET_TRIPLE x86_64-apple-darwin CACHE STRING "")
3934
set(LLVM_APPEND_VC_REV NO CACHE BOOL "")
4035
set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR YES CACHE BOOL "")
4136
set(LLVM_ENABLE_PYTHON YES CACHE BOOL "")
42-
43-
set(CMAKE_CXX_SCAN_FOR_MODULES OFF CACHE BOOL "")
44-
45-
# Setting any of the stuff below causes issues with configure (?).
46-
# set(LLVM_BUILTIN_TARGETS
47-
# aarch64-apple-darwin x86_64-apple-darwin
48-
# CACHE STRING "")
49-
50-
# The runtime targets are used to build the compiler-rt profile library.
51-
# set(LLVM_RUNTIME_TARGETS
52-
# aarch64-apple-darwin x86_64-apple-darwin
53-
# CACHE STRING "")
54-
55-
# foreach(target ${LLVM_RUNTIME_TARGETS})
56-
# set(BUILTINS_${target}_LLVM_ENABLE_RUNTIMES
57-
# compiler-rt
58-
# CACHE STRING "")
59-
# set(BUILTINS_${target}_CMAKE_SYSTEM_NAME Darwin CACHE STRING "")
60-
# set(BUILTINS_${target}_CMAKE_BUILD_TYPE Release CACHE STRING "")
61-
# set(RUNTIMES_${target}_COMPILER_RT_BUILD_BUILTINS NO CACHE BOOL "")
62-
# set(BUILTINS_${target}_COMPILER_RT_BUILD_CRT NO CACHE BOOL "")
63-
# set(BUILTINS_${target}_COMPILER_RT_BUILD_LIBFUZZER NO CACHE BOOL "")
64-
# set(BUILTINS_${target}_COMPILER_RT_BUILD_PROFILE YES CACHE BOOL "")
65-
# set(BUILTINS_${target}_COMPILER_RT_BUILD_SANITIZERS NO CACHE BOOL "")
66-
# set(BUILTINS_${target}_COMPILER_RT_BUILD_XRAY NO CACHE BOOL "")
67-
# endforeach()
68-
69-
set(CMAKE_MACOSX_RPATH ON CACHE BOOL "")
70-
set(LLVM_ENABLE_MODULES OFF CACHE BOOL "")
37+
set(CMAKE_MACOSX_RPATH YES CACHE BOOL "")
7138

7239
set(LLVM_TARGETS_TO_BUILD AArch64 ARM WebAssembly X86 CACHE STRING "")
7340

0 commit comments

Comments
 (0)