[Issue 10711] New: shared phobos library should not depend on _Dmain

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jul 24 07:16:14 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10711

           Summary: shared phobos library should not depend on _Dmain
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: druntime
        AssignedTo: nobody at puremagic.com
        ReportedBy: code at dawg.eu


--- Comment #0 from Martin Nowak <code at dawg.eu> 2013-07-24 07:16:13 PDT ---
When building shared D libraries the function _Dmain remains unresolved.
This is because a C main function is part of druntime.
To fix this we should generate the C main function in the glue layer of the
compiler and only do that if a D main function is present.

This needs some refactoring in druntime first so that the function becomes
reasonably simple, e.g. something along this line.

extern(C) int main(int argc, char*[] argv)
{
    auto rc = rt_init(argv[0 .. argc]);
    if (rc == 0)
    {
        runMain();
        rc = rt_term();
    }
    return rc;
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list