From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id A74173858D28 for ; Wed, 6 Jul 2022 22:42:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A74173858D28 Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-404-hT73YMJnMa2wxC1yJzzVhA-1; Wed, 06 Jul 2022 18:42:58 -0400 X-MC-Unique: hT73YMJnMa2wxC1yJzzVhA-1 Received: by mail-qk1-f198.google.com with SMTP id o70-20020a37a549000000b006af05e7eca3so16082483qke.10 for ; Wed, 06 Jul 2022 15:42:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=B1biUTEYsEhKp0nZn6NGZbG0eFDInoLojrJPnNUyc7A=; b=3+tXhM9NzFJZ80aVbSM6aIhsCRHaMwkpAaMFaqzy0L1NY9PSHiv/w4+Q0ziNBS1ob5 MZW902Jzh+9jFzKWfwBJcgHiyDF0+qxULYA3giho8U1b8pwfyrCXF6ggzQ+nnCR8188L bey86lf6HWLQZlBakQvuULuiQFLQRdlo6K6UritaV8fjgr+HMr/VoGHe5o0ANOjiOEyQ Ymxx1kIxvBNqLb7HXVscXG8RII6oGoAI6Gi61jGUc+SbXty54yFoKkJEDxk53BH15pQx niHsXtfzmceNkzFPm0CJOdiwnItQQ8bCy3z/4ErXl0ENwnBuvJYK0K50OeGv6n1h4u1b Vf4g== X-Gm-Message-State: AJIora+sQhtyYDkX0XuSapGNKFbWtN0GQyWayU7hbHh0j3BldwCPRTuq 2CvD17CyO+ZrZMsQcCwg5BHtwpInr7tDD1YVVaWhSW36mOWPMrJV6MSekPoBmUiGOrWIK3CEfVU QtGexRZo= X-Received: by 2002:ac8:5c41:0:b0:31e:939a:c17b with SMTP id j1-20020ac85c41000000b0031e939ac17bmr3189374qtj.9.1657147377395; Wed, 06 Jul 2022 15:42:57 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sbamruTBsiGuSKScu71CPmItKcw1PS5+eSaBkZgwGUUIiQYYqsOtE42w0GHu3JHlvbZGi7zA== X-Received: by 2002:ac8:5c41:0:b0:31e:939a:c17b with SMTP id j1-20020ac85c41000000b0031e939ac17bmr3189335qtj.9.1657147376460; Wed, 06 Jul 2022 15:42:56 -0700 (PDT) Received: from t14s.localdomain (c-73-69-212-193.hsd1.nh.comcast.net. [73.69.212.193]) by smtp.gmail.com with ESMTPSA id a20-20020a05620a16d400b0069fe1dfbeffsm30009255qkn.92.2022.07.06.15.42.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Jul 2022 15:42:55 -0700 (PDT) Message-ID: <3e6c287d50f36adf172a7181e0e8f8eb7fead24e.camel@redhat.com> Subject: Re: jit and cross-compilers (use and configuration). From: David Malcolm To: Iain Sandoe Cc: GCC Development Date: Wed, 06 Jul 2022 18:42:54 -0400 In-Reply-To: References: User-Agent: Evolution 3.38.4 (3.38.4-1.fc33) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jul 2022 22:43:00 -0000 On Sun, 2022-06-26 at 14:06 +0100, Iain Sandoe wrote: > Hi Dave, folks, > > It seems to me that it is plausible that one could use the JIT in a > heterogenous system, e.g. an x86_64-linux-host with some kind of co- > processor which is supported as a GCC target (and therefore can be > loaded with jit-d code) … but I’m not aware of anyone actually doing > this? libgccjit is horribly misnamed, in that it can also be used for ahead- of-time compilation; I wish I'd called it libgcccodegen or somesuch. So a more plausible use-case for cross-compilation with libgccjit is (ahem) the non-jit case. I'd like to support this, but I have to confess that I'm not experienced in setting up a full cross-compilation toolchain; my cross-compilation testing of GCC has been limited to configuring with --target and verifying by hand that sane-looking asm is emitted. The heterogeneous system might also be doable, but the ahead-of-time cross-compilation seems much more important. > > .. is that use case even reasonable given the current implementation? > (I guess there are invocations of the assembler etc. .. I’m not sure > if these would work as currently implemented) > > ---- > > It’s mildly inconvenient that the build for cross compilers generally > fails for me on Darwin (reason 1 below) since I tend to configure by > default with —enable-languages=all (and most Darwin platform versions > default to host_shared).  So I’d like to see what the best way > forward is ….. > > ---- > > In the short-term there are some issues with the configuration for > cross-compilers… > > 1) the values queried in gcc/jit/Make-lang.in relate to the ‘ld’ that > is used for $target not the one used for $host. > >  - this means that if we are on a $host with an non-binutils-ld and > building a cross-compiler for a $target that *does* use binutils-ld, > the configuration selects flags that do not work so that the build > fails. >  - of course, things might fail more subtly in the case that there > were two *different* binutils ld instances. > > 2) the testsuite obviously does not work. > > So .. one possibility is to disable jit for cross-compilers, (patch > attached) .. > > … another is to find a way to fix the configuration to pick up > suitable values for $host (although I’m not sure how much of that we > have readily available, since usually libtool is doing that work). FWIW I'd prefer to get it working, but I probably lack the experience with cross-compilation to do that, alas. Sorry that this isn't the most helpful answer Dave