Skip to content

Commit 9d34202

Browse files
committed
Merge branch 'users/meinersbur/flang_runtime' into users/meinersbur/flang_runtime_shared
2 parents 74f6a6d + a6b7618 commit 9d34202

File tree

9 files changed

+19
-7
lines changed

9 files changed

+19
-7
lines changed

flang-rt/CMakeLists.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ set(LLVM_TOOLS_DIR "${LLVM_BINARY_DIR}/bin")
8888
# Determine build and install paths.
8989
# The build path is absolute, but the install dir is relative, CMake's install
9090
# command has to apply CMAKE_INSTALL_PREFIX itself.
91+
get_toolchain_library_subdir(toolchain_lib_subdir)
9192
if (LLVM_TREE_AVAILABLE)
9293
# In a bootstrap build emit the libraries into a default search path in the
9394
# build directory of the just-built compiler. This allows using the
@@ -98,6 +99,8 @@ if (LLVM_TREE_AVAILABLE)
9899
include(GetClangResourceDir)
99100
get_clang_resource_dir(FLANG_RT_OUTPUT_RESOURCE_DIR PREFIX "${LLVM_LIBRARY_OUTPUT_INTDIR}/..")
100101
get_clang_resource_dir(FLANG_RT_INSTALL_RESOURCE_PATH)
102+
103+
extend_path(FLANG_RT_OUTPUT_RESOURCE_LIB_DIR "${FLANG_RT_OUTPUT_RESOURCE_DIR}" "${toolchain_lib_subdir}")
101104
else ()
102105
# In a standalone runtimes build, do not write into LLVM_BINARY_DIR. It may be
103106
# read-only and/or shared by multiple runtimes with different build
@@ -108,11 +111,12 @@ else ()
108111
# between bootstrap and standalone runtimes builds.
109112
set(FLANG_RT_OUTPUT_RESOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}")
110113
set(FLANG_RT_INSTALL_RESOURCE_PATH "${CMAKE_INSTALL_LIBDIR}/clang/${LLVM_VERSION_MAJOR}")
114+
115+
extend_path(FLANG_RT_OUTPUT_RESOURCE_LIB_DIR "${FLANG_RT_OUTPUT_RESOURCE_DIR}" "${CMAKE_INSTALL_LIBDIR}")
111116
endif ()
117+
extend_path(FLANG_RT_INSTALL_RESOURCE_LIB_PATH "${FLANG_RT_INSTALL_RESOURCE_PATH}" "${toolchain_lib_subdir}")
112118
cmake_path(NORMAL_PATH FLANG_RT_OUTPUT_RESOURCE_DIR)
113119
cmake_path(NORMAL_PATH FLANG_RT_INSTALL_RESOURCE_PATH)
114-
115-
# Determine subdirectories for build output and install destinations.
116120
# FIXME: For the libflang_rt.so, the toolchain resource lib dir is not a good
117121
# destination because it is not a ld.so default search path.
118122
# The machine where the executable is eventually executed may not be the
@@ -122,9 +126,6 @@ cmake_path(NORMAL_PATH FLANG_RT_INSTALL_RESOURCE_PATH)
122126
# But the linker as invoked by the Flang driver also requires
123127
# libflang_rt.so to be found when linking and the resource lib dir is
124128
# the only reliable location.
125-
get_toolchain_library_subdir(toolchain_lib_subdir)
126-
extend_path(FLANG_RT_OUTPUT_RESOURCE_LIB_DIR "${FLANG_RT_OUTPUT_RESOURCE_DIR}" "${toolchain_lib_subdir}")
127-
extend_path(FLANG_RT_INSTALL_RESOURCE_LIB_PATH "${FLANG_RT_INSTALL_RESOURCE_PATH}" "${toolchain_lib_subdir}")
128129
cmake_path(NORMAL_PATH FLANG_RT_OUTPUT_RESOURCE_LIB_DIR)
129130
cmake_path(NORMAL_PATH FLANG_RT_INSTALL_RESOURCE_LIB_PATH)
130131

flang-rt/lib/flang_rt/CUDA/allocatable.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include "flang/Runtime/CUDA/descriptor.h"
1616
#include "flang/Runtime/CUDA/memmove-function.h"
1717
#include "flang/Runtime/allocatable.h"
18+
#include "flang/Runtime/descriptor.h"
1819

1920
#include "cuda_runtime.h"
2021

flang-rt/lib/flang_rt/CUDA/allocator.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include "flang/Common/ISO_Fortran_binding_wrapper.h"
1616
#include "flang/Runtime/CUDA/common.h"
1717
#include "flang/Support/Fortran.h"
18+
#include "flang/Support/Fortran.h"
1819

1920
#include "cuda_runtime.h"
2021

flang-rt/unittests/Runtime/CUDA/Allocatable.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
#include "flang/Runtime/CUDA/common.h"
1616
#include "flang/Runtime/CUDA/descriptor.h"
1717
#include "flang/Support/Fortran.h"
18+
#include "flang/Runtime/descriptor.h"
19+
#include "flang/Runtime/memory.h"
20+
#include "flang/Support/Fortran.h"
1821

1922
#include "cuda_runtime.h"
2023

flang-rt/unittests/Runtime/CUDA/AllocatorCUF.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
#include "flang/Runtime/CUDA/descriptor.h"
1616
#include "flang/Runtime/allocatable.h"
1717
#include "flang/Support/Fortran.h"
18+
#include "flang/Runtime/descriptor.h"
19+
#include "flang/Runtime/memory.h"
20+
#include "flang/Support/Fortran.h"
1821

1922
using namespace Fortran::runtime;
2023
using namespace Fortran::runtime::cuda;

flang-rt/unittests/Runtime/CUDA/Memory.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "flang/Runtime/CUDA/descriptor.h"
1717
#include "flang/Runtime/allocatable.h"
1818
#include "flang/Support/Fortran.h"
19+
#include "flang/Support/Fortran.h"
1920

2021
#include "cuda_runtime.h"
2122

flang/lib/Optimizer/Builder/IntrinsicCall.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,7 @@ prettyPrintIntrinsicName(fir::FirOpBuilder &builder, mlir::Location loc,
778778
// Generate a call to the Fortran runtime library providing
779779
// support for 128-bit float math.
780780
// On 'HAS_LDBL128' targets the implementation
781-
// is provided by flang_rt, otherwise, it is done via
781+
// is provided by FortranRuntime, otherwise, it is done via
782782
// FortranFloat128Math library. In the latter case the compiler
783783
// has to be built with FLANG_RUNTIME_F128_MATH_LIB to guarantee
784784
// proper linking actions in the driver.

flang/tools/f18-parse-demo/f18-parse-demo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
// scaffolding compiler driver that can test some semantic passes of the
2222
// F18 compiler under development.
2323

24-
#include "flang/Support/Fortran-features.h"
2524
#include "flang/Parser/characters.h"
2625
#include "flang/Parser/dump-parse-tree.h"
2726
#include "flang/Parser/message.h"
@@ -30,6 +29,7 @@
3029
#include "flang/Parser/parsing.h"
3130
#include "flang/Parser/provenance.h"
3231
#include "flang/Parser/unparse.h"
32+
#include "flang/Support/Fortran-features.h"
3333
#include "flang/Support/default-kinds.h"
3434
#include "llvm/Support/Errno.h"
3535
#include "llvm/Support/FileSystem.h"

flang/unittests/Evaluate/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ set(LLVM_REQUIRES_RTTI ON)
6464
add_flang_nongtest_unittest(real
6565
FortranEvaluateTesting
6666
FortranEvaluate
67+
FortranCommon
68+
FortranSupport
6769
FortranSemantics
6870
)
6971
llvm_update_compile_flags(real.test)

0 commit comments

Comments
 (0)