[Issue 879] support for --gc-sections

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Apr 2 17:26:11 PDT 2017


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

--- Comment #28 from David Nadlinger <code at klickverbot.at> ---
(In reply to Marco Leise from comment #27)
> I extended the 1x1 test matrix by a static Phobos library on one axis and
> ld.bfd on the other and found that in all 4 cases dub greets me with the
> expected "Neither a package ..." message.
> (I used dmd and Phobos in version 2.073.2 and binutils-2.26.1 on Gentoo.)

That's quite promising already. From what it took to get --gc-sections working
on LDC it would be a minor miracle if it suddenly started working on DMD as
well (unless we have been slowly porting over the required changes by
accident). This is also the reason why I asked about different configurations;
this is not just a "normal" backend issue, but the druntime module registration
code is heavily affected by a few --gc-sections linker bugs/peculiarities. When
implementing this on LDC, I only found out about the bigger part of the issues
when pushing the changes to CI resp. from user reports in the subsequent beta.

If the flag really works on DMD now, it would be nice to enable it by default
to drastically reduce binary sizes (LDC has been shipping with --gc-sections on
for a couple of releases now). Building the test suite on the different CI
systems and having people test it during pre-release would be a good stress
test as well.

--


More information about the Digitalmars-d-bugs mailing list