[all-commits] [llvm/llvm-project] 9ec748: [Flang] Search flang_rt in clang_rt path (#151954)
Michael Kruse via All-commits
all-commits at lists.llvm.org
Fri Aug 8 03:14:01 PDT 2025
Branch: refs/heads/release/21.x
Home: https://github.com/llvm/llvm-project
Commit: 9ec748cfb155e69a3a38edaf68f0d3ea4c4ccf09
https://github.com/llvm/llvm-project/commit/9ec748cfb155e69a3a38edaf68f0d3ea4c4ccf09
Author: Michael Kruse <llvm-project at meinersbur.de>
Date: 2025-08-08 (Fri, 08 Aug 2025)
Changed paths:
M clang/lib/Driver/ToolChain.cpp
Log Message:
-----------
[Flang] Search flang_rt in clang_rt path (#151954)
The clang/flang driver has two separate systems for find the location of
clang_rt (simplified):
* `getCompilerRTPath()`, e.g. `../lib/clang/22/lib/windows`,
used when `LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=0`
* `getRuntimePath()`, e.g. `../lib/clang/22/lib/x86_64-pc-windows-msvc`,
used when `LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=1`
To simplify the search path, Flang-RT normally assumes only
`getRuntimePath()`, i.e. ignoring `LLVM_ENABLE_PER_TARGET_RUNTIME_DIR`
and always using the `LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=1` mechanism.
There is an exception for Apple Darwin triples where `getRuntimePath()`
returns nothing. The flang-rt/compiler-rt CMake code for library
location also ignores `LLVM_ENABLE_PER_TARGET_RUNTIME_DIR` but uses the
`LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=0` path instead. Since only
`getRuntimePath()` is automatically added to the linker command line,
this patch explicitly adds `getCompilerRTPath()` to the path when
linking flang_rt.
Fixes #151031
(cherry picked from commit 8de481913353a1e37264687d5cc73db0de19e6cc)
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list