[flang] [clang] [flang][driver] Add -fno-fortran-main (link time) option to remove Fortran_main from link line (PR #74139)

Michael Klemm via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 4 04:51:03 PST 2023


mjklemm wrote:

> I think this solution is fine, at least in the short term.
> 
> I had a think after reviewing the initial patch and looking at the failure that @tblah showed in #73124; my thoughts are that the “correct” way of doing this would be instead of linking Fortran_main all the time, we could insert a linker directive in the object file containing the program statement. That way we would only link Fortran_main when there is actually a program statement in the Fortran. However that’s more work and would need a bit more thought anyway so we at least need something like this or the revert in the interim.

That sounds good!  For now, the code should effectively avoid linking Fortran_main on Linux and Windows if -fno-fortran-main is present.

https://github.com/llvm/llvm-project/pull/74139


More information about the cfe-commits mailing list