Skip to content

Commit a2a496f

Browse files
committed
Approach 3
1 parent c16cad3 commit a2a496f

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

flang-rt/cmake/modules/AddFlangRT.cmake

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -190,22 +190,11 @@ function (add_flangrt_library name)
190190
endif ()
191191
endif ()
192192

193-
# Must use minimum optimization level of -O2 to prevent dependency on libstdc++
194-
foreach (tgtname IN LISTS srctargets)
195-
string(REPLACE "-O0" "-O2" CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS)
196-
string(REPLACE "-O1" "-O2" CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS)
197-
string(FIND "-O" CMAKE_CXX_FLAGS opt_idx)
198-
if (opt_idx EQUAL -1)
199-
target_compile_options(${tgtname} PRIVATE -O2)
200-
endif ()
201-
endforeach ()
202-
203193
foreach (tgtname IN LISTS libtargets)
204194
if (NOT WIN32)
205195
# Use same stem name for .a and .so. Common in UNIX environments.
206196
# Not possible in Windows environments.
207197
set_target_properties(${tgtname} PROPERTIES OUTPUT_NAME "${name}")
208-
209198
endif ()
210199

211200
if (ARG_INSTALL_WITH_TOOLCHAIN)

flang/include/flang/Common/variant.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ using cuda::std::variant_size_v;
2424
using cuda::std::visit;
2525
} // namespace std
2626
#else // !RT_USE_LIBCUDACXX
27+
#include <initializer_list>
28+
#undef _GLIBCXX_THROW_OR_ABORT
29+
#define _GLIBCXX_THROW_OR_ABORT(_EXC) (__builtin_abort())
2730
#include <variant>
2831
#endif // !RT_USE_LIBCUDACXX
2932

0 commit comments

Comments
 (0)