|combining c-code files into one c-code file email@example.com (Harald Gustafsson) (2012-04-03)|
|Re: combining c-code files into one c-code file firstname.lastname@example.org (Cameron McInally) (2012-04-04)|
|Re: combining c-code files into one c-code file email@example.com (Harald Gustafsson) (2012-04-04)|
|Re: combining c-code files into one c-code file firstname.lastname@example.org (Gene) (2012-04-09)|
|Re: combining c-code files into one c-code file email@example.com (Harald Gustafsson) (2012-04-18)|
|From:||Harald Gustafsson <firstname.lastname@example.org>|
|Date:||Wed, 4 Apr 2012 19:35:25 +0200|
|Posted-Date:||05 Apr 2012 15:20:20 EDT|
From what I could find so far the project I'm porting does not use weak
symbols, but if such was used then the linking is important if several
identical symbols exist. Everything needs to be "linked" statically since it
is going to be one file scope, the code I'm converting is one static library.
So far I have found two tools that seems to be a good start. The CScout
commercial tool, the author has said that all the parts are in the tool, and
it could be adapted to also output the complete file scope. This tool handles
large projects like the Linux kernel (which I think use weak symbols), but I
have not yet verified the correctness of the tool for my libx264 porting. Then
I also discovered that a colleague five rooms from me had made such a tool 10
years ago, it basically uses gcc preprocessor then implements a c-parser and
rename clashing identifiers and prints them in one file. The purpose was to
investigate if the compiler could do a better job when getting one large file
scope instead of several. This tool is not as advanced and foolproof as CScout
but it has been tested on projects like audio codecs and protocol stacks. It
would likely not handle weak symbols, at least not by design.
On 4 apr 2012, at 18.02, Cameron McInally wrote:
> Hey Harald,
> No, I do not know of any tool that will do such things automatically.
> But, a tool like this is not something that would be on my radar.
> I do have a small bit to add though, which may make such a tool a tall
> order. One immediate issue I see is determining linkage of symbols
> when consolidating the source. When handling WEAK symbols, ...
Return to the
Search the comp.compilers archives again.