Generated binary size

Iain Buclaw ibuclaw at ubuntu.com
Sun Sep 15 14:05:09 PDT 2013


On 15 September 2013 21:02, Dicebot <public at dicebot.lv> wrote:
> On Sunday, 15 September 2013 at 19:59:48 UTC, Iain Buclaw wrote:
>>
>> On 15 September 2013 20:46, Dicebot <public at dicebot.lv> wrote:
>>>
>>> On Friday, 13 September 2013 at 18:09:15 UTC, Iain Buclaw wrote:
>>>>
>>>>
>>>> du -h lib64/libgphobos2.a
>>>> 73M    lib64/libgphobos2.a
>>>>
>>>> strip --strip-unneeded  lib64/libgphobos2.a
>>>>
>>>> du -h lib64/libgphobos2.a
>>>> 18M    lib64/libgphobos2.a
>>>
>>>
>>>
>>> Well, looks like you have just found a bug in default Arch Linux
>>> makepkg.conf :) It does only "--strip-debug" for static libraries (for
>>> unknown reasons I am trying to figure out).
>>>
>>> Thanks :)
>>
>>
>> --strip-debug should do the trick as well...  --strip-unneeded
>> probably isn't recommended for libraries. ;)
>
>
> Well, with --strip-debug it is back to the original situation in the very
> first comment, numbers there are with --strip-debug (what is the potential
> danger with --strip-unneeded?)

--strip-unneeded could potentially cause lots of undefined reference
errors on static libraries.  Shared libraries don't suffer this
because symbols are put into a special section which strip knows not
to touch.

General rule of them:

binaries: strip <file>
static libraries: strip --strip-debug <file>
shared libraries: strip --strip-unneeded <file>

-- 
Iain Buclaw

*(p < e ? p++ : p) = (c & 0x0f) + '0';


More information about the D.gnu mailing list