[flang-commits] [flang] [flang][docs] Mention --driver-mode=flang in FlangDriver.md (PR #207659)
Yusuke MINATO via flang-commits
flang-commits at lists.llvm.org
Sun Jul 5 23:27:07 PDT 2026
https://github.com/yus3710-fj created https://github.com/llvm/llvm-project/pull/207659
This patch adds a description about the `--driver-mode=flang` flag.
The behavior will be ensured by #207658.
---
*The following should be removed before merge.*
### Background
The Fujitsu C/C++ compiler has a driver flag, `--linkfortran`, which instructs the driver to also link Fortran runtimes. I hope `--driver-mode=flang` can be the corresponding option.
```
$ fcc -c main.c; frt -c sub.f90
$ frt *.o
$ fcc *.o
/usr/lib64/crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
(.text+0x1c): undefined reference to `main'
(.text+0x20): undefined reference to `main'
(.text+0x24): undefined reference to `main'
sub.o: In function `func':
...
$ fcc --linkfortran *.o
$ ./a.out
ok
```
>From 67191c94f8d01ac1d4bcb6c52660f70b27c791bc Mon Sep 17 00:00:00 2001
From: Yusuke MINATO <minato.yusuke at fujitsu.com>
Date: Fri, 26 Jun 2026 13:06:44 +0900
Subject: [PATCH] [flang][docs] Mention --driver-mode=flang in FlangDriver.md
---
flang/docs/FlangDriver.md | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/flang/docs/FlangDriver.md b/flang/docs/FlangDriver.md
index 4edc99944ad44..7ce6de477a1fa 100644
--- a/flang/docs/FlangDriver.md
+++ b/flang/docs/FlangDriver.md
@@ -187,8 +187,9 @@ If the code is C/C++ based and invokes Fortran routines, one can either use Clan
or Flang as the linker driver. If Clang is used, it will automatically all
required runtime libraries needed by C++ (e.g., for STL) to the linker invocation.
In this case, one has to explicitly provide the Fortran runtime library
-`flang_rt.runtime`. An alternative is to use Flang to link.
-In this case, it may be required to explicitly supply C++ runtime libraries.
+`flang_rt.runtime`. An alternative is to use Flang (or Clang with the
+`--driver-mode=flang` flag) to link. In this case, it may be required to
+explicitly supply C++ runtime libraries.
On Darwin, the logical root where the system libraries are located (sysroot)
must be specified. This can be done with the CMake build flag `DEFAULT_SYSROOT`
More information about the flang-commits
mailing list