rj-jesus wrote:

> The solution is to add `-fno-fortran-main` to the linker options via 
> `CMAKE_SHARED_LINKER_FLAGS`. This will need PR #74139 land first. But this 
> option will be a good way to control if the flang compiler should attempt 
> linking in the `main` stub from its library.
> 
> It seems like `flang-new` when being used as a linker with `-shared` included 
> Fortran_main in the shared library. This seems wrong to me. The option 
> `-fno-fortran-main` avoids this. I'm pondering if `-shared` is buggy here. It 
> will require a bit more digging on my end to figure that out.

Thanks, sounds like a good workaround to me, though as you say I find strange 
the need to explicitly specify "don't include main" when building a library!

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