Skip to content

release/19.x: workflows/release-binaries: Enable flang builds on Windows (#101344) #106480

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 1 commit into from
Sep 24, 2024

Conversation

llvmbot
Copy link
Member

@llvmbot llvmbot commented Aug 29, 2024

Backport 8927576

Requested by: @tstellar

@llvmbot llvmbot added this to the LLVM 19.X Release milestone Aug 29, 2024
@llvmbot
Copy link
Member Author

llvmbot commented Aug 29, 2024

@tstellar What do you think about merging this PR to the release branch?

@llvmbot llvmbot requested a review from tstellar August 29, 2024 01:28
@llvmbot llvmbot added clang Clang issues not falling into any other category github:workflow labels Aug 29, 2024
@llvmbot
Copy link
Member Author

llvmbot commented Aug 29, 2024

@llvm/pr-subscribers-github-workflow

@llvm/pr-subscribers-clang

Author: None (llvmbot)

Changes

Backport 8927576

Requested by: @tstellar


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

2 Files Affected:

  • (modified) .github/workflows/release-binaries.yml (-8)
  • (modified) clang/cmake/caches/Release.cmake (+5-2)
diff --git a/.github/workflows/release-binaries.yml b/.github/workflows/release-binaries.yml
index 509016e5b89c45..672dd7517d23ce 100644
--- a/.github/workflows/release-binaries.yml
+++ b/.github/workflows/release-binaries.yml
@@ -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"
diff --git a/clang/cmake/caches/Release.cmake b/clang/cmake/caches/Release.cmake
index e5161dd9a27b96..6d5f75ca0074ee 100644
--- a/clang/cmake/caches/Release.cmake
+++ b/clang/cmake/caches/Release.cmake
@@ -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

@tru
Copy link
Collaborator

tru commented Sep 3, 2024

@tstellar several of the builds fail even after a rebase. Some of them seem related (especially the macOS ones, so I won't merge this until you had some time to look at it.

@tru
Copy link
Collaborator

tru commented Sep 10, 2024

ping @tstellar

@tstellar
Copy link
Collaborator

I think we should merge this. The mac builds tend to be inconsistent, we may need to move them to the paid runners, but at least this will fix the Windows builds.

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 llvm#100202.

(cherry picked from commit 8927576)
@tru tru merged commit c011dce into llvm:release/19.x Sep 24, 2024
4 of 11 checks passed
Copy link

@tstellar (or anyone else). If you would like to add a note about this fix in the release notes (completely optional). Please reply to this comment with a one or two sentence description of the fix. When you are done, please add the release:note label to this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang Clang issues not falling into any other category github:workflow
Projects
Development

Successfully merging this pull request may close these issues.

3 participants