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
Confirmed, adding a target independent option is easy but adding a target dependent is where the
problem comes in.
http://gcc.gnu.org/ml/gcc-patches/2005-03/msg01297.html would help.
See also a thread on the gcc list
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."
*** Bug 26168 has been marked as a duplicate of this bug. ***