[Openmp-commits] [flang] [llvm] [openmp] [Flang-RT] Fix GCC 15.1 Fortran Runtime libstdc++ Undefined Symbols (PR #157385)

via Openmp-commits openmp-commits at lists.llvm.org
Mon Oct 6 09:28:32 PDT 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions h -- flang/include/flang/Common/variant.h
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/flang/include/flang/Common/variant.h b/flang/include/flang/Common/variant.h
index 9c0a529d6..5808d070d 100644
--- a/flang/include/flang/Common/variant.h
+++ b/flang/include/flang/Common/variant.h
@@ -29,7 +29,16 @@ using cuda::std::visit;
 // directly and which defines a macro we need to redefine.
 #include <initializer_list>
 
-// The macro _GLIBCXX_THROW_OR_ABORT is used by libstdc++ to not throw exceptions in -fno-exceptions mode, but immediatly kill the program. Since libstdc++ 15.1 the macro uses (void)(_EXC) after calling abort() to silence compiler warnings of an parameter. In its use in <variant>, _EXC is the construction of `std::bad_variant_access`. In non-optimized builds, some compilers including Clang will emit a call to that constructor. The constructor is implemented in libstdc++.a/.so which Flang-RT must not depend on (to avoid compatibility problems if a Fortran application itself has parts implemented in C++). Note that _GLIBCXX_THROW_OR_ABORT is not on the list of libstdc++'s documented user-configurable macros.
+// The macro _GLIBCXX_THROW_OR_ABORT is used by libstdc++ to not throw
+// exceptions in -fno-exceptions mode, but immediatly kill the program. Since
+// libstdc++ 15.1 the macro uses (void)(_EXC) after calling abort() to silence
+// compiler warnings of an parameter. In its use in <variant>, _EXC is the
+// construction of `std::bad_variant_access`. In non-optimized builds, some
+// compilers including Clang will emit a call to that constructor. The
+// constructor is implemented in libstdc++.a/.so which Flang-RT must not depend
+// on (to avoid compatibility problems if a Fortran application itself has parts
+// implemented in C++). Note that _GLIBCXX_THROW_OR_ABORT is not on the list of
+// libstdc++'s documented user-configurable macros.
 #undef _GLIBCXX_THROW_OR_ABORT
 #define _GLIBCXX_THROW_OR_ABORT(_EXC) (__builtin_abort())
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/157385


More information about the Openmp-commits mailing list