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

Andrzej WarzyƄski via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 1 07:01:59 PST 2023


banach-space wrote:

> Since this patch, I can no longer build spec2006 gromacs and calculix because they supply their own main function in a C file, then link using flang-new: leading to another definition of `main()` from the runtime. Do I need to use a special flag to avoid linking to libFortran_main?

How about `flang-new -c file.90`? Which driver does the linking at the end?

TBH, sounds like you are building a mixed-source project. This should be supported by the Clang/Flang duo, but we haven't really tested that. It's possible that it "accidentally" worked, but this patch made the driver stricter and now we know that something is missing.

What's the compiler invoc?

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


More information about the cfe-commits mailing list