[all-commits] [llvm/llvm-project] 98e118: [Flang] Don't use FortranDecimal for runtime (#121...

Michael Kruse via All-commits all-commits at lists.llvm.org
Fri Feb 7 02:43:58 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 98e118ca435d280ff1c3540eb5e9b4140b44a1b4
      https://github.com/llvm/llvm-project/commit/98e118ca435d280ff1c3540eb5e9b4140b44a1b4
  Author: Michael Kruse <llvm-project at meinersbur.de>
  Date:   2025-02-07 (Fri, 07 Feb 2025)

  Changed paths:
    M clang/lib/Driver/ToolChains/CommonArgs.cpp
    M clang/lib/Driver/ToolChains/Flang.cpp
    M flang/docs/FlangDriver.md
    M flang/lib/Decimal/CMakeLists.txt
    M flang/runtime/CMakeLists.txt
    M flang/test/Driver/linker-flags.f90
    M flang/test/Driver/msvc-dependent-lib-flags.f90
    M flang/test/Driver/nostdlib.f90
    M flang/test/Runtime/no-cpp-dep.c
    M flang/test/lit.cfg.py
    M lld/COFF/MinGW.cpp

  Log Message:
  -----------
  [Flang] Don't use FortranDecimal for runtime (#121997)

Avoid using the same library for runtime and compiler. `FortranDecimal`
was used in two ways:

1. As an auxiliary library needed for `libFortranRuntime.a`. This patch
adds the two source files of FortranDecimal directly into
FortranRuntime, so `FortranRuntime` is not used anymore.
 
2. As a library used by the Flang compiler. As the only remaining use of
the library, extra CMake code to make it compatible with the runtime can
be removed.

Before this PR, `enable_cuda_compilation` is applied to `FortranDecimal`
which causes everything that links to it, including flang (the
compiler), to depend on libcudart when CUDA support is enabled.

Having two runtime library just makes everything more complicated while
the user ideally should not be concerned with how the runtime is
structured internally. Some logic was copied for FortranDecimal because
of this, such as the ability to be compiled out-of tree
(b75a3c9f31c1ffdc9856aee32991d8129b372ee7) which is undocumented, the
logic to link against the various versions of Microsofts runtime library
(#70833), and avoiding dependency on the C++ runtime
(7783bba22c7add678d796741d30669c73159b3d8).



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