Lib change leads to larger executables

John Reimer terminal.node at gmail.com
Wed Feb 21 07:56:31 PST 2007


On Wed, 21 Feb 2007 01:47:53 -0800, kris wrote:

> kris wrote:
>> Walter Bright wrote:
>> 
>>> kris wrote:
>>>
>>>> Walter Bright wrote:
>>>>
>>>>> For a quick & dirty test, try reversing the order the object files 
>>>>> are presented to lib.
>>>>
>>>>
>>>>
>>>> there's a couple of hundred :-D
>>>
>>>
>>>
>>> Do the ones that were giving the undefined reference before the 
>>> changes to lib.
>> 
>> 
>> The lib itself is actually built via a single D module, which imports 
>> all others. This is then given to Build to construct the library. Thus I 
>> don't have direct control over the ordering. Having said that, it 
>> appears Build does something different when the modules are reordered; 
>> Likely changing the order in which modules are presented to the lib.
>> 
>> By moving things around, I see a change in size on the target executable 
>> between -4kb to +5kb
>> 
> 
> I've been messing with the response file handed to the librarian (via 
> lib @foo); moving modules around here and there, reordering big chunks 
> etc. Have yet to see a notable change in the resulting exe after 
> relinking against each lib version.


Is build really a reliable means of testing this?  I mean, it's produced
unusual differences in binary size in the past (granted not of that
magnitude).  Of course, this is a different case too, in which a library is
being created.

Just out of curiousity, does rebuild do the same thing?

-JJR



More information about the Digitalmars-d mailing list