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

Tom Eccles via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 1 10:23:11 PST 2023


tblah wrote:

> Could you please see if `-Wl,--allow-multiple-definition` would help to resolve the issue in the application?

Surprisingly not. 
```
ld.lld: error: undefined symbol: _QQEnvironmentDefaults
>>> referenced by Fortran_main.c
>>>               Fortran_main.c.o:(.text.main+0x8) in archive [...]/libFortran_main.a
>>> referenced by Fortran_main.c
>>>               Fortran_main.c.o:(.text.main+0xC) in archive [...]/lib/libFortran_main.a

ld.lld: error: undefined symbol: _QQmain
>>> referenced by Fortran_main.c
>>>               Fortran_main.c.o:(.text.main+0x18) in archive [...]/lib/libFortran_main.a
flang-new: error: linker command failed with exit code 1 (use -v to see invocation)
```

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


More information about the cfe-commits mailing list