shared library size
kinke
kinke at libero.it
Mon Jul 2 15:56:56 UTC 2018
On Monday, 2 July 2018 at 13:06:12 UTC, boolangery wrote:
> On Monday, 2 July 2018 at 12:21:04 UTC, Guillaume Piolat wrote:
>>
>> On POSIX by default, all the symbols in a shared library are
>> exported. That makes a lot of symbols that can't be stripped
>> automatically by the linker!
>>
>> And it won't change anytime soon
>> (https://github.com/ldc-developers/ldc/issues/2431).
>>
>> The one option you have with LDC to have smaller shared
>> libraries is to use:
>>
>> $ ldc2 -exported_symbols_list list-of-symbols.lst -dead_strip
>> <rest-of-cmdline>
>>
>> Good luck!
>
> hmmm doesn't seem to work for me
>
> ldc2: Unknown command line argument '-exported_symbols_list'.
> Try: 'ldc2 -help'
> ldc2: Did you mean '-import-instr-limit'?
> ldc2: Unknown command line argument '-dead_strip'. Try: 'ldc2
> -help'
> ldc2: Did you mean '-defaultlib'?
Those are linker (ld) flags, so use the `-L` prefix with LDC:
`-L-exported_symbols_list -L<file.lst> -L-dead_strip`.
More information about the digitalmars-d-ldc
mailing list