public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* need help on GCC driver
@ 2009-07-30 14:05 Vikram KS
  2009-07-30 14:44 ` Basile STARYNKEVITCH
  0 siblings, 1 reply; 4+ messages in thread
From: Vikram KS @ 2009-07-30 14:05 UTC (permalink / raw)
  To: gcc

Hi,

I have some question on gcc driver.

Whenever we invoke gcc, it'll pass some default options to the
compiler, assembler linker etc. But if i dont want to pass all these
default options but only some of them, what should i do?

For eg: gcc will pass the following option to cc1

/usr/libexec/gcc/i386-redhat-linux/4.1.1/cc1 -quiet -v test.c -quiet
-dumpbase test.c -mtune=generic -auxbase test -version -o
/tmp/ccM89Tz7.s

and to "as"

 as -V -Qy -o /tmp/ccP6YP4n.o /tmp/ccM89Tz7.s

Now i dont want to generate "-o /tmp/ccM89Tz7.s" instead i want to
generate "/tmp/ccM89Tz7.sl" and this generated ".sl" should be picked
by my assembler and it should generate the o/p with ".ol" extension.

as -V -Qy -o /tmp/ccP6YP4n.ol /tmp/ccM89Tz7.sl

Also if i give "-S" switch, it should generate the the output with the
".sl" extension instead of  ".s".

Is this possible to do it in "gcc/config/<target>.h" or do i need to
write a separate spec file.

Please help me out.


Thanks,
Vikram

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: need help on GCC driver
  2009-07-30 14:05 need help on GCC driver Vikram KS
@ 2009-07-30 14:44 ` Basile STARYNKEVITCH
  2009-07-31  4:37   ` Vikram KS
  0 siblings, 1 reply; 4+ messages in thread
From: Basile STARYNKEVITCH @ 2009-07-30 14:44 UTC (permalink / raw)
  To: Vikram KS; +Cc: gcc

Vikram KS wrote:
> Hi,
> 
> I have some question on gcc driver.

You really should give more context. Are you doing cross-compilation? 
Are you patching the GCC sources? Why do you want to generate a *.sl 
file? What are your host & target systems?
> 
> Whenever we invoke gcc, it'll pass some default options to the
> compiler, assembler linker etc. But if i dont want to pass all these
> default options but only some of them, what should i do?
> 
> For eg: gcc will pass the following option to cc1
> 
> /usr/libexec/gcc/i386-redhat-linux/4.1.1/cc1 -quiet -v test.c -quiet
> -dumpbase test.c -mtune=generic -auxbase test -version -o
> /tmp/ccM89Tz7.s

Why are you talking of gcc-4.1.1? It is quite old now! If you want to 
patch or hack inside GCC, I strongly suggest working on the trunk 
(future gcc-4.5) or on your branch, or at least the latest GCC release 
(ie 4.4.1).

> 
> and to "as"
> 
>  as -V -Qy -o /tmp/ccP6YP4n.o /tmp/ccM89Tz7.s
> 
> Now i dont want to generate "-o /tmp/ccM89Tz7.s" instead i want to
> generate "/tmp/ccM89Tz7.sl" and this generated ".sl" should be picked
> by my assembler and it should generate the o/p with ".ol" extension.
I suppose it is a typo, and should read with ".sl" extension.

> 
> as -V -Qy -o /tmp/ccP6YP4n.ol /tmp/ccM89Tz7.sl
> 
> Also if i give "-S" switch, it should generate the the output with the
> ".sl" extension instead of  ".s".
> 
> Is this possible to do it in "gcc/config/<target>.h" or do i need to
> write a separate spec file.

I don't understand if you have your own target or not. I would suggest 
using a spec file (it is probably the easiest way to do). But I am not 
very expert on the gcc.c driver!

I really suggest you if possible to avoid hacking gcc 4.1.x and work on 
something more recent (otherwise you'll get few help from here...).

Regards.


-- 
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: need help on GCC driver
  2009-07-30 14:44 ` Basile STARYNKEVITCH
@ 2009-07-31  4:37   ` Vikram KS
  2009-07-31  5:19     ` Basile STARYNKEVITCH
  0 siblings, 1 reply; 4+ messages in thread
From: Vikram KS @ 2009-07-31  4:37 UTC (permalink / raw)
  To: Basile STARYNKEVITCH; +Cc: gcc

On Thu, Jul 30, 2009 at 8:14 PM, Basile STARYNKEVITCH
<basile@starynkevitch.net> wrote:
>
> Vikram KS wrote:
>>
>> Hi,
>>
>> I have some question on gcc driver.
>
> You really should give more context. Are you doing cross-compilation? Are you patching the GCC sources? Why do you want to generate a *.sl file? What are your host & target systems?

Thanks for your reply. I am sorry that i was not clear. I am involved
in a private port for GCC 4.4.0. I have to integrate the compiler with
the rest of the existing tool chain. So as a part of this process i
have to invoke the rest of the tool chain through GCC driver.

>>
>> Whenever we invoke gcc, it'll pass some default options to the
>> compiler, assembler linker etc. But if i dont want to pass all these
>> default options but only some of them, what should i do?
>>
>> For eg: gcc will pass the following option to cc1
>>
>> /usr/libexec/gcc/i386-redhat-linux/4.1.1/cc1 -quiet -v test.c -quiet
>> -dumpbase test.c -mtune=generic -auxbase test -version -o
>> /tmp/ccM89Tz7.s
>
> Why are you talking of gcc-4.1.1? It is quite old now! If you want to patch or hack inside GCC, I strongly suggest working on the trunk (future gcc-4.5) or on your branch, or at least the latest GCC release (ie 4.4.1).

I used the native complier only to show my requirement. I am using GCC 4.4.0
>
>>
>> and to "as"
>>
>>  as -V -Qy -o /tmp/ccP6YP4n.o /tmp/ccM89Tz7.s
>>
>> Now i dont want to generate "-o /tmp/ccM89Tz7.s" instead i want to
>> generate "/tmp/ccM89Tz7.sl" and this generated ".sl" should be picked
>> by my assembler and it should generate the o/p with ".ol" extension.
>
> I suppose it is a typo, and should read with ".sl" extension.
>
>>
>> as -V -Qy -o /tmp/ccP6YP4n.ol /tmp/ccM89Tz7.sl
>>
>> Also if i give "-S" switch, it should generate the the output with the
>> ".sl" extension instead of  ".s".
>>
>> Is this possible to do it in "gcc/config/<target>.h" or do i need to
>> write a separate spec file.
>
> I don't understand if you have your own target or not. I would suggest using a spec file (it is probably the easiest way to do). But I am not very expert on the gcc.c driver!
>
> I really suggest you if possible to avoid hacking gcc 4.1.x and work on something more recent (otherwise you'll get few help from here...).
>

So in the back-end there are driver options that will help me to
invoke the existing tool-chain through GCC driver. But the assembler
takes only .sl extensions. I tried to replace the .s extension with
.sl extension. But by default the cc1 will have some options passed
from the driver which also includes -o option. So if to add my own -o
option i am getting error due to repetition of -o option. So my
question is how to replace the .s extension with .sl extension for the
compiler output.

Hope i am clear.

Regards,
Vikram

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: need help on GCC driver
  2009-07-31  4:37   ` Vikram KS
@ 2009-07-31  5:19     ` Basile STARYNKEVITCH
  0 siblings, 0 replies; 4+ messages in thread
From: Basile STARYNKEVITCH @ 2009-07-31  5:19 UTC (permalink / raw)
  To: Vikram KS; +Cc: gcc

Vikram KS wrote:
> 
> So in the back-end there are driver options that will help me to
> invoke the existing tool-chain through GCC driver. But the assembler
> takes only .sl extensions. I tried to replace the .s extension with
> .sl extension. But by default the cc1 will have some options passed
> from the driver which also includes -o option. So if to add my own -o
> option i am getting error due to repetition of -o option. So my
> question is how to replace the .s extension with .sl extension for the
> compiler output.

I would imagine that an appropriate .spec file would do the trick; 
however, I am not sure of that, because I don't understand all the gory 
details of spec files.

Regards.

-- 
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-07-31  5:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-30 14:05 need help on GCC driver Vikram KS
2009-07-30 14:44 ` Basile STARYNKEVITCH
2009-07-31  4:37   ` Vikram KS
2009-07-31  5:19     ` Basile STARYNKEVITCH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).