The option `-fmain' reads in a __main.di module from D runtime that defines an extern(D) main function. This causes link-time errors when building without D runtime.
The master branch has been updated by Iain Buclaw <ibuclaw@gcc.gnu.org>: https://gcc.gnu.org/g:d46a29d919058fb383d19fe35c234fab58286f71 commit r12-3985-gd46a29d919058fb383d19fe35c234fab58286f71 Author: Iain Buclaw <ibuclaw@gdcproject.org> Date: Fri Sep 24 10:59:47 2021 +0200 libphobos: Define main function as extern(C) when compiling without D runtime (PR102476) The default supplied main function as read when compiling with `-fmain' has extern(D) linkage. However this does not work when mixing this option together with `-fno-druntime'. PR d/102476 gcc/testsuite/ChangeLog: * gdc.dg/pr102476.d: New test. libphobos/ChangeLog: * libdruntime/__main.di: Define main function as extern(C) when compiling without D runtime.
Fix committed.