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 http://gcc.gnu.org/ml/gcc/2005-03/msg00234.html
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. ***
(In reply to Manuel López-Ibáñez from comment #4) > From bug 26168: > > 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. This part is fixed at least.
Things have improved so much since this bug report was written and when I confirmed it. Devang left Apple back in 2012.
(In reply to Andrew Pinski from comment #7) > Things have improved so much since this bug report was written and when I > confirmed it. Devang left Apple back in 2012. OK I guess it can be closed as FIXED then.