Skip to content

Commit 22ed7eb

Browse files
committed
FortranRuntime -> flang_rt
1 parent c77098f commit 22ed7eb

27 files changed

+97
-60
lines changed

clang/lib/Driver/ToolChains/CommonArgs.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,7 +1317,7 @@ void tools::addOpenMPHostOffloadingArgs(const Compilation &C,
13171317
/// Add Fortran runtime libs
13181318
void tools::addFortranRuntimeLibs(const ToolChain &TC, const ArgList &Args,
13191319
llvm::opt::ArgStringList &CmdArgs) {
1320-
// Link FortranRuntime
1320+
// Link flang_rt
13211321
// These are handled earlier on Windows by telling the frontend driver to
13221322
// add the correct libraries to link against as dependents in the object
13231323
// file.
@@ -1333,7 +1333,7 @@ void tools::addFortranRuntimeLibs(const ToolChain &TC, const ArgList &Args,
13331333
if (AsNeeded)
13341334
addAsNeededOption(TC, Args, CmdArgs, /*as_needed=*/false);
13351335
}
1336-
CmdArgs.push_back("-lFortranRuntime");
1336+
CmdArgs.push_back("-lflang_rt");
13371337
addArchSpecificRPath(TC, Args, CmdArgs);
13381338
}
13391339

clang/lib/Driver/ToolChains/Flang.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -356,26 +356,26 @@ static void processVSRuntimeLibrary(const ToolChain &TC, const ArgList &Args,
356356
case options::OPT__SLASH_MT:
357357
CmdArgs.push_back("-D_MT");
358358
CmdArgs.push_back("--dependent-lib=libcmt");
359-
CmdArgs.push_back("--dependent-lib=FortranRuntime.static.lib");
359+
CmdArgs.push_back("--dependent-lib=flang_rt.static.lib");
360360
break;
361361
case options::OPT__SLASH_MTd:
362362
CmdArgs.push_back("-D_MT");
363363
CmdArgs.push_back("-D_DEBUG");
364364
CmdArgs.push_back("--dependent-lib=libcmtd");
365-
CmdArgs.push_back("--dependent-lib=FortranRuntime.static_dbg.lib");
365+
CmdArgs.push_back("--dependent-lib=flang_rt.static_dbg.lib");
366366
break;
367367
case options::OPT__SLASH_MD:
368368
CmdArgs.push_back("-D_MT");
369369
CmdArgs.push_back("-D_DLL");
370370
CmdArgs.push_back("--dependent-lib=msvcrt");
371-
CmdArgs.push_back("--dependent-lib=FortranRuntime.dynamic.lib");
371+
CmdArgs.push_back("--dependent-lib=flang_rt.dynamic.lib");
372372
break;
373373
case options::OPT__SLASH_MDd:
374374
CmdArgs.push_back("-D_MT");
375375
CmdArgs.push_back("-D_DEBUG");
376376
CmdArgs.push_back("-D_DLL");
377377
CmdArgs.push_back("--dependent-lib=msvcrtd");
378-
CmdArgs.push_back("--dependent-lib=FortranRuntime.dynamic_dbg.lib");
378+
CmdArgs.push_back("--dependent-lib=flang_rt.dynamic_dbg.lib");
379379
break;
380380
}
381381
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#===-- unittests/Evaluate/CMakeLists.txt -----------------------------------===#
2+
#
3+
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
# See https://llvm.org/LICENSE.txt for license information.
5+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
#
7+
#===------------------------------------------------------------------------===#
8+
9+
add_flang_nongtest_unittest(reshape
10+
FortranEvaluateTesting
11+
FortranSemantics
12+
FortranEvaluate
13+
flang_rt
14+
)
15+
16+
add_flang_nongtest_unittest(ISO-Fortran-binding
17+
FortranEvaluateTesting
18+
FortranEvaluate
19+
FortranSemantics
20+
flang_rt
21+
)

flang/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ set(FLANG_DEFAULT_LINKER "" CACHE STRING
285285
"Default linker to use (linker name or absolute path, empty for platform default)")
286286

287287
set(FLANG_DEFAULT_RTLIB "" CACHE STRING
288-
"Default Fortran runtime library to use (\"libFortranRuntime\"), leave empty for platform default.")
288+
"Default Fortran runtime library to use (\"libflang_rt\"), leave empty for platform default.")
289289

290290
if (NOT(FLANG_DEFAULT_RTLIB STREQUAL ""))
291291
message(WARNING "Resetting Flang's default runtime library to use platform default.")

flang/docs/FlangDriver.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,18 +175,18 @@ like this:
175175

176176
```
177177
$ flang -v -o example example.o
178-
"/usr/bin/ld" [...] example.o [...] "-lFortranRuntime" [...]
178+
"/usr/bin/ld" [...] example.o [...] "-lflang_rt" [...]
179179
```
180180

181181
The automatically added libraries are:
182182

183-
* `FortranRuntime`: Provides most of the Flang runtime library.
183+
* `flang_rt`: Provides most of the Flang runtime library.
184184

185185
If the code is C/C++ based and invokes Fortran routines, one can either use Clang
186186
or Flang as the linker driver. If Clang is used, it will automatically all
187187
required runtime libraries needed by C++ (e.g., for STL) to the linker invocation.
188-
In this case, one has to explicitly provide the Fortran runtime libraries
189-
`FortranRuntime`. An alternative is to use Flang to link.
188+
In this case, one has to explicitly provide the Fortran runtime library
189+
`flang_rt`. An alternative is to use Flang to link.
190190
In this case, it may be required to explicitly supply C++ runtime libraries.
191191

192192
On Darwin, the logical root where the system libraries are located (sysroot)

flang/docs/GettingStarted.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ cmake \
216216
-DCMAKE_CUDA_COMPILER=clang \
217217
-DCMAKE_CUDA_HOST_COMPILER=clang++ \
218218
../runtime/
219-
make -j FortranRuntime
219+
make -j flang-rt
220220
```
221221

222222
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 \
239239
-DCMAKE_CUDA_HOST_COMPILER=clang++ \
240240
../runtime/
241241

242-
make -j FortranRuntime
242+
make -j flang-rt
243243
```
244244

245245
Note that `nvcc` might limit support to certain
@@ -294,7 +294,7 @@ cmake \
294294
-DFLANG_OMP_DEVICE_ARCHITECTURES="all" \
295295
../runtime/
296296

297-
make -j FortranRuntime
297+
make -j flang-rt
298298
```
299299

300300
The result of the build is a "device-only" library, i.e. the host

flang/docs/OpenACC-descriptor-management.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ The implementation's behavior may be described as (OpenACC 2.7.2):
427427
428428
All the "is-present" checks and the data actions for the auxiliary pointers must be performed atomically with regards to the present counters bookkeeping.
429429
430-
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`).
430+
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` and `liboffload`. The F18 driver adds `FortranOffloadRuntime` for linking under `-fopenacc`/`-fopenmp` (and maybe additional switches like `-fopenmp-targets`).
431431
432432
## TODOs:
433433

flang/docs/ReleaseNotes.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ page](https://llvm.org/releases/).
3636

3737
## Build System Changes
3838

39+
* FortranRuntime has been renamed to `flang_rt`.
40+
3941
## New Issues Found
4042

4143

flang/examples/ExternalHelloWorld/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ add_llvm_example(external-hello-world
55

66
target_link_libraries(external-hello-world
77
PRIVATE
8-
FortranRuntime
8+
flang_rt
99
)

flang/runtime/CMakeLists.txt

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -236,13 +236,13 @@ set(supported_files
236236
utf.cpp
237237
)
238238

239-
enable_cuda_compilation(FortranRuntime "${supported_files}")
239+
enable_cuda_compilation(flang_rt "${supported_files}")
240240
enable_omp_offload_compilation("${supported_files}")
241241

242242
if (NOT TARGET FortranFloat128Math)
243243
# If FortranFloat128Math is not defined, then we are not building
244244
# standalone FortranFloat128Math library. Instead, include
245-
# the relevant sources into FortranRuntime itself.
245+
# the relevant sources into flang_rt itself.
246246
# The information is provided via FortranFloat128MathILib
247247
# interface library.
248248
get_target_property(f128_sources
@@ -270,47 +270,53 @@ if (NOT TARGET FortranFloat128Math)
270270
endif()
271271

272272
if (NOT DEFINED MSVC)
273-
add_flang_library(FortranRuntime
273+
add_flang_library(flang_rt
274274
${sources}
275275

276276
INSTALL_WITH_TOOLCHAIN
277277
)
278278
else()
279-
add_flang_library(FortranRuntime
279+
add_flang_library(flang_rt
280280
${sources}
281281
)
282282
set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded)
283-
add_flang_library(FortranRuntime.static ${sources}
283+
add_flang_library(flang_rt.static ${sources}
284284
INSTALL_WITH_TOOLCHAIN)
285-
set_target_properties(FortranRuntime.static PROPERTIES FOLDER "Flang/Runtime Libraries")
285+
set_target_properties(flang_rt.static PROPERTIES FOLDER "Flang/Runtime Libraries")
286286
set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreadedDLL)
287-
add_flang_library(FortranRuntime.dynamic ${sources}
287+
add_flang_library(flang_rt.dynamic ${sources}
288288
INSTALL_WITH_TOOLCHAIN)
289-
set_target_properties(FortranRuntime.dynamic PROPERTIES FOLDER "Flang/Runtime Libraries")
289+
set_target_properties(flang_rt.dynamic PROPERTIES FOLDER "Flang/Runtime Libraries")
290290
set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreadedDebug)
291-
add_flang_library(FortranRuntime.static_dbg ${sources}
291+
add_flang_library(flang_rt.static_dbg ${sources}
292292
INSTALL_WITH_TOOLCHAIN)
293-
set_target_properties(FortranRuntime.static_dbg PROPERTIES FOLDER "Flang/Runtime Libraries")
293+
set_target_properties(flang_rt.static_dbg PROPERTIES FOLDER "Flang/Runtime Libraries")
294294
set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreadedDebugDLL)
295-
add_flang_library(FortranRuntime.dynamic_dbg ${sources}
295+
add_flang_library(flang_rt.dynamic_dbg ${sources}
296296
INSTALL_WITH_TOOLCHAIN)
297-
set_target_properties(FortranRuntime.dynamic_dbg PROPERTIES FOLDER "Flang/Runtime Libraries")
298-
add_dependencies(FortranRuntime FortranRuntime.static FortranRuntime.dynamic
299-
FortranRuntime.static_dbg FortranRuntime.dynamic_dbg)
297+
set_target_properties(flang_rt.dynamic_dbg PROPERTIES FOLDER "Flang/Runtime Libraries")
298+
add_dependencies(flang_rt flang_rt.static flang_rt.dynamic
299+
flang_rt.static_dbg flang_rt.dynamic_dbg)
300300
endif()
301-
set_target_properties(FortranRuntime PROPERTIES FOLDER "Flang/Runtime Libraries")
301+
set_target_properties(flang_rt PROPERTIES FOLDER "Flang/Runtime Libraries")
302302

303-
# If FortranRuntime is part of a Flang build (and not a separate build) then
303+
# If flang_rt is part of a Flang build (and not a separate build) then
304304
# add dependency to make sure that Fortran runtime library is being built after
305305
# we have the Flang compiler available. This also includes the MODULE files
306306
# that compile when the 'flang' target is built.
307307
#
308308
# TODO: This is a workaround and should be updated when runtime build procedure
309309
# is changed to a regular runtime build. See discussion in PR #95388.
310310
if (TARGET flang AND TARGET module_files)
311-
add_dependencies(FortranRuntime flang module_files)
311+
add_dependencies(flang_rt flang module_files)
312312
endif()
313313

314314
if (FLANG_CUF_RUNTIME)
315315
add_subdirectory(CUDA)
316316
endif()
317+
318+
# Compatibility targets.
319+
add_custom_target(flang-rt)
320+
add_dependencies(flang-rt flang_rt)
321+
add_custom_target(FortranRuntime)
322+
add_dependencies(FortranRuntime flang_rt)

0 commit comments

Comments
 (0)