Bug 19180 - How to Add New GCC option
How to Add New GCC option
Status: NEW
Product: gcc
Classification: Unclassified
Component: other
4.0.0
: P2 enhancement
: ---
Assigned To: Not yet assigned to anyone
: documentation
: 26168 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2004-12-28 18:41 UTC by Devang Patel
Modified: 2007-11-15 17:41 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-02-20 18:39:47


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Devang Patel 2004-12-28 18:41:16 UTC
This is an enhancement request to document step-by-step "How to Add New GCC options" guide.
Another request : Need "Documentation" component in Bugzilla.

Reference : http://gcc.gnu.org/ml/gcc/2004-12/msg01147.html
Comment 1 Andrew Pinski 2004-12-28 18:44:24 UTC
Confirmed, adding a target independent option is easy but adding a target dependent is where the 
problem comes in.
Comment 2 Steven Bosscher 2005-03-13 17:45:00 UTC
http://gcc.gnu.org/ml/gcc-patches/2005-03/msg01297.html would help. 
 
Comment 3 Jim Wilson 2005-04-04 21:38:12 UTC
See also a thread on the gcc list
    http://gcc.gnu.org/ml/gcc/2005-03/msg00234.html
Comment 4 Manuel López-Ibáñez 2007-11-15 17:40:46 UTC
From bug 26168:

"gcc/gcc.c has a comment at the top that's a guide to adding a command line
option.  It's incomplete: it should say to add the new option to c.opt and
rebuild the compiler, and then describe how the variable OPT_whatever gets
created by the awk scripts during the build process, so you can then check for
the option elsewhere in the compiler.  That mechanism doesn't appear documented
at all, and took me a while to figure out through code tracing.  Some
description in the comment would have been a big help.

Also, the comment at the top of the automatically-generated options.c file says
it's generated by "opts.sh" rather than by those awk scripts.  That's a minor
thing but updating it wouldn't hurt."

Comment 5 Manuel López-Ibáñez 2007-11-15 17:41:02 UTC
*** Bug 26168 has been marked as a duplicate of this bug. ***