https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64810
--- Comment #11 from David Malcolm <dmalcolm at gcc dot gnu.org> --- A breakpoint on "do_option_spec" in the driver shows that the options come from configure_default_options and option_default_specs. configure_default_options comes from configargs.h, written out by gcc/configure(.ac) which seems to get configure_default_options from config.gcc (from ${t}) This would be easy to use, if only we could guarantee it was "-mKEY=VALUE", but it isn't; doing it naively the "obvious" way: --- a/gcc/jit/jit-playback.c +++ b/gcc/jit/jit-playback.c @@ -63,6 +63,7 @@ along with GCC; see the file COPYING3. If not see #include "context.h" #include "fold-const.h" #include "debug.h" +#include "configargs.h" #include "jit-common.h" #include "jit-logging.h" @@ -2118,6 +2119,19 @@ make_fake_args (vec <char *> *argvec, } } + { + for (unsigned i = 0; i < ARRAY_SIZE (configure_default_options); i++) + { + char *arg = concat ("-m", + configure_default_options[i].name, + "=", + configure_default_options[i].value, + NULL); + ADD_ARG_TAKE_OWNERSHIP (arg); + } + } + #undef ADD_ARG #undef ADD_ARG_TAKE_OWNERSHIP } fails in toplev::main: test-empty.c.exe: error: unrecognized command line option '-mfloat=hard' test-empty.c.exe: error: unrecognized command line option '-mtls=gnu' (these ought to be -mfloat-abi and -mtls-dialect respectively). option_default_specs comes from OPTION_DEFAULT_SPECS. OPTION_DEFAULT_SPECS can be defined by the config, and is for 20 targets, including arm (arm.h): /* Support for a compile-time default CPU, et cetera. The rules are: --with-arch is ignored if -march or -mcpu are specified. --with-cpu is ignored if -march or -mcpu are specified, and is overridden by --with-arch. --with-tune is ignored if -mtune or -mcpu are specified (but not affected by -march). --with-float is ignored if -mfloat-abi is specified. --with-fpu is ignored if -mfpu is specified. --with-abi is ignored if -mabi is specified. --with-tls is ignored if -mtls-dialect is specified. */ #define OPTION_DEFAULT_SPECS \ {"arch", "%{!march=*:%{!mcpu=*:-march=%(VALUE)}}" }, \ {"cpu", "%{!march=*:%{!mcpu=*:-mcpu=%(VALUE)}}" }, \ {"tune", "%{!mcpu=*:%{!mtune=*:-mtune=%(VALUE)}}" }, \ {"float", "%{!mfloat-abi=*:-mfloat-abi=%(VALUE)}" }, \ {"fpu", "%{!mfpu=*:-mfpu=%(VALUE)}"}, \ {"abi", "%{!mabi=*:-mabi=%(VALUE)}"}, \ {"mode", "%{!marm:%{!mthumb:-m%(VALUE)}}"}, \ {"tls", "%{!mtls-dialect=*:-mtls-dialect=%(VALUE)}"}, So it looks like the jit has to support whatever OPTION_DEFAULT_SPECS is set for the target. I'm working on a patch that expands these spec values so that they can be injected by libgccjit into toplev::main (and maybe into its own invocation of the driver?). Unfortunately, this requires running the driver at build time, which would require build==host.