[Flang] Rename libFortranRuntime.a to libflang_rt.runtime.a (#122341)

Following the conclusion of the
[RFC](https://discourse.llvm.org/t/rfc-names-for-flang-rt-libraries/84321),
rename Flang's runtime libraries as follows:

 * libFortranRuntime.(a|so) to libflang_rt.runtime.(a|so)
 * libFortranFloat128Math.a to libflang_rt.quadmath.a
* libCufRuntime_cuda_${CUDAToolkit_VERSION_MAJOR}.(a|so) to
libflang_rt.cuda_${CUDAToolkit_VERSION_MAJOR}.(a|so)

This follows the same naming scheme as Compiler-RT libraries
(`libclang_rt.${component}.(a|so)`). It provides some consistency
between Flang's runtime libraries for current and potential future
library components.
This commit is contained in:
Michael Kruse 2025-02-08 18:02:54 +01:00 committed by GitHub
parent 40ce8fd843
commit 5c8c2b3db5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
29 changed files with 128 additions and 96 deletions

View File

@ -1321,7 +1321,7 @@ void tools::addOpenMPHostOffloadingArgs(const Compilation &C,
/// Add Fortran runtime libs
void tools::addFortranRuntimeLibs(const ToolChain &TC, const ArgList &Args,
llvm::opt::ArgStringList &CmdArgs) {
// Link FortranRuntime
// Link flang_rt.runtime
// These are handled earlier on Windows by telling the frontend driver to
// add the correct libraries to link against as dependents in the object
// file.
@ -1330,14 +1330,14 @@ void tools::addFortranRuntimeLibs(const ToolChain &TC, const ArgList &Args,
F128LibName.consume_front_insensitive("lib");
if (!F128LibName.empty()) {
bool AsNeeded = !TC.getTriple().isOSAIX();
CmdArgs.push_back("-lFortranFloat128Math");
CmdArgs.push_back("-lflang_rt.quadmath");
if (AsNeeded)
addAsNeededOption(TC, Args, CmdArgs, /*as_needed=*/true);
CmdArgs.push_back(Args.MakeArgString("-l" + F128LibName));
if (AsNeeded)
addAsNeededOption(TC, Args, CmdArgs, /*as_needed=*/false);
}
CmdArgs.push_back("-lFortranRuntime");
CmdArgs.push_back("-lflang_rt.runtime");
addArchSpecificRPath(TC, Args, CmdArgs);
// needs libexecinfo for backtrace functions

View File

@ -346,11 +346,15 @@ static void processVSRuntimeLibrary(const ToolChain &TC, const ArgList &Args,
ArgStringList &CmdArgs) {
assert(TC.getTriple().isKnownWindowsMSVCEnvironment() &&
"can only add VS runtime library on Windows!");
// if -fno-fortran-main has been passed, skip linking Fortran_main.a
if (TC.getTriple().isKnownWindowsMSVCEnvironment()) {
CmdArgs.push_back(Args.MakeArgString(
"--dependent-lib=" + TC.getCompilerRTBasename(Args, "builtins")));
}
// Flang/Clang (including clang-cl) -compiled programs targeting the MSVC ABI
// should only depend on msv(u)crt. LLVM still emits libgcc/compiler-rt
// functions in some cases like 128-bit integer math (__udivti3, __modti3,
// __fixsfti, __floattidf, ...) that msvc does not support. We are injecting a
// dependency to Compiler-RT's builtin library where these are implemented.
CmdArgs.push_back(Args.MakeArgString(
"--dependent-lib=" + TC.getCompilerRTBasename(Args, "builtins")));
unsigned RTOptionID = options::OPT__SLASH_MT;
if (auto *rtl = Args.getLastArg(options::OPT_fms_runtime_lib_EQ)) {
RTOptionID = llvm::StringSwitch<unsigned>(rtl->getValue())
@ -364,26 +368,26 @@ static void processVSRuntimeLibrary(const ToolChain &TC, const ArgList &Args,
case options::OPT__SLASH_MT:
CmdArgs.push_back("-D_MT");
CmdArgs.push_back("--dependent-lib=libcmt");
CmdArgs.push_back("--dependent-lib=FortranRuntime.static.lib");
CmdArgs.push_back("--dependent-lib=flang_rt.runtime.static.lib");
break;
case options::OPT__SLASH_MTd:
CmdArgs.push_back("-D_MT");
CmdArgs.push_back("-D_DEBUG");
CmdArgs.push_back("--dependent-lib=libcmtd");
CmdArgs.push_back("--dependent-lib=FortranRuntime.static_dbg.lib");
CmdArgs.push_back("--dependent-lib=flang_rt.runtime.static_dbg.lib");
break;
case options::OPT__SLASH_MD:
CmdArgs.push_back("-D_MT");
CmdArgs.push_back("-D_DLL");
CmdArgs.push_back("--dependent-lib=msvcrt");
CmdArgs.push_back("--dependent-lib=FortranRuntime.dynamic.lib");
CmdArgs.push_back("--dependent-lib=flang_rt.runtime.dynamic.lib");
break;
case options::OPT__SLASH_MDd:
CmdArgs.push_back("-D_MT");
CmdArgs.push_back("-D_DEBUG");
CmdArgs.push_back("-D_DLL");
CmdArgs.push_back("--dependent-lib=msvcrtd");
CmdArgs.push_back("--dependent-lib=FortranRuntime.dynamic_dbg.lib");
CmdArgs.push_back("--dependent-lib=flang_rt.runtime.dynamic_dbg.lib");
break;
}
}

View File

@ -301,7 +301,7 @@ set(FLANG_DEFAULT_LINKER "" CACHE STRING
"Default linker to use (linker name or absolute path, empty for platform default)")
set(FLANG_DEFAULT_RTLIB "" CACHE STRING
"Default Fortran runtime library to use (\"libFortranRuntime\"), leave empty for platform default.")
"Default Fortran runtime library to use (\"libflang_rt.runtime\"), leave empty for platform default.")
if (NOT(FLANG_DEFAULT_RTLIB STREQUAL ""))
message(WARNING "Resetting Flang's default runtime library to use platform default.")

View File

@ -57,7 +57,7 @@ function(add_flang_library name)
set(LIBTYPE SHARED)
elseif(ARG_STATIC)
# If BUILD_SHARED_LIBS and ARG_STATIC are both set, llvm_add_library prioritizes STATIC.
# This is required behavior for libFortranFloat128Math.
# This is required behavior for libflang_rt.quadmath.
set(LIBTYPE STATIC)
else()
# Let llvm_add_library decide, taking BUILD_SHARED_LIBS into account.

View File

@ -175,18 +175,18 @@ like this:
```
$ flang -v -o example example.o
"/usr/bin/ld" [...] example.o [...] "-lFortranRuntime" [...]
"/usr/bin/ld" [...] example.o [...] "-lflang_rt.runtime" [...]
```
The automatically added libraries are:
* `FortranRuntime`: Provides most of the Flang runtime library.
* `flang_rt.runtime`: Provides most of the Flang runtime library.
If the code is C/C++ based and invokes Fortran routines, one can either use Clang
or Flang as the linker driver. If Clang is used, it will automatically all
required runtime libraries needed by C++ (e.g., for STL) to the linker invocation.
In this case, one has to explicitly provide the Fortran runtime library
`FortranRuntime`. An alternative is to use Flang to link.
`flang_rt.runtime`. An alternative is to use Flang to link.
In this case, it may be required to explicitly supply C++ runtime libraries.
On Darwin, the logical root where the system libraries are located (sysroot)

View File

@ -216,7 +216,7 @@ cmake \
-DCMAKE_CUDA_COMPILER=clang \
-DCMAKE_CUDA_HOST_COMPILER=clang++ \
../runtime/
make -j FortranRuntime
make -j flang-rt
```
Note that the used version of `clang` must [support](https://releases.llvm.org/16.0.0/tools/clang/docs/ReleaseNotes.html#cuda-support)
@ -239,7 +239,7 @@ cmake \
-DCMAKE_CUDA_HOST_COMPILER=clang++ \
../runtime/
make -j FortranRuntime
make -j flang-rt
```
Note that `nvcc` might limit support to certain
@ -294,7 +294,7 @@ cmake \
-DFLANG_OMP_DEVICE_ARCHITECTURES="all" \
../runtime/
make -j FortranRuntime
make -j flang-rt
```
The result of the build is a "device-only" library, i.e. the host
@ -309,7 +309,7 @@ The same set of CMake variables works for Flang in-tree build.
One may provide optional CMake variables to customize the build. Available options:
* `-DFLANG_RUNTIME_F128_MATH_LIB=libquadmath`: enables build of
`FortranFloat128Math` library that provides `REAL(16)` math APIs
`flang_rt.quadmath` library that provides `REAL(16)` math APIs
for intrinsics such as `SIN`, `COS`, etc. GCC `libquadmath`'s header file
`quadmath.h` must be available to the build compiler.
[More details](Real16MathSupport.md).

View File

@ -427,7 +427,7 @@ The implementation's behavior may be described as (OpenACC 2.7.2):
All the "is-present" checks and the data actions for the auxiliary pointers must be performed atomically with regards to the present counters bookkeeping.
The API relies on the primitives provided by `liboffload`, so it is provided by a new F18 runtime library, e.g. `FortranOffloadRuntime`, that depends on `FortranRuntime` and `liboffload`. The F18 driver adds `FortranOffloadRuntime` for linking under `-fopenacc`/`-fopenmp` (and maybe additional switches like `-fopenmp-targets`).
The API relies on the primitives provided by `liboffload`, so it is provided by a new F18 runtime library, e.g. `FortranOffloadRuntime`, that depends on `flang_rt.runtime` and `liboffload`. The F18 driver adds `FortranOffloadRuntime` for linking under `-fopenacc`/`-fopenmp` (and maybe additional switches like `-fopenmp-targets`).
## TODOs:

View File

@ -12,9 +12,9 @@ To support most `REAL(16)` (i.e. 128-bit float) math intrinsics Flang relies
on third-party libraries providing the implementation.
`-DFLANG_RUNTIME_F128_MATH_LIB=libquadmath` CMake option can be used
to build `FortranFloat128Math` library that has unresolved references
to build `libflang_rt.quadmath` library that has unresolved references
to GCC `libquadmath` library. A Flang driver built with this option
will automatically link `FortranFloat128Math` and `libquadmath` libraries
will automatically link `libflang_rt.quadmath` and `libquadmath` libraries
to any Fortran program. This implies that `libquadmath` library
has to be available in the standard library paths, so that linker
can find it. The `libquadmath` library installation into Flang project

View File

@ -36,6 +36,13 @@ page](https://llvm.org/releases/).
## Build System Changes
* The FortranRuntime library has been renamed to `flang_rt.runtime`.
* The FortranFloat128Math library has been renamed to `flang_rt.quadmath`.
* The CufRuntime_cuda_${version} library has been renamed to
`flang_rt.cuda_${version}`.
## New Issues Found

View File

@ -5,5 +5,5 @@ add_llvm_example(external-hello-world
target_link_libraries(external-hello-world
PRIVATE
FortranRuntime
flang_rt.runtime
)

View File

@ -809,8 +809,8 @@ prettyPrintIntrinsicName(fir::FirOpBuilder &builder, mlir::Location loc,
// Generate a call to the Fortran runtime library providing
// support for 128-bit float math.
// On 'HAS_LDBL128' targets the implementation
// is provided by FortranRuntime, otherwise, it is done via
// FortranFloat128Math library. In the latter case the compiler
// is provided by flang_rt, otherwise, it is done via the
// libflang_rt.quadmath library. In the latter case the compiler
// has to be built with FLANG_RUNTIME_F128_MATH_LIB to guarantee
// proper linking actions in the driver.
static mlir::Value genLibF128Call(fir::FirOpBuilder &builder,

View File

@ -241,13 +241,13 @@ set(supported_files
utf.cpp
)
enable_cuda_compilation(FortranRuntime "${supported_files}")
enable_cuda_compilation(flang_rt "${supported_files}")
enable_omp_offload_compilation("${supported_files}")
if (NOT TARGET FortranFloat128Math)
# If FortranFloat128Math is not defined, then we are not building
# standalone FortranFloat128Math library. Instead, include
# the relevant sources into FortranRuntime itself.
if (NOT TARGET flang_rt.quadmath)
# If flang_rt.quadmath is not defined, then we are not building
# standalone flang_rt.quadmath library. Instead, include
# the relevant sources into flang_rt.runtime itself.
# The information is provided via FortranFloat128MathILib
# interface library.
get_target_property(f128_sources
@ -275,7 +275,7 @@ if (NOT TARGET FortranFloat128Math)
endif()
if (NOT DEFINED MSVC)
add_flang_library(FortranRuntime
add_flang_library(flang_rt.runtime
${sources}
LINK_LIBS
${linked_libraries}
@ -283,33 +283,36 @@ if (NOT DEFINED MSVC)
INSTALL_WITH_TOOLCHAIN
)
else()
add_flang_library(FortranRuntime
add_flang_library(flang_rt.runtime
${sources}
LINK_LIBS
${linked_libraries}
)
set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded)
add_flang_library(FortranRuntime.static ${sources}
add_flang_library(flang_rt.runtime.static ${sources}
INSTALL_WITH_TOOLCHAIN)
set_target_properties(FortranRuntime.static PROPERTIES FOLDER "Flang/Runtime Libraries")
set_target_properties(flang_rt.runtime.static PROPERTIES FOLDER "Flang/Runtime Libraries")
set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreadedDLL)
add_flang_library(FortranRuntime.dynamic ${sources}
add_flang_library(flang_rt.runtime.dynamic ${sources}
INSTALL_WITH_TOOLCHAIN)
set_target_properties(FortranRuntime.dynamic PROPERTIES FOLDER "Flang/Runtime Libraries")
set_target_properties(flang_rt.runtime.dynamic PROPERTIES FOLDER "Flang/Runtime Libraries")
set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreadedDebug)
add_flang_library(FortranRuntime.static_dbg ${sources}
add_flang_library(flang_rt.runtime.static_dbg ${sources}
INSTALL_WITH_TOOLCHAIN)
set_target_properties(FortranRuntime.static_dbg PROPERTIES FOLDER "Flang/Runtime Libraries")
set_target_properties(flang_rt.runtime.static_dbg PROPERTIES FOLDER "Flang/Runtime Libraries")
set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreadedDebugDLL)
add_flang_library(FortranRuntime.dynamic_dbg ${sources}
add_flang_library(flang_rt.runtime.dynamic_dbg ${sources}
INSTALL_WITH_TOOLCHAIN)
set_target_properties(FortranRuntime.dynamic_dbg PROPERTIES FOLDER "Flang/Runtime Libraries")
add_dependencies(FortranRuntime FortranRuntime.static FortranRuntime.dynamic
FortranRuntime.static_dbg FortranRuntime.dynamic_dbg)
set_target_properties(flang_rt.runtime.dynamic_dbg PROPERTIES FOLDER "Flang/Runtime Libraries")
add_dependencies(flang_rt.runtime
flang_rt.runtime.static
flang_rt.runtime.dynamic
flang_rt.runtime.static_dbg
flang_rt.runtime.dynamic_dbg)
endif()
set_target_properties(FortranRuntime PROPERTIES FOLDER "Flang/Runtime Libraries")
set_target_properties(flang_rt.runtime PROPERTIES FOLDER "Flang/Runtime Libraries")
# If FortranRuntime is part of a Flang build (and not a separate build) then
# If flang_rt is part of a Flang build (and not a separate build) then
# add dependency to make sure that Fortran runtime library is being built after
# we have the Flang compiler available. This also includes the MODULE files
# that compile when the 'flang' target is built.
@ -317,9 +320,21 @@ set_target_properties(FortranRuntime PROPERTIES FOLDER "Flang/Runtime Libraries"
# TODO: This is a workaround and should be updated when runtime build procedure
# is changed to a regular runtime build. See discussion in PR #95388.
if (TARGET flang AND TARGET module_files)
add_dependencies(FortranRuntime flang module_files)
add_dependencies(flang_rt.runtime flang module_files)
endif()
if (FLANG_CUF_RUNTIME)
add_subdirectory(CUDA)
endif()
# Compatibility targets.
add_custom_target(flang-rt)
add_dependencies(flang-rt flang_rt.runtime)
if (TARGET flang_rt.quadmath)
add_dependencies(flang-rt flang_rt.quadmath)
endif ()
if (TARGET flang_rt.cuda_${CUDAToolkit_VERSION_MAJOR})
add_dependencies(flang-rt flang_rt.cuda_${CUDAToolkit_VERSION_MAJOR})
endif ()
add_custom_target(FortranRuntime)
add_dependencies(FortranRuntime flang_rt.runtime)

View File

@ -8,10 +8,10 @@
include_directories(${CUDAToolkit_INCLUDE_DIRS})
# libCufRuntime depends on a certain version of CUDA. To be able to have
# libflang_rt.cuda depends on a certain version of CUDA. To be able to have
# multiple build of this library with different CUDA version, the version is
# added to the library name.
set(CUFRT_LIBNAME CufRuntime_cuda_${CUDAToolkit_VERSION_MAJOR})
set(CUFRT_LIBNAME flang_rt.cuda_${CUDAToolkit_VERSION_MAJOR})
add_flang_library(${CUFRT_LIBNAME}
allocator.cpp
@ -33,6 +33,6 @@ endif()
target_link_libraries(${CUFRT_LIBNAME}
PRIVATE
FortranRuntime
flang_rt.runtime
${CUDA_RT_TARGET}
)

View File

@ -12,7 +12,7 @@
# It is distributed as a static library only.
# Fortran programs/libraries that end up linking any of the provided
# will have a dependency on the third-party library that is being
# used for building this FortranFloat128Math library.
# used for building this flang_rt.quadmath library.
include(CheckLibraryExists)
@ -93,20 +93,20 @@ if (FLANG_RUNTIME_F128_MATH_LIB)
)
endif()
add_flang_library(FortranFloat128Math STATIC INSTALL_WITH_TOOLCHAIN
add_flang_library(flang_rt.quadmath STATIC INSTALL_WITH_TOOLCHAIN
${sources})
if (DEFINED MSVC)
set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded)
add_flang_library(FortranFloat128Math.static STATIC INSTALL_WITH_TOOLCHAIN
add_flang_library(flang_rt.quadmath.static STATIC INSTALL_WITH_TOOLCHAIN
${sources}
)
set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreadedDebug)
add_flang_library(FortranFloat128Math.static_dbg STATIC INSTALL_WITH_TOOLCHAIN
add_flang_library(flang_rt.quadmath.static_dbg STATIC INSTALL_WITH_TOOLCHAIN
${sources}
)
add_dependencies(FortranFloat128Math FortranFloat128Math.static
FortranFloat128Math.static_dbg
add_dependencies(flang_rt.quadmath flang_rt.quadmath.static
flang_rt.quadmath.static_dbg
)
endif()
elseif (HAVE_LDBL_MANT_DIG_113)
@ -118,7 +118,7 @@ elseif (HAVE_LDBL_MANT_DIG_113)
)
target_sources(FortranFloat128MathILib INTERFACE ${sources})
else()
message(FATAL_ERROR "FortranRuntime cannot build without libm")
message(FATAL_ERROR "flang_rt.quadmath cannot build without libm")
endif()
else()
# We can use '__float128' version from libc, if it has them.

View File

@ -62,7 +62,7 @@ template <typename Unused = void> double GetCpuTime(fallback_implementation) {
#if defined __MINGW32__
// clock_gettime is implemented in the pthread library for MinGW.
// Using it here would mean that all programs that link libFortranRuntime are
// Using it here would mean that all programs that link libflang_rt are
// required to also link to pthread. Instead, don't use the function.
#undef CLOCKID_CPU_TIME
#undef CLOCKID_ELAPSED_TIME

View File

@ -348,7 +348,7 @@ inline RT_API_ATTRS RESULT ApplyFloatingPointKind(
if constexpr (HasCppTypeFor<TypeCategory::Real, 16>) {
// If FUNC implemenation relies on FP math functions,
// then we should not be here. The compiler should have
// generated a call to an entry in FortranFloat128Math
// generated a call to an entry in flang_rt.quadmath
// library.
if constexpr (!NEEDSMATH) {
return FUNC<16>{}(std::forward<A>(x)...);

View File

@ -75,7 +75,7 @@ set(FLANG_TEST_DEPENDS
)
if (FLANG_INCLUDE_RUNTIME)
list(APPEND FLANG_TEST_DEPENDS FortranRuntime)
list(APPEND FLANG_TEST_DEPENDS flang_rt.runtime)
endif ()
if (LLVM_ENABLE_PLUGINS AND NOT WIN32)
@ -124,3 +124,9 @@ if (DEFINED FLANG_TEST_TARGET_TRIPLE)
"to use FLANG_TEST_TARGET_TRIPLE.")
endif()
endif()
# Compatibility targets.
if (FLANG_INCLUDE_RUNTIME)
add_custom_target(check-flang-rt)
add_dependencies(check-flang-rt check-flang)
endif ()

View File

@ -1,5 +1,5 @@
!! Test that --gcc-toolchain and --gcc-install-dir options are working as expected.
!! It does not test cross-compiling (--sysroot), so crtbegin.o, libgcc/compiler-rt, libc, libFortranRuntime, etc. are not supposed to be affected.
!! It does not test cross-compiling (--sysroot), so crtbegin.o, libgcc/compiler-rt, libc, libflang_rt.runtime, etc. are not supposed to be affected.
!! PREFIX is captured twice because the driver escapes backslashes (occuring in Windows paths) in the -### output, but not on the "Selected GCC installation:" line.
! RUN: %flang 2>&1 -### -v -o %t %s -no-integrated-as -fuse-ld=ld --target=i386-unknown-linux-gnu --gcc-install-dir=%S/Inputs/basic_cross_linux_tree/usr/lib/gcc/i386-unknown-linux-gnu/10.2.0 | FileCheck %s --check-prefix=CHECK-I386

View File

@ -29,37 +29,37 @@
! executable and may find the GNU linker from MinGW or Cygwin.
! UNIX-LABEL: "{{.*}}ld{{(\.exe)?}}"
! UNIX-SAME: "[[object_file]]"
! UNIX-F128NONE-NOT: FortranFloat128Math
! SOLARIS-F128NONE-NOT: FortranFloat128Math
! UNIX-F128LIBQUADMATH-SAME: "-lFortranFloat128Math" "--as-needed" "-lquadmath" "--no-as-needed"
! SOLARIS-F128LIBQUADMATH-SAME: "-lFortranFloat128Math" "-z" "ignore" "-lquadmath" "-z" "record"
! UNIX-SAME: "-lFortranRuntime" "-lm"
! UNIX-F128NONE-NOT: lang_rt.quadmath
! SOLARIS-F128NONE-NOT: flang_rt.quadmath
! UNIX-F128LIBQUADMATH-SAME: "-lflang_rt.quadmath" "--as-needed" "-lquadmath" "--no-as-needed"
! SOLARIS-F128LIBQUADMATH-SAME: "-lflang_rt.quadmath" "-z" "ignore" "-lquadmath" "-z" "record"
! UNIX-SAME: "-lflang_rt.runtime" "-lm"
! COMPILER-RT: "{{.*}}{{\\|/}}libclang_rt.builtins.a"
! BSD-LABEL: "{{.*}}ld{{(\.exe)?}}"
! BSD-SAME: "[[object_file]]"
! BSD-F128NONE-NOT: FortranFloat128Math
! BSD-F128LIBQUADMATH-SAME: "-lFortranFloat128Math" "--as-needed" "-lquadmath" "--no-as-needed"
! BSD-SAME: -lFortranRuntime
! BSD-F128NONE-NOT: flang_rt.quadmath
! BSD-F128LIBQUADMATH-SAME: "-lflang_rt.quadmath" "--as-needed" "-lquadmath" "--no-as-needed"
! BSD-SAME: -lflang_rt.runtime
! BSD-SAME: -lexecinfo
! DARWIN-LABEL: "{{.*}}ld{{(\.exe)?}}"
! DARWIN-SAME: "[[object_file]]"
! DARWIN-F128NONE-NOT: FortranFloat128Math
! DARWIN-F128LIBQUADMATH-SAME: "-lFortranFloat128Math" "--as-needed" "-lquadmath" "--no-as-needed"
! DARWIN-SAME: -lFortranRuntime
! DARWIN-F128NONE-NOT: libflang_rt.quadmath
! DARWIN-F128LIBQUADMATH-SAME: "-lflang_rt.quadmath" "--as-needed" "-lquadmath" "--no-as-needed"
! DARWIN-SAME: -lflang_rt.runtime
! HAIKU-LABEL: "{{.*}}ld{{(\.exe)?}}"
! HAIKU-SAME: "[[object_file]]"
! HAIKU-F128NONE-NOT: FortranFloat128Math
! HAIKU-F128LIBQUADMATH-SAME: "-lFortranFloat128Math" "--as-needed" "-lquadmath" "--no-as-needed"
! HAIKU-SAME: "-lFortranRuntime"
! HAIKU-F128NONE-NOT: libflang_rt.quadmath
! HAIKU-F128LIBQUADMATH-SAME: "-lflang_rt.quadmath" "--as-needed" "-lquadmath" "--no-as-needed"
! HAIKU-SAME: "-lflang_rt.runtime"
! MINGW-LABEL: "{{.*}}ld{{(\.exe)?}}"
! MINGW-SAME: "[[object_file]]"
! MINGW-F128NONE-NOT: FortranFloat128Math
! MINGW-F128LIBQUADMATH-SAME: "-lFortranFloat128Math" "--as-needed" "-lquadmath" "--no-as-needed"
! MINGW-SAME: -lFortranRuntime
! MINGW-F128NONE-NOT: libflang_rt.quadmath
! MINGW-F128LIBQUADMATH-SAME: "-lflang_rt.quadmath" "--as-needed" "-lquadmath" "--no-as-needed"
! MINGW-SAME: -lflang_rt.runtime
! NOTE: This also matches lld-link (when CLANG_DEFAULT_LINKER=lld) and
! any .exe suffix that is added when resolving to the full path of

View File

@ -7,21 +7,21 @@
! MSVC-SAME: --dependent-lib=clang_rt.builtins.lib
! MSVC-SAME: -D_MT
! MSVC-SAME: --dependent-lib=libcmt
! MSVC-SAME: --dependent-lib=FortranRuntime.static.lib
! MSVC-SAME: --dependent-lib=flang_rt.runtime.static.lib
! MSVC-DEBUG: -fc1
! MSVC-DEBUG-SAME: --dependent-lib=clang_rt.builtins.lib
! MSVC-DEBUG-SAME: -D_MT
! MSVC-DEBUG-SAME: -D_DEBUG
! MSVC-DEBUG-SAME: --dependent-lib=libcmtd
! MSVC-DEBUG-SAME: --dependent-lib=FortranRuntime.static_dbg.lib
! MSVC-DEBUG-SAME: --dependent-lib=flang_rt.runtime.static_dbg.lib
! MSVC-DLL: -fc1
! MSVC-DLL-SAME: --dependent-lib=clang_rt.builtins.lib
! MSVC-DLL-SAME: -D_MT
! MSVC-DLL-SAME: -D_DLL
! MSVC-DLL-SAME: --dependent-lib=msvcrt
! MSVC-DLL-SAME: --dependent-lib=FortranRuntime.dynamic.lib
! MSVC-DLL-SAME: --dependent-lib=flang_rt.runtime.dynamic.lib
! MSVC-DLL-DEBUG: -fc1
! MSVC-DLL-DEBUG-SAME: --dependent-lib=clang_rt.builtins.lib
@ -29,4 +29,4 @@
! MSVC-DLL-DEBUG-SAME: -D_DEBUG
! MSVC-DLL-DEBUG-SAME: -D_DLL
! MSVC-DLL-DEBUG-SAME: --dependent-lib=msvcrtd
! MSVC-DLL-DEBUG-SAME: --dependent-lib=FortranRuntime.dynamic_dbg.lib
! MSVC-DLL-DEBUG-SAME: --dependent-lib=flang_rt.runtime.dynamic_dbg.lib

View File

@ -24,5 +24,5 @@
! in certain cases. But it is not clear that it is worth checking for each
! platform individually.
! CHECK-NOT: "-lFortranRuntime"
! CHECK-NOT: "-lflang_rt.runtime"
! CHECK-NOT: "-lgcc"

View File

@ -1,6 +1,6 @@
/*
This test makes sure that flang's runtime does not depend on the C++ runtime
library. It tries to link this simple file against libFortranRuntime.a with
library. It tries to link this simple file against libflang_rt.runtime.a with
a C compiler.
REQUIRES: c-compiler, flang-rt

View File

@ -170,7 +170,7 @@ if config.flang_include_runtime:
# the C++ runtime libraries. For this we need a C compiler. If for some reason
# we don't have one, we can just disable the test.
if config.flang_include_runtime and config.cc:
libruntime = os.path.join(config.flang_lib_dir, "libFortranRuntime.a")
libruntime = os.path.join(config.flang_lib_dir, "libflang_rt.runtime.a")
include = os.path.join(config.flang_src_dir, "include")
if (

View File

@ -5,7 +5,7 @@ set(LLVM_LINK_COMPONENTS
)
# Define the list of Fortran module files that need to be compiled
# to produce an object file for inclusion into the FortranRuntime
# to produce an object file for inclusion into the flang_rt.runtime
# library.
set(MODULES_WITH_IMPLEMENTATION
"iso_fortran_env_impl"
@ -105,7 +105,7 @@ if (NOT CMAKE_CROSSCOMPILING)
endif()
# Some modules have an implementation part that needs to be added to the
# FortranRuntime library.
# flang_rt.runtime library.
set(compile_with "-fsyntax-only")
set(object_output "")
set(include_in_link FALSE)
@ -127,14 +127,14 @@ if (NOT CMAKE_CROSSCOMPILING)
install(FILES ${base}.mod DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/flang")
# If a module has been compiled into an object file, add the file to
# the link line for the FortranRuntime library.
# the link line for the flang_rt.runtime library.
if(include_in_link)
list(APPEND module_objects ${object_output})
endif()
endforeach()
# Set a CACHE variable that is visible to the CMakeLists.txt in runtime/, so that
# the compiled Fortran modules can be added to the link line of the FortranRuntime
# the compiled Fortran modules can be added to the link line of the flang_rt.runtime
# library.
set(FORTRAN_MODULE_OBJECTS ${module_objects} CACHE INTERNAL "" FORCE)

View File

@ -2,7 +2,7 @@ include(AddFlangOffloadRuntime)
if (FLANG_EXPERIMENTAL_CUDA_RUNTIME)
# If Fortran runtime is built as CUDA library, the linking
# of targets that link FortranRuntime must be done
# of targets that link flang_rt.runtime must be done
# with CUDA_RESOLVE_DEVICE_SYMBOLS.
# CUDA language must be enabled for CUDA_RESOLVE_DEVICE_SYMBOLS
# to take effect.

View File

@ -60,14 +60,14 @@ if (FLANG_INCLUDE_RUNTIME)
NonGTestTesting
FortranSemantics
FortranEvaluate
FortranRuntime
flang_rt.runtime
)
add_flang_nongtest_unittest(ISO-Fortran-binding
NonGTestTesting
FortranEvaluate
FortranSemantics
FortranRuntime
flang_rt.runtime
)
endif ()

View File

@ -33,7 +33,7 @@ add_flang_unittest(FlangRuntimeTests
target_link_libraries(FlangRuntimeTests
PRIVATE
FortranRuntime
flang_rt.runtime
)
target_compile_definitions(FlangRuntimeTests PRIVATE NOT_EXE="$<TARGET_FILE:not>")

View File

@ -15,8 +15,8 @@ endif()
target_link_libraries(FlangCufRuntimeTests
PRIVATE
${CUDA_RT_TARGET}
CufRuntime_cuda_${CUDAToolkit_VERSION_MAJOR}
FortranRuntime
flang_rt.cuda_${CUDAToolkit_VERSION_MAJOR}
flang_rt.runtime
)
target_include_directories(FlangCufRuntimeTests PRIVATE ${CUDAToolkit_INCLUDE_DIRS})

View File

@ -49,7 +49,7 @@ AutoExporter::AutoExporter(
"libclang_rt.profile-x86_64",
"libc++",
"libc++abi",
"libFortranRuntime",
"libflang_rt.runtime",
"libunwind",
"libmsvcrt",
"libucrtbase",