Reapply [lld][flang] Add exceptions for Flang runtime libraries on MinGW.
authorMarkus Mützel <markus.muetzel@gmx.de>
Thu, 9 Mar 2023 10:55:53 +0000 (12:55 +0200)
committerMartin Storsjö <martin@martin.st>
Thu, 9 Mar 2023 11:19:22 +0000 (13:19 +0200)
When linking a shared library with Flang on MinGW, the functions from the
Flang runtime are exported from the shared library. When trying to link an
executable to that library using Flang, the linker errors out because the
functions from the runtime conflict with the functions exported from the
shared library.

Add the Flang runtime libraries to the list of libraries for which no
symbols are exported.

Reapplying the patch with the git author name corrected.

Reviewed By: mstorsjo

Differential Revision: https://reviews.llvm.org/D145389

lld/COFF/MinGW.cpp

index 1212569..2b40363 100644 (file)
@@ -49,6 +49,9 @@ AutoExporter::AutoExporter(
       "libclang_rt.profile-x86_64",
       "libc++",
       "libc++abi",
+      "libFortran_main",
+      "libFortranRuntime",
+      "libFortranDecimal",
       "libunwind",
       "libmsvcrt",
       "libucrtbase",