[lld] 04fc67b - [lld][flang] Add exceptions for Flang runtime libraries on MinGW.

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 9 03:16:57 PST 2023


Author: Martin Storsjö
Date: 2023-03-09T13:16:12+02:00
New Revision: 04fc67bf08daef5031f78c4a52a069ff29cff099

URL: https://github.com/llvm/llvm-project/commit/04fc67bf08daef5031f78c4a52a069ff29cff099
DIFF: https://github.com/llvm/llvm-project/commit/04fc67bf08daef5031f78c4a52a069ff29cff099.diff

LOG: [lld][flang] Add exceptions for Flang runtime libraries on MinGW.

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.

Reviewed By: mstorsjo

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

Added: 
    

Modified: 
    lld/COFF/MinGW.cpp

Removed: 
    


################################################################################
diff  --git a/lld/COFF/MinGW.cpp b/lld/COFF/MinGW.cpp
index 1212569285678..2b403635b478e 100644
--- a/lld/COFF/MinGW.cpp
+++ b/lld/COFF/MinGW.cpp
@@ -49,6 +49,9 @@ AutoExporter::AutoExporter(
       "libclang_rt.profile-x86_64",
       "libc++",
       "libc++abi",
+      "libFortran_main",
+      "libFortranRuntime",
+      "libFortranDecimal",
       "libunwind",
       "libmsvcrt",
       "libucrtbase",


        


More information about the llvm-commits mailing list