On Thursday, 16 November 2017 at 03:32:26 UTC, codephantom wrote:
// -----------------------------------
module test;

import core.stdc.stdio;

extern (C) int main()
{
    printf("hello world\n");
    return 0;
}
// -----------------------------------


compiled with dmd v2.077.0, using the -betterC option, I get:

.. on windows ..
23k executable if 32bit (i.e. -m32 )
112k executable if 64bit (i.e. -m64 )

.. on freebsd ..
5.6k executable if 32bit (i.e. -m32 )
7.5k executable if 64bit (i.e. -m64 )

This is not meant to be an anti-windows thing...so let me stop those responses right here.

I am genuinely interested in understanding why the 'order of magnitude' increase for the 64bit executable on Windows?

If you're worried about executable size, you're probably better off using ldc on non-Windows platforms, because David made ldc work with the linker's --gc-sections. I don't think that work was ever done for dmd, which is why ldc invokes --gc-sections by default for non-MSVC targets but dmd doesn't.

Reply via email to