tblah wrote:

Yes they are mixed source projects. They worked previously because the main 
function from `Frotran_main` was silently ignored. I don't know if this was 
accidental or not, but it tended to do the right thing for mixed source 
projects because if the user intended to use `Fortran_main`, they would not 
define `main()` elsewhere, but if they did not, there would be another 
definition of `main()`.

I think the simplest solution would be to add a flag controlling whether to 
link `Fortran_main`. @DavidTruby suggested only linking `Fortran_main` if the 
fortran source contains a `program` statement.

One could build a mixed source project now by linking using `clang` and 
manually specifying to link the rest of the fortran runtime library. I don't 
think this is a good option because it is not convenient to change spec 
makefiles and I don't think expecting users to find the right fortran runtime 
linker invocation is a good experience (a flag just for `Fortran_main` is 
better because one could see "error: multiple definitions of main()" ... "ahh I 
need the flag to get rid of the automatic definition of `main()`"). 

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

Reply via email to