[flang-commits] [flang] [llvm] [flang] Use backend fp128 support to determine REAL(16) availability (PR #221907)

Shunsuke Watanabe via flang-commits flang-commits at lists.llvm.org
Thu Oct 8 01:26:36 PDT 2026


s-watanabe314 wrote:

Sorry for the delayed response. I have been looking into how to remove uses of `FLANG_RUNTIME_F128_MATH_LIB` and similar runtime build-time configuration symbols from Flang, as you suggested.

I understand and agree with the direction that `REAL(16)` availability should not depend on runtime library availability. However, I am still unsure what would replace `FLANG_RUNTIME_F128_MATH_LIB` in the current driver link logic after it is removed from Flang. This information is also used by the driver to determine link dependencies. The value is set here:

https://github.com/llvm/llvm-project/blob/66cc20a0b4356d2b5d2278e68bfe5b16ad4e87dd/flang/tools/flang-driver/driver.cpp#L165-L167

and consumed here:

https://github.com/llvm/llvm-project/blob/66cc20a0b4356d2b5d2278e68bfe5b16ad4e87dd/clang/lib/Driver/ToolChain.cpp#L981-L990

This effectively means selecting the dependency that accompanies `libflang_rt.quadmath` (currently `-lquadmath`; for example, a different implementation might instead require `-lm`).

I may be missing something here, but I am not currently seeing what would replace `FLANG_RUNTIME_F128_MATH_LIB` for driver link-library selection after all uses of the symbol are removed from Flang.

For example, is the intended direction that the driver would detect the presence of `libflang_rt.quadmath` and automatically add `-lflang_rt.quadmath` if it is found, while users would be responsible for specifying the corresponding external dependency such as `-lquadmath` or `-lm`?

https://github.com/llvm/llvm-project/pull/221907


More information about the flang-commits mailing list