Re: Any easy way to aggregate and segregate only needed code forgcc ?

pbhat wrote:
> I am trying to build a unicode embedded text editor. For unicode text
> layout engine, I am using harfbuzz, freetype both of which have lot of
> dependency on glibc, libz and others.
>
> I am build my code with dynamic linking which runs well enough. But as
> I need to strip the code down to smallest size for embedded operation, I
> want to keep only needed parts of the supporting libraries.
>
> I used kcachegrind to trace function calls and isolate involved c files
> and pare them to only needed functions. But now the biggest challenge is
> with respect of header files. I see hundreds of header files, some of
> which are even bigger than the target code size.There are circular
> dependencies.
>
> Now I want to know if there is any automated tool or compiler options
> which will help me only compile the needed parts, i.e section the C and
> header files into needed and un-needed.
>
> I am new to this. Any advise in the right direction will be of great
> help. Thanks in advance.

I’m not clear why you care about how many headers there are. They don’t
contribute to code size, do they?

Thanks. I had thought the contents of header files will be added to the source file where the #include is. So, I am thinking it is necessary to remove unneeded header contents.

So, my understanding is wrong?

On 2013-08-30 00:16, pbhat wrote:
>
> djh-novell;2581503 Wrote:
>> pbhat wrote:
>>
>> **************
>>
>> I’m not clear why you care about how many headers there are. They don’t
>> contribute to code size, do they?
>
> Thanks. I had thought the contents of header files will be added to the
> source file where the #include is. So, I am thinking it is necessary to
> remove unneeded header contents.
>
> So, my understanding is wrong?

Normally, a header file is just definitions. They don’t take space in
the final code till a variable declares use that definition, or code
uses a macro.

A header might contain code, but that would be illicit use, IMHO.


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)