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.
This commit is contained in:
parent
ef37ddf477
commit
d46a29d919
|
@ -0,0 +1,3 @@
|
||||||
|
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102476
|
||||||
|
// { dg-do link }
|
||||||
|
// { dg-options "-fmain -fno-druntime" }
|
|
@ -20,7 +20,17 @@
|
||||||
|
|
||||||
module __main;
|
module __main;
|
||||||
|
|
||||||
int main(char[][])
|
version (D_BetterC)
|
||||||
{
|
{
|
||||||
return 0;
|
extern (C) int main(int, char**)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int main(char[][])
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue