How to add a new option to gcc

ORC_developer heguojin@ict.ac.cn
Thu Oct 2 21:39:00 GMT 2008


I followed the manual
Define a common option like that:

common-instr
Common Var(common_instr_flag) Init(0)
Outputing common instrumentation code

Then I use the flag if(common_instr_flag) in sparc.c to enable my code.

When I use gcc -common-instr=1, I just got 
unrecognized option '-common-instr=1'

Then I tried to modify c-opts.c , function c_common_handle_option
To handle the case OPT_common-instr.
And I tried
gcc -common-instr,

same error " unrecognized option '-common-instr "

What else should I do to use the option?

 




-----Original Message-----
From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On
Behalf Of David Daney
Sent: Thursday, October 02, 2008 3:34 PM
To: ORC_developer
Cc: gcc-help@gcc.gnu.org
Subject: Re: How to add a new option to gcc

ORC_developer wrote:
> I wonder if there is any document about adding a new architecture-related
> option to gcc?
> I'm porting gcc to a new arch
>   
It is generally done by modifying the gcc/config/arch/arch.opt file.

http://gcc.gnu.org/onlinedocs/gccint/Options.html

David Daney




More information about the Gcc-help mailing list