Meinersbur added a comment. In D126291#3552573 <https://reviews.llvm.org/D126291#3552573>, @rovka wrote://italic text//
> I don't really know why `link.exe` doesn't work. According to the docs > <https://docs.microsoft.com/en-us/cpp/build/reference/entry-entry-point-symbol?view=msvc-170#:~:text=If%20the%20/DLL%20or%20/SUBSYSTEM%20option%20is%20not%20specified%2C%20the%20linker%20selects%20a%20subsystem%20and%20entry%20point%20depending%20on%20whether%20main%20or%20WinMain%20is%20defined.>, > it should find `main` and choose the subsystem on its own. The only hunch I > have is that maybe it doesn't work because `main` is in a library as opposed > to one of the object files, but I'm still going through the docs trying to > figure this out. I don't have a lot of experience with `link.exe` so I might > be missing something obvious. It does work when passing `/SUBSYSTEM:CONSOLE` explicitly. Indeed maybe the autoselect only looks into symbols found in object file. Maybe pass `/SUBSYSTEM:CONSOLE` as well to the linker command? `llvm-link` should accept it as well. AFAIU there is no other subsystem Flang supports anyway. Even if, it requires changes to `Fortran_main.lib`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126291/new/ https://reviews.llvm.org/D126291 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits