July 22, 2015
https://issues.dlang.org/show_bug.cgi?id=14748

--- Comment #11 from Martin Nowak <code@dawg.eu> ---
This is not in the stable branch, so it won't affect 2.068.0.

@Vladimir didn't you wrote a tool at some point, that finds out why a certain symbol was dragged into a binary?

--
July 22, 2015
https://issues.dlang.org/show_bug.cgi?id=14748

--- Comment #12 from Vladimir Panteleev <thecybershadow@gmail.com> ---
Sort of, it doesn't build a full graph, it can only follow direct function calls.

http://thecybershadow.net/d/mapview/ (second form)

--
July 22, 2015
https://issues.dlang.org/show_bug.cgi?id=14748

--- Comment #13 from Martin Nowak <code@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

--
July 22, 2015
https://issues.dlang.org/show_bug.cgi?id=14748

--- Comment #14 from Martin Nowak <code@dawg.eu> ---
When extracting cstring.o from libphobos2.a and manually linking against it, I also get a small binary.

ar x path/to/libphobos2.a cstring.o
dmd hello.d
ls -lh bug
dmd hello.d cstring.o
ls -lh bug

--
August 01, 2015
https://issues.dlang.org/show_bug.cgi?id=14748

--- Comment #15 from Kenji Hara <k.hara.pg@gmail.com> ---
(In reply to Martin Nowak from comment #13)
> When I remove stream.o from libphobos2.a
> 
> If I also remove curl.o 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

I'm mostly sure that it's same with issue 14828. The COMDAT module helper
functions of std.internal.cstring should be placed in its own obj file.
Otherwise, if a user code requires them, that might drag stream.o or curl.o
into the user program.
(Whether the file size issue happens, would depend on the symbol name list
order in libphobos.a. If stream.o and curl.o are listed in the back of in it,
linker would pull the first found symbol and stream.o and curl.o are not
pulled).

--
August 04, 2015
https://issues.dlang.org/show_bug.cgi?id=14748

Martin Nowak <code@dawg.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #16 from Martin Nowak <code@dawg.eu> ---
Should be fixed by https://github.com/D-Programming-Language/dmd/commit/2e15e16658a0416003e9fcf9ed7dfcd45e0da844.

--
1 2
Next ›   Last »