mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 10:36:42 +00:00

When compiling Flang-RT with Clang, query Clang for the GCC installation it uses. If found, create `quadmath_wrapper.h` that points to the `quadmath.h` of that GCC installation. `quadmath.h` is only available when compiling with gcc, and Clang has no equivalent even though gcc's version compiles fine with Clang (at least up to and including gcc 13). It is still available into gcc's installation resource dir (in constrast to a system-wide indirectory such as `/usr/include` or `/usr/local/include`) and therefore not available to any compiler other than the gcc of that installation. quadmath may also be a different OS package than gcc itself, so it is not necessarily presesent. Clang actually already appropriates a GCC installation for its libraries such that `libquadmath.a` is already found, but it does not do so for the include paths. Because adding that directory to the header search path may have wide-reaching consquences, we create only a wrapper header that points to the real `quadmath.h` in the same GCC installation that Clang uses.