From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10066 invoked by alias); 28 Jan 2015 20:59:08 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 1887 invoked by uid 48); 28 Jan 2015 20:59:01 -0000 From: "dmalcolm at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug jit/64810] jit not working on armv7hl ("ld: error: /tmp/libgccjit-ZGemdr/fake.so uses VFP register arguments, /tmp/ccJFCBsE.o does not") Date: Wed, 28 Jan 2015 20:59:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: jit X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dmalcolm at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: dmalcolm at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-01/txt/msg03309.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64810 --- Comment #11 from David Malcolm --- 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 *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.