[Issue 14748] Removing std.stdio import causes 2x increase in "Hello, world" program binary filesize

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Jul 22 04:47:09 PDT 2015


https://issues.dlang.org/show_bug.cgi?id=14748

--- Comment #13 from Martin Nowak <code at dawg.eu> ---
std.stream does not get dragged in by the usual imported modules problem.
When I remove stream.o from libphobos2.a I get a surprising linker error.

dmd/src/../../phobos/generated/linux/release/64/libphobos2.a(curl.o):std/net/curl.d:function
_D3std3net4curl4HTTP18_sharedStaticCtor1FZv: error: undefined reference to
'curl_version_info'
dmd/src/../../phobos/generated/linux/release/64/libphobos2.a(curl.o):std/net/curl.d:function
_D3std3net4curl4Curl18_sharedStaticCtor2FZv: error: undefined reference to
'curl_global_init'
dmd/src/../../phobos/generated/linux/release/64/libphobos2.a(curl.o):std/net/curl.d:function
_D3std3net4curl4Curl18_sharedStaticDtor3FZv: error: undefined reference to
'curl_global_cleanup

If I also remove curl.o then linking works and I get a small and operating
binary.

Both modules define weak definitions of the following symbols, which is likely
the reason why they got dragged into the binary.

_D3std8internal7cstring15__unittest_failFiZv
_D3std8internal7cstring7__arrayZ
_D3std8internal7cstring8__assertFiZv

--


More information about the Digitalmars-d-bugs mailing list