-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[flang] Add runtimes using --dependent-lib on MSVC targets #72519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add some comments to clarify the difference between:
Related to this, I think that renaming:
would really help.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the new file (msvc-dependent-lib-flags.f90) just tests this specific feature; I can probably just put that in the other linker flags file but that's getting rather big anyway and doesn't necessarily need yet more run lines added to it!
Additionally these aren't really linker flags, they're not passed to the link line explicitly by the driver but as directives in the object files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From your explanation it is clear that these files test completely different (though related) things. I would keep them separate (i agree that "linker-flags.f90" is getting long and complex).
So, is this checking the frontend driver invocation?
? That might help make the distinction clear (the other file checks the linker invocation).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, these are checking the invocation of the frontend driver
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit] Could you add
MSVC: flang-new -fc1
in there then? I feel that that part is quite important.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've had to add it as just
-fc1
because of the way lit does argument passing on Windows (it puts the "flang-new" and "-fc1" in quotes, but only sometimes :))