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

2023-12-08 Thread Ricardo Jesus via cfe-commits
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. > >

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

2023-12-07 Thread Ricardo Jesus via cfe-commits
rj-jesus wrote: > > Chipping into the discussion, since this patch I can also no longer build > > OpenBLAS or PETSc. OpenBLAS for example fails with > > ``` > > $ clang -v -O3 -mcpu=native -DHAVE_C11 -Wall -DF_INTERFACE_GFORT -fPIC > > -DSMP_SERVER -DNO_WARMUP -DMAX_CPU_NUMBER=72

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

2023-12-06 Thread Ricardo Jesus via cfe-commits
rj-jesus wrote: Chipping into the discussion, since this patch I can also no longer build OpenBLAS or PETSc. OpenBLAS for example fails with ``` $ clang -v -O3 -mcpu=native -DHAVE_C11 -Wall -DF_INTERFACE_GFORT -fPIC -DSMP_SERVER -DNO_WARMUP -DMAX_CPU_NUMBER=72 -DMAX_PARALLEL_NUMBER=1