Issue 182533
Summary [Flang] Driver is missing '--print-runtime-dir' (feature parity with Clang)
Labels clang, flang
Assignees
Reporter Acture
    The flang-new driver currently lacks support for the --print-runtime-dir introspection flag.

In the Clang ecosystem, build systems and compiler wrappers routinely rely on clang --print-runtime-dir to dynamically discover the location of target-specific runtime libraries (e.g., compiler-rt). This is especially critical on platforms with unique layout heuristics, such as Darwin (which uses lib/darwin instead of standard target triples).

While Flang successfully implements --print-resource-dir, it explicitly rejects --print-runtime-dir, creating a feature parity gap that forces external build systems to hardcode OS-specific paths to locate flang-rt.

# Steps to Reproduce
1. Clang supports the flag and outputs the runtime directory:

``` Bash
$ clang --print-runtime-dir
/usr/lib/llvm-21/lib/clang/21/lib/darwin  # (or target-triple on Linux)
```

2. Flang rejects the flag:

```Bash
$ flang-new --print-runtime-dir
flang-21: error: unknown argument: '--print-runtime-dir'
flang-21: error: no input files
```
(Note: Flang does support --print-resource-dir, but that only points to the base resource root, not the actual runtime library subdirectory).

# Expected Behavior
To maintain driver interface consistency and support agnostic build system integration, flang-new should implement --print-runtime-dir. It should output the fully qualified path to the Fortran runtime libraries (flang-rt), matching the behavioral contract of clang.

# Environment
OS: macOS / Linux
LLVM/Flang version: 21.0.0 (main)
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to