[PATCH] D126291: [flang][Driver] Update link job on windows

2022-06-10 Thread Markus Mützel via Phabricator via cfe-commits
mmuetzel added a comment. In D126291#3573607 , @mstorsjo wrote: > FWIW, something very similar was added just a couple days ago in an lldb > specific lit.cfg.py: https://reviews.llvm.org/D127048#change-KJ7QgKPHtN1S Thank you for pointing this out. Those

[PATCH] D126291: [flang][Driver] Update link job on windows

2022-06-10 Thread Markus Mützel via Phabricator via cfe-commits
mmuetzel added a comment. In D126291#3573751 , @mstorsjo wrote: > Maybe, but keep in mind that those kinds of tests should be the exception, > not the rule. > > As clang (and flang too, I would presume) generally can be cross compiling, > one shouldn't

[PATCH] D126291: [flang][Driver] Update link job on windows

2022-06-10 Thread Markus Mützel via Phabricator via cfe-commits
mmuetzel added inline comments. Comment at: clang/lib/Driver/ToolChains/Darwin.cpp:645 if (getToolChain().getDriver().IsFlangMode() && Args.hasArg(options::OPT_flang_experimental_exec)) { addFortranRuntimeLibraryPath(getToolChain(), Args, CmdArgs);

[PATCH] D126291: [flang][Driver] Update link job on windows

2022-06-11 Thread Markus Mützel via Phabricator via cfe-commits
mmuetzel added a comment. Possible alternative version of `linker-flags-windows.f90` that also tests MinGW and takes the feedback by @mstorsjo into account: ! Verify that the Fortran runtime libraries are present in the linker ! invocation. These libraries are added on top of other standard

[PATCH] D126291: [flang][Driver] Update link job on windows

2022-06-13 Thread Markus Mützel via Phabricator via cfe-commits
mmuetzel added inline comments. Comment at: flang/test/Driver/linker-flags-windows.f90:6 +! NOTE: The additional linker flags tested here are currently specified in +! clang/lib/Driver/Toolchains/MSVC.cpp. +! REQUIRES: windows-msvc mmuetzel wrote: > Since this te

[PATCH] D126291: [flang][Driver] Update link job on windows

2022-06-14 Thread Markus Mützel via Phabricator via cfe-commits
mmuetzel added inline comments. Comment at: flang/test/Driver/linker-flags.f90:51 +! MSVC-NOT: libcmt +! MSVC-NOT: oldnames +! MSVC-SAME: "[[object_file]]" Lines 50-51 seem to be duplicates of lines 44-45. Is this intentional? CHANGES SINCE LAST ACTION https:

[PATCH] D126291: [flang][Driver] Update link job on windows

2022-06-01 Thread Markus Mützel via Phabricator via cfe-commits
mmuetzel added a comment. Just wondering if those changes are correct for MinGW. Comment at: clang/lib/Driver/ToolChains/CommonArgs.cpp:753 + llvm::opt::ArgStringList &CmdArgs) { + if (TC.getTriple().isOSWindows()) { +CmdArgs.push_back("For

[PATCH] D126291: [flang][Driver] Update link job on windows

2022-06-03 Thread Markus Mützel via Phabricator via cfe-commits
mmuetzel added a comment. In D126291#356 , @rovka wrote: > - Update for MinGW. > - Add `/subsystem:console` to help `link.exe` understand what's going on. > > Thanks for all the comments. I don't have a MinGW environment readily > available for testi

[PATCH] D126291: [flang][Driver] Update link job on windows

2022-06-03 Thread Markus Mützel via Phabricator via cfe-commits
mmuetzel added a comment. I checked out the LLVM repository from https://github.com/llvm/llvm-project.git and applied your patch with `patch -Np0 -i D126291.433988.patch`. After some failing attempts, I finally found a configuration for which building succeeded. I struggled with duplicate symbo

[PATCH] D126291: [flang][Driver] Update link job on windows

2022-06-03 Thread Markus Mützel via Phabricator via cfe-commits
mmuetzel added a comment. Thank you for the suggestions. In the meantime, I added `-DLLVM_ENABLE_PROJECTS="clang;compiler-rt;mlir;flang;llvm" -DCOMPILER_RT_USE_BUILTINS_LIBRARY=ON` to the compiler flags which seems to have advanced a bit further. Now, I get the following when trying to compile

[PATCH] D126291: [flang][Driver] Update link job on windows

2022-06-03 Thread Markus Mützel via Phabricator via cfe-commits
mmuetzel added a comment. In D126291#3555848 , @awarzynski wrote: > Nice! > > In D126291#3555835 , @mmuetzel > wrote: > >> Is this still a configuration error? > > No :) Clearly the following `if` block from `to

[PATCH] D126291: [flang][Driver] Update link job on windows

2022-06-03 Thread Markus Mützel via Phabricator via cfe-commits
mmuetzel added a comment. I made this additional change: From 26cee469225e80ac9bae22ebb6e60d47373fc19d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=BCtzel?= Date: Fri, 3 Jun 2022 16:23:47 +0200 Subject: [PATCH] MinGW --- clang/lib/Driver/ToolChains/MinGW.cpp | 7 +++

[PATCH] D126291: [flang][Driver] Update link job on windows

2022-06-03 Thread Markus Mützel via Phabricator via cfe-commits
mmuetzel added a comment. In case you don't receive notifications on edits. (Please forgive the noise if you do.) After applying this additional patch: From d74a276679778b943b1e2e50f5dd45f65c530252 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=BCtzel?= Date: Fri, 3 Jun 2022 16:36

[PATCH] D126291: [flang][Driver] Update link job on windows

2022-06-03 Thread Markus Mützel via Phabricator via cfe-commits
mmuetzel added inline comments. Comment at: clang/lib/Driver/ToolChains/MSVC.cpp:140 +// defined in flang's runtime libraries. +if (TC.getTriple().isKnownWindowsMSVCEnvironment()) + CmdArgs.push_back("/subsystem:console"); Is the MSVC toolchain used

[PATCH] D126291: [flang][Driver] Update link job on windows

2022-06-03 Thread Markus Mützel via Phabricator via cfe-commits
mmuetzel added a comment. The error message I get without `-lc++`: ld.lld: error: undefined symbol: std::__1::mutex::lock() >>> referenced by libFortranRuntime.a(io-api.cpp.obj):(Fortran::runtime::io::IoStatementState* Fortran::runtime::io::BeginExternalListIO<(Fortran::runtime::io::Directi

[PATCH] D126291: [flang][Driver] Update link job on windows

2022-06-03 Thread Markus Mützel via Phabricator via cfe-commits
mmuetzel added a comment. With this additional change, I no longer need the `-lc++` flag: From 62920169c43de27569ecae9ba0ec0fe4ec01633a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=BCtzel?= Date: Fri, 3 Jun 2022 19:17:34 +0200 Subject: [PATCH] lock without on Windows ---

[PATCH] D126291: [flang][Driver] Update link job on windows

2022-06-03 Thread Markus Mützel via Phabricator via cfe-commits
mmuetzel added a comment. In D126291#3556725 , @mstorsjo wrote: > This looks mostly reasonable, but I'd recommend using a windows critical > section instead of a mutex - a critical section doesn't invoke the kernel > when there's no contention of the lo

[PATCH] D126291: [flang][Driver] Update link job on windows

2022-06-06 Thread Markus Mützel via Phabricator via cfe-commits
mmuetzel added a comment. In D126291#3561854 , @Meinersbur wrote: > In D126291#3555639 , @awarzynski > wrote: > >> In D126291#391 , @mmuetzel >> wrote: >> >>> ISTR,

[PATCH] D126291: [flang][Driver] Update link job on windows

2022-06-08 Thread Markus Mützel via Phabricator via cfe-commits
mmuetzel added a comment. In D126291#3566692 , @rovka wrote: > @mmuetzel are you going to upload it to Phab? I gave it a try on my machine > and I can't compile the runtime with it, but I'll try to fix it on my end and > we can continue the discussion i

[PATCH] D126291: [flang][Driver] Update link job on windows

2022-06-09 Thread Markus Mützel via Phabricator via cfe-commits
mmuetzel added a comment. Should this be conditional on the command line flag `-flang-experimental-exec` for the time being (like for the GNU toolchain)? See D122008 Comment at: clang/lib/Driver/ToolChains/MSVC.cpp:133 + if (C.getDriver().

[PATCH] D126291: [flang][Driver] Update link job on windows

2022-06-10 Thread Markus Mützel via Phabricator via cfe-commits
mmuetzel added a comment. In D126291#3572777 , @rovka wrote: > Moved the check for `-flang-experimental-exec` into > addFortranRuntimeLibraryPath, so it affects all the toolchains. @awarzynski > does this look like a good idea? If moving that check to

[PATCH] D126291: [flang][Driver] Update link job on windows

2022-06-10 Thread Markus Mützel via Phabricator via cfe-commits
mmuetzel added inline comments. Comment at: flang/test/Driver/linker-flags-windows.f90:7 +! clang/lib/Driver/Toolchains/MSVC.cpp. +! REQUIRES: windows-msvc + It looks like this test is skipped on windows (MSVC): https://buildkite.com/llvm-project/premerge-checks/

[PATCH] D126291: [flang][Driver] Update link job on windows

2022-06-10 Thread Markus Mützel via Phabricator via cfe-commits
mmuetzel added a comment. Not sure if this is the right place to add this. But maybe something like this could be used to add 'windows-msvc' and 'windows-gnu' features that could be used to run tests conditionally on Windows with MSVC or MinGW toolchains: diff --git a/llvm/utils/lit/lit/llvm/