Skip to content

Commit 3a80ca5

Browse files
committed
Compile and link ISO_FORTRAN_ENV
1 parent 933135e commit 3a80ca5

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

flang/module/iso_fortran_env.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module iso_fortran_env
2222
compiler_options => __builtin_compiler_options, &
2323
compiler_version => __builtin_compiler_version
2424

25-
use __fortran_builtin_kinds, only: &
25+
use iso_fortran_env_impl, only: &
2626
selectedInt8, selectedInt16, selectedInt32, selectedInt64, selectedInt128, &
2727
safeInt8, safeInt16, safeInt32, safeInt64, safeInt128, &
2828
int8, int16, int32, int64, int128, &

flang/module/__fortran_builtin_kinds.f90 renamed to flang/module/iso_fortran_env_impl.f90

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66
!
77
!===------------------------------------------------------------------------===!
88

9-
module __fortran_builtin_kinds
9+
! This MODULE implements part of the ISO_FORTRAN_ENV module file, which
10+
! partially requires linkable symbols for some entities defined
11+
! (e.g., real_kinds).
12+
13+
module iso_fortran_env_impl
1014
implicit none
1115
private
1216

@@ -107,4 +111,4 @@
107111
pack([real64x2], real64x2 >= 0), &
108112
pack([real128], real128 >= 0) &
109113
]
110-
end module __fortran_builtin_kinds
114+
end module iso_fortran_env_impl

flang/runtime/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ set(sources
169169
unit-map.cpp
170170
unit.cpp
171171
utf.cpp
172+
${FORTRAN_MODULE_OBJECTS}
172173
)
173174

174175
include(AddFlangOffloadRuntime)

flang/tools/f18/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ set(LLVM_LINK_COMPONENTS
88
# to produce an object file for inclusion into the FortranRuntime
99
# library.
1010
set(MODULES_WITH_IMPLEMENTATION
11-
"__fortran_builtin_kinds"
11+
"iso_fortran_env_impl"
1212
)
1313

1414
# Define the list of Fortran module files for which it is
@@ -57,7 +57,7 @@ if (NOT CMAKE_CROSSCOMPILING)
5757
set(depends ${depends} ${FLANG_INTRINSIC_MODULES_DIR}/__fortran_type_info.mod)
5858
endif()
5959
if(${filename} STREQUAL "iso_fortran_env")
60-
set(depends ${depends} ${FLANG_INTRINSIC_MODULES_DIR}/__fortran_builtin_kinds.mod)
60+
set(depends ${depends} ${FLANG_INTRINSIC_MODULES_DIR}/iso_fortran_env_impl.mod)
6161
endif()
6262
if(${filename} STREQUAL "ieee_arithmetic" OR
6363
${filename} STREQUAL "ieee_exceptions")
@@ -83,8 +83,8 @@ if (NOT CMAKE_CROSSCOMPILING)
8383
set(object_output "")
8484
set(include_in_link FALSE)
8585
if(${filename} IN_LIST MODULES_WITH_IMPLEMENTATION)
86-
set(compile_with "-c")
8786
set(object_output "${CMAKE_CURRENT_BINARY_DIR}/${filename}${CMAKE_CXX_OUTPUT_EXTENSION}")
87+
set(compile_with -c -o ${object_output})
8888
set(include_in_link TRUE)
8989
endif()
9090

0 commit comments

Comments
 (0)