[all-commits] [llvm/llvm-project] 734175: [Flang-RT] Environment introspection for quadmath....

Michael Kruse via All-commits all-commits at lists.llvm.org
Tue Mar 11 06:18:27 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7341753a2e23360c84d4ae195c3778b735193253
      https://github.com/llvm/llvm-project/commit/7341753a2e23360c84d4ae195c3778b735193253
  Author: Michael Kruse <llvm-project at meinersbur.de>
  Date:   2025-03-11 (Tue, 11 Mar 2025)

  Changed paths:
    M flang-rt/CMakeLists.txt
    A flang-rt/cmake/clang_gcc_root.cpp
    A flang-rt/cmake/quadmath_wrapper.h.in
    M flang-rt/lib/quadmath/CMakeLists.txt
    M flang-rt/lib/quadmath/complex-math.h
    M flang-rt/lib/quadmath/math-entries.h

  Log Message:
  -----------
  [Flang-RT] Environment introspection for quadmath.h (#130411)

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.



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