libphobos: Define main function as extern(C) when compiling without D runtime (PR102476)
commitd46a29d919058fb383d19fe35c234fab58286f71
authorIain Buclaw <ibuclaw@gdcproject.org>
Fri, 24 Sep 2021 08:59:47 +0000 (24 10:59 +0200)
committerIain Buclaw <ibuclaw@gdcproject.org>
Thu, 30 Sep 2021 13:07:19 +0000 (30 15:07 +0200)
treea70c30e956607308dbc72391acd191c006cd994a
parentef37ddf477ac4b21ec4d1be9260cfd3b431fd4a9
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.
gcc/testsuite/gdc.dg/pr102476.d [new file with mode: 0644]
libphobos/libdruntime/__main.di