Skip to content

Commit 1e074af

Browse files
committed
fix(llvm-21): rename FortranCommon→FortranSupport, move runtime to flang-rt
LLVM 21 reorganized Flang: - flang/lib/Common → flang/lib/Support (lib FortranCommon → FortranSupport) - flang/runtime → flang-rt subproject (built via LLVM_ENABLE_RUNTIMES) Add LLVM_VER >= 21 branch to LLVM_RUNTIMES (adds flang-rt) and to FLANG_TARGETS (uses install-FortranSupport, drops install-FortranRuntime since install-runtimes aggregate now handles flang-rt). Backwards compatible: LLVM 20 path unchanged. Verified all 27 explicit ninja targets resolve in LLVM 21 via configure-only probe build (cmake -GNinja, then ninja -t query for each target).
1 parent f913a5c commit 1e074af

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

Dockerfile

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,11 @@ set -euo pipefail
108108

109109
# Configure the build
110110
# LLVM >= 20: openmp moved from PROJECTS to RUNTIMES (hard error in LLVM 21)
111-
if [ "${LLVM_VER}" -ge 20 ]; then
111+
# LLVM >= 21: flang/runtime split into flang-rt subproject; build via RUNTIMES
112+
if [ "${LLVM_VER}" -ge 21 ]; then
113+
LLVM_PROJECTS="flang;clang;clang-tools-extra;mlir"
114+
LLVM_RUNTIMES="compiler-rt;openmp;flang-rt"
115+
elif [ "${LLVM_VER}" -ge 20 ]; then
112116
LLVM_PROJECTS="flang;clang;clang-tools-extra;mlir"
113117
LLVM_RUNTIMES="compiler-rt;openmp"
114118
else
@@ -147,9 +151,16 @@ set -euo pipefail
147151
tools/flang/install
148152
install-flang-libraries install-flang-headers "$FLANG_BIN_TARGET" install-flang-cmake-exports
149153
install-flangFrontend install-flangFrontendTool
150-
install-FortranCommon install-FortranDecimal install-FortranEvaluate install-FortranLower
151-
install-FortranParser install-FortranRuntime install-FortranSemantics
154+
install-FortranDecimal install-FortranEvaluate install-FortranLower
155+
install-FortranParser install-FortranSemantics
152156
)
157+
# LLVM >= 21 renamed FortranCommon -> FortranSupport, and FortranRuntime moved
158+
# to the flang-rt subproject (built via install-runtimes).
159+
if [ "${LLVM_VER}" -ge 21 ]; then
160+
FLANG_TARGETS+=(install-FortranSupport)
161+
else
162+
FLANG_TARGETS+=(install-FortranCommon install-FortranRuntime)
163+
fi
153164

154165
# Use install-runtimes (aggregate target) because individual runtime install
155166
# targets (e.g. install-omp) aren't forwarded from the ExternalProject sub-build.

0 commit comments

Comments
 (0)