> You need to handle them in lto-opts.c and output them to the existing option > section. Not sure why they don't appear there already - ah, because of > > /* Also drop all options that are handled by the driver as well, > which includes things like -o and -v or -fhelp for example. > We do not need those. Also drop all diagnostic options. */ > if (cl_options[option->opt_index].flags & (CL_DRIVER|CL_WARNING)) > continue; > > and -fsanitize= being marked as Driver. Looks like we have to drop > things explicitely here given that -o is also Common Driver. Or simply > have > > if (cl_options[option->opt_index].flags & (CL_DRIVER|CL_WARNING)) > switch (option->opt_index) > { > case OPT_fsanitize_: > break; > default: > continue; > } >
Or even better add a new CL_LTOCOLLECT and mark all options that need LTO handling as LTOCollect in the *.opt files, no? In the future, we could extend the syntax to encode the various relationships. At some moment, GCC will need a lto-options.def and generate lto-options.c and some parts of lto-wrapper.c from it. How long is this can going to be kicked down the road? Cheers, Manuel.