[llvm] ecbd523 - Support: allow building with non-C/C++ language linkers (#65634)

via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 8 06:47:44 PDT 2023


Author: Saleem Abdulrasool
Date: 2023-09-08T06:47:40-07:00
New Revision: ecbd5230f75bdefb3bac6347b24e3b1185e4b8ef

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

LOG: Support: allow building with non-C/C++ language linkers (#65634)

Added: 
    

Modified: 
    llvm/lib/Support/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Support/CMakeLists.txt b/llvm/lib/Support/CMakeLists.txt
index 87fe7bebf688d4e..54baf159a86877c 100644
--- a/llvm/lib/Support/CMakeLists.txt
+++ b/llvm/lib/Support/CMakeLists.txt
@@ -79,7 +79,11 @@ endif( MSVC OR MINGW )
 # Delay load shell32.dll if possible to speed up process startup.
 set (delayload_flags)
 if (MSVC)
-  set (delayload_flags delayimp -delayload:shell32.dll -delayload:ole32.dll)
+  # When linking with Swift, `swiftc.exe` is used as the linker drive rather
+  # than invoking `link.exe` directly.  In such a case, the flags should be
+  # marked as `-Xlinker` to pass them directly to the linker.  As a temporary
+  # workaround simply elide the delay loading.
+  set (delayload_flags $<$<NOT:$<LINK_LANGUAGE:Swift>>:delayimp -delayload:shell32.dll -delayload:ole32.dll>)
 endif()
 
 # Link Z3 if the user wants to build it.


        


More information about the llvm-commits mailing list