[clang] [flang] [lld] [flang] Generate main only when a Fortran program statement is present (PR #89938)

2024-04-26 Thread Daniel Chen via cfe-commits
https://github.com/DanielCChen approved this pull request. Thanks for working on this. We have quite some Fortran C-interop test cases are affected by the "duplicate main" error. https://github.com/llvm/llvm-project/pull/89938 ___ cfe-commits mailing

[flang] [clang] [flang][driver] Remove Fortain_main static library from linking stages (PR #75816)

2023-12-20 Thread Daniel Chen via cfe-commits
@@ -163,6 +163,40 @@ forward compiler options to the frontend driver, `flang-new -fc1`. You can read more on the design of `clangDriver` in Clang's [Driver Design & Internals](https://clang.llvm.org/docs/DriverInternals.html). +## Linker Driver +When used as a linker, Flang's

[flang] [clang] [flang][driver] Remove Fortain_main static library from linking stages (PR #75816)

2023-12-20 Thread Daniel Chen via cfe-commits
https://github.com/DanielCChen edited https://github.com/llvm/llvm-project/pull/75816 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[flang] [clang] [flang][Driver] Let the linker fail on multiple definitions of main() (PR #73124)

2023-12-20 Thread Daniel Chen via cfe-commits
DanielCChen wrote: Thanks @banach-space for the pointer! https://github.com/llvm/llvm-project/pull/73124 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[flang] [clang] [flang][driver] Remove Fortain_main static library from linking stages (PR #75816)

2023-12-20 Thread Daniel Chen via cfe-commits
@@ -163,6 +163,40 @@ forward compiler options to the frontend driver, `flang-new -fc1`. You can read more on the design of `clangDriver` in Clang's [Driver Design & Internals](https://clang.llvm.org/docs/DriverInternals.html). +## Linker Driver +When used as a linker, Flang's

[flang] [clang] [flang][Driver] Let the linker fail on multiple definitions of main() (PR #73124)

2023-12-19 Thread Daniel Chen via cfe-commits
DanielCChen wrote: Ok. I see. The Fortran `main` is actually coming out of internal compiler generated code rather than user code. It seems users who have Fortran-C-interop code will need to toggle the `-fno-fortran-main` option ON and OFF depends on who the `main` is. I think there are some r

[clang] [flang] [flang][Driver] Let the linker fail on multiple definitions of main() (PR #73124)

2023-12-19 Thread Daniel Chen via cfe-commits
DanielCChen wrote: The test cases actually have C main indeed and call to Fortran procedures as opposed to what I thought (the other way around). Adding `-fno-fortran-main` fixed all of them! May be I missed it when reading through the comments of this PR, why there is a definition of `main()`

[flang] [clang] [flang][Driver] Let the linker fail on multiple definitions of main() (PR #73124)

2023-12-19 Thread Daniel Chen via cfe-commits
DanielCChen wrote: Thanks for the initial analysis. I will take a closer look of the failure and prepare a reproducer and post it here. https://github.com/llvm/llvm-project/pull/73124 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lis

[clang] [flang] [flang][Driver] Let the linker fail on multiple definitions of main() (PR #73124)

2023-12-18 Thread Daniel Chen via cfe-commits
DanielCChen wrote: I see. So Fortran and C interoperability of F2003/F2008 is not supported yet in Flang? Those ~100ish regression test cases we have were passing before this PR though. Unfortunately, those test cases are not made public available yet. I think I can copy the source code of on

[clang] [flang] [flang][Driver] Let the linker fail on multiple definitions of main() (PR #73124)

2023-12-18 Thread Daniel Chen via cfe-commits
DanielCChen wrote: @mjklemm This PR caused some regressions of C-interop test cases in our local test run. The test cases typically have a Fortran main (compiled with Flang) that calls a C function (compiled with clang). The linking is by `flang-new`. The error looks like: ``` ld.lld: error: d

[libc] [clang] [lld] [lldb] [clang-tools-extra] [flang] [libcxx] [libcxxabi] [llvm] [flang] Pass Argv0 to getIntriniscDir and getOpenMPHeadersDir (PR #73254)

2023-11-30 Thread Daniel Chen via cfe-commits
DanielCChen wrote: The changes look good to me. I will wait a day to see if other reviewers have any more comments before approving it. https://github.com/llvm/llvm-project/pull/73254 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lis