-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[flang] Add runtimes using --dependent-lib on MSVC targets (#72519)
This patch uses the added --dependent-lib support to add the relevant runtimes on MSVC targets as `/DEFAULTLIB:` sections in the object file rather than on the link line. This should help CMake support for flang on Windows. Fixes #63741 Fixes #68017
- Loading branch information
1 parent
6727526
commit 0bc7cd4
Showing
15 changed files
with
112 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
! RUN: %flang -### --target=aarch64-windows-msvc %S/Inputs/hello.f90 -v 2>&1 | FileCheck %s --check-prefixes=MSVC | ||
! RUN: %flang -### --target=aarch64-windows-msvc -fms-runtime-lib=static_dbg %S/Inputs/hello.f90 -v 2>&1 | FileCheck %s --check-prefixes=MSVC-DEBUG | ||
! RUN: %flang -### --target=aarch64-windows-msvc -fms-runtime-lib=dll %S/Inputs/hello.f90 -v 2>&1 | FileCheck %s --check-prefixes=MSVC-DLL | ||
! RUN: %flang -### --target=aarch64-windows-msvc -fms-runtime-lib=dll_dbg %S/Inputs/hello.f90 -v 2>&1 | FileCheck %s --check-prefixes=MSVC-DLL-DEBUG | ||
|
||
! MSVC: -fc1 | ||
! MSVC-SAME: --dependent-lib=clang_rt.builtins-aarch64.lib | ||
! MSVC-SAME: -D_MT | ||
! MSVC-SAME: --dependent-lib=libcmt | ||
! MSVC-SAME: --dependent-lib=Fortran_main.static.lib | ||
! MSVC-SAME: --dependent-lib=FortranRuntime.static.lib | ||
! MSVC-SAME: --dependent-lib=FortranDecimal.static.lib | ||
|
||
! MSVC-DEBUG: -fc1 | ||
! MSVC-DEBUG-SAME: --dependent-lib=clang_rt.builtins-aarch64.lib | ||
! MSVC-DEBUG-SAME: -D_MT | ||
! MSVC-DEBUG-SAME: -D_DEBUG | ||
! MSVC-DEBUG-SAME: --dependent-lib=libcmtd | ||
! MSVC-DEBUG-SAME: --dependent-lib=Fortran_main.static_dbg.lib | ||
! MSVC-DEBUG-SAME: --dependent-lib=FortranRuntime.static_dbg.lib | ||
! MSVC-DEBUG-SAME: --dependent-lib=FortranDecimal.static_dbg.lib | ||
|
||
! MSVC-DLL: -fc1 | ||
! MSVC-DLL-SAME: --dependent-lib=clang_rt.builtins-aarch64.lib | ||
! MSVC-DLL-SAME: -D_MT | ||
! MSVC-DLL-SAME: -D_DLL | ||
! MSVC-DLL-SAME: --dependent-lib=msvcrt | ||
! MSVC-DLL-SAME: --dependent-lib=Fortran_main.dynamic.lib | ||
! MSVC-DLL-SAME: --dependent-lib=FortranRuntime.dynamic.lib | ||
! MSVC-DLL-SAME: --dependent-lib=FortranDecimal.dynamic.lib | ||
|
||
! MSVC-DLL-DEBUG: -fc1 | ||
! MSVC-DLL-DEBUG-SAME: --dependent-lib=clang_rt.builtins-aarch64.lib | ||
! MSVC-DLL-DEBUG-SAME: -D_MT | ||
! MSVC-DLL-DEBUG-SAME: -D_DEBUG | ||
! MSVC-DLL-DEBUG-SAME: -D_DLL | ||
! MSVC-DLL-DEBUG-SAME: --dependent-lib=msvcrtd | ||
! MSVC-DLL-DEBUG-SAME: --dependent-lib=Fortran_main.dynamic_dbg.lib | ||
! MSVC-DLL-DEBUG-SAME: --dependent-lib=FortranRuntime.dynamic_dbg.lib | ||
! MSVC-DLL-DEBUG-SAME: --dependent-lib=FortranDecimal.dynamic_dbg.lib |