Adding a file while linking

Ramana Radhakrishnan
Fri Feb 25 17:08:00 GMT 2005


> Ramana
> Coul you tell me how is the specs file created during build?
> Thanks for your help

The spec files can be changed by hand after you have built the compiler.

Take a look at the info pages for gcc . Search for Spec files.

Lets say you want to add a startfile depending on a command line option 
you would do something like :

%startfile: {option: includeifoptionchosen.o%s} {!option:normal 

or just add this as a condition in your specs.(btw the %s is if you want 
  the compiler driver to search for the files in the system specs.)



> Khem
> On Thu, 24 Feb 2005 09:29:00 +0530, Ramana Radhakrishnan
> <> wrote:
>>Khem Raj wrote:
>>>I want to add a file when linking is performed using gcc. Like crt*
>>>files.  I also want to control the inclusion of this file with a
>>>commandline option in gcc.
>>>What would be the best way to do it.?
>>Look at the spec files. That would be the way to go ahead and do it
>>easiest  .
>>Ramana Radhakrishnan
>>GNU Tools
>>codito ergo sum (

Ramana Radhakrishnan
GNU Tools
codito ergo sum (

More information about the Gcc-help mailing list