[clang] [llvm] workflows/release-binaries: Enable flang builds on Windows (PR #101344)

Tom Stellard via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 7 08:35:17 PDT 2024


https://github.com/tstellar updated https://github.com/llvm/llvm-project/pull/101344

>From a39c6d5e3decabab87ff9360851981123ff962d7 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Wed, 31 Jul 2024 07:36:48 -0700
Subject: [PATCH 1/3] workflows/release-binaries: Enable flang builds on
 Windows

This was fixed in 73d862e478738675f5d919c6a196429acd7b5f50.
---
 .github/workflows/release-binaries.yml | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/.github/workflows/release-binaries.yml b/.github/workflows/release-binaries.yml
index b1b046dbad5f8..2c6f4da8facd2 100644
--- a/.github/workflows/release-binaries.yml
+++ b/.github/workflows/release-binaries.yml
@@ -124,16 +124,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"

>From b09d31aa4f2b9dae1439ec553e4a969152db1287 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Tue, 6 Aug 2024 17:31:58 -0700
Subject: [PATCH 2/3] [CMake][Release] Always build compiler-rt in stage1

It looks like flang has a dependecy on compiler-rt.

Fixes #100202.
---
 clang/cmake/caches/Release.cmake | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/clang/cmake/caches/Release.cmake b/clang/cmake/caches/Release.cmake
index e5161dd9a27b9..b82b7aaf68652 100644
--- a/clang/cmake/caches/Release.cmake
+++ b/clang/cmake/caches/Release.cmake
@@ -47,11 +47,10 @@ set(LLVM_TARGETS_TO_BUILD Native CACHE STRING "")
 set(CLANG_ENABLE_BOOTSTRAP ON CACHE BOOL "")
 
 set(STAGE1_PROJECTS "clang")
-set(STAGE1_RUNTIMES "")
+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

>From 81f42350f0a3802703fa98a0ab2adf90a3db0038 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Wed, 7 Aug 2024 08:34:42 -0700
Subject: [PATCH 3/3] Fixup compiler-rt in Release cache

---
 clang/cmake/caches/Release.cmake | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/clang/cmake/caches/Release.cmake b/clang/cmake/caches/Release.cmake
index b82b7aaf68652..8c9ac04c9a220 100644
--- a/clang/cmake/caches/Release.cmake
+++ b/clang/cmake/caches/Release.cmake
@@ -47,10 +47,16 @@ set(LLVM_TARGETS_TO_BUILD Native CACHE STRING "")
 set(CLANG_ENABLE_BOOTSTRAP ON CACHE BOOL "")
 
 set(STAGE1_PROJECTS "clang")
+
+# Building Flang on Windows requires compiler-rt, so we need to build it in
+# stage1.
 set(STAGE1_RUNTIMES "compiler-rt")
 
 if (LLVM_RELEASE_ENABLE_PGO)
   list(APPEND STAGE1_PROJECTS "lld")
+  if (NOT "compiler-rt" IN_LIST STAGE1_RUNTIMES)
+    list(APPEND STAGE1_PROJECTS "compiler-rt")
+  endif()
   set(CLANG_BOOTSTRAP_TARGETS
     generate-profdata
     stage2-package



More information about the llvm-commits mailing list