Skip to content

Commit

Permalink
workflows/release-binaries: Enable flang builds on Windows (#101344)
Browse files Browse the repository at this point in the history
Flang for Windows depends on compiler-rt, so we need to enable it for
the stage1 builds. This also fixes failures building the flang tests on
macOS.

Fixes #100202.
  • Loading branch information
tstellar authored Aug 29, 2024
1 parent 3a5c578 commit 8927576
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/release-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,16 +135,8 @@ jobs:
target_cmake_flags="$target_cmake_flags -DBOOTSTRAP_DARWIN_osx_ARCHS=$arches -DBOOTSTRAP_DARWIN_osx_BUILTIN_ARCHS=$arches"
fi
# x86 macOS and x86 Windows have trouble building flang, so disable it.
# Windows: https://github.com/llvm/llvm-project/issues/100202
# macOS: 'rebase opcodes terminated early at offset 1 of 80016' when building __fortran_builtins.mod
build_flang="true"
if [ "$target" = "Windows-X64" ]; then
target_cmake_flags="$target_cmake_flags -DLLVM_RELEASE_ENABLE_PROJECTS=\"clang;lld;lldb;clang-tools-extra;bolt;polly;mlir\""
build_flang="false"
fi
if [ "${{ runner.os }}" = "Windows" ]; then
# The build times out on Windows, so we need to disable LTO.
target_cmake_flags="$target_cmake_flags -DLLVM_RELEASE_ENABLE_LTO=OFF"
Expand Down
7 changes: 5 additions & 2 deletions clang/cmake/caches/Release.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,14 @@ set(LLVM_TARGETS_TO_BUILD Native CACHE STRING "")
set(CLANG_ENABLE_BOOTSTRAP ON CACHE BOOL "")

set(STAGE1_PROJECTS "clang")
set(STAGE1_RUNTIMES "")

# Building Flang on Windows requires compiler-rt, so we need to build it in
# stage1. compiler-rt is also required for building the Flang tests on
# macOS.
set(STAGE1_RUNTIMES "compiler-rt")

if (LLVM_RELEASE_ENABLE_PGO)
list(APPEND STAGE1_PROJECTS "lld")
list(APPEND STAGE1_RUNTIMES "compiler-rt")
set(CLANG_BOOTSTRAP_TARGETS
generate-profdata
stage2-package
Expand Down

0 comments on commit 8927576

Please sign in to comment.