-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[flang] Add dependent-lib option to flang -fc1 on Windows (#72121)
This patch adds a --dependent-lib option to flang -fc1 on Windows to embed library link options into the object file. This is needed to properly select the Windows CRT to link against.
- Loading branch information
1 parent
b6f5178
commit 77ecb9a
Showing
6 changed files
with
71 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
! REQUIRES aarch64-registered-target && x86-registered-target | ||
! DEFINE: %{triple} = | ||
! DEFINE: %{compile} = %flang_fc1 -emit-mlir -triple %{triple} --dependent-lib=libtest %s -o - 2>&1 | ||
! REDEFINE: %{triple} = aarch64-pc-windows-msvc | ||
! RUN: %{compile} | FileCheck %s | ||
! REDEFINE: %{triple} = x86_64-pc-windows-msvc | ||
! RUN: %{compile} | FileCheck %s | ||
! REDEFINE: %{triple} = x86_64-linux-unknown-gnu | ||
! RUN: not %{compile} | FileCheck %s --check-prefixes=CHECK-NOWIN | ||
! REDEFINE: %{triple} = aarch64-apple-darwin | ||
! RUN: not %{compile} | FileCheck %s --check-prefixes=CHECK-NOWIN | ||
|
||
! CHECK: llvm.linker_options ["/DEFAULTLIB:", "libtest"] | ||
program test | ||
end program test | ||
! CHECK-NOWIN: --dependent-lib is only supported on Windows |
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