From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp001-out.apm-internet.net (smtp001-out.apm-internet.net [85.119.248.222]) by sourceware.org (Postfix) with ESMTPS id CD78D3858294 for ; Sun, 26 Jun 2022 13:06:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CD78D3858294 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=sandoe.co.uk Authentication-Results: sourceware.org; spf=none smtp.mailfrom=sandoe.co.uk Received: (qmail 80229 invoked from network); 26 Jun 2022 13:06:02 -0000 X-APM-Out-ID: 16562487628022 X-APM-Authkey: 257869/1(257869/1) 2 Received: from unknown (HELO ?192.168.1.95?) (81.138.1.83) by smtp001.apm-internet.net with SMTP; 26 Jun 2022 13:06:02 -0000 From: Iain Sandoe Content-Type: multipart/mixed; boundary="Apple-Mail=_2EE6CCFA-FDB6-4FED-9992-019F5006AA88" Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) Subject: jit and cross-compilers (use and configuration). Message-Id: Date: Sun, 26 Jun 2022 14:06:01 +0100 Cc: GCC Development To: David Malcolm X-Mailer: Apple Mail (2.3608.120.23.2.7) X-Spam-Status: No, score=-8.6 required=5.0 tests=BAYES_00, KAM_COUK, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no 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: Sun, 26 Jun 2022 13:06:08 -0000 --Apple-Mail=_2EE6CCFA-FDB6-4FED-9992-019F5006AA88 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 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) =E2=80=A6 but I=E2=80=99m not aware of anyone = actually doing this? .. is that use case even reasonable given the current implementation? (I guess there are invocations of the assembler etc. .. I=E2=80=99m not = sure if these would work as currently implemented) ---- It=E2=80=99s 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 =E2=80=94enable-languages=3Dall (and most = Darwin platform versions default to host_shared). So I=E2=80=99d like = to see what the best way forward is =E2=80=A6.. ---- In the short-term there are some issues with the configuration for = cross-compilers=E2=80=A6 1) the values queried in gcc/jit/Make-lang.in relate to the =E2=80=98ld=E2= =80=99 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) ..=20 =E2=80=A6 another is to find a way to fix the configuration to pick up = suitable values for $host (although I=E2=80=99m not sure how much of = that we have readily available, since usually libtool is doing that = work). thoughts? cheers Iain --Apple-Mail=_2EE6CCFA-FDB6-4FED-9992-019F5006AA88 Content-Disposition: attachment; filename=0001-configure-Disable-jit-for-cross-compilers.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-configure-Disable-jit-for-cross-compilers.patch" Content-Transfer-Encoding: quoted-printable =46rom=203cba4dc7a8a6d33e133354bd2846dc1f6bc7e2f1=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Iain=20Sandoe=20=0ADate:=20= Sat,=2025=20Jun=202022=2017:56:22=20+0100=0ASubject:=20[PATCH]=20= configure:=20Disable=20jit=20for=20cross-compilers.=0A=0AIt=20is=20not=20= clear=20how=20this=20is=20going=20to=20be=20used=20with=20a=20= cross-compiler=20since=0Athe=20shared=20library=20is=20for=20the=20host,=20= but=20the=20code=20is=20generated=20for=20the=0Atarget.=0A=0A= Signed-off-by:=20Iain=20Sandoe=20=0A=0AChangeLog:=0A=0A= =09*=20configure:=20Regenerate.=0A=09*=20configure.ac:=20Disable=20jit=20= for=20cross-compilers.=0A---=0A=20configure=20=20=20=20|=2044=20= ++++++++++++++++++++++++++------------------=0A=20configure.ac=20|=2043=20= +++++++++++++++++++++++++------------------=0A=202=20files=20changed,=20= 51=20insertions(+),=2036=20deletions(-)=0A=0A=0Adiff=20--git=20= a/configure.ac=20b/configure.ac=0Aindex=20bf416b1705b..ec608fb263e=20= 100644=0A---=20a/configure.ac=0A+++=20b/configure.ac=0A@@=20-2174,12=20= +2174,21=20@@=20if=20test=20-d=20${srcdir}/gcc;=20then=0A=20=20=20=20=20=20= =20=20=20#=20Disable=20jit=20if=20-enable-host-shared=20not=20specified=0A= =20=20=20=20=20=20=20=20=20#=20but=20not=20if=20building=20for=20Mingw.=20= All=20code=20in=20Windows=0A=20=20=20=20=20=20=20=20=20#=20is=20position=20= independent=20code=20(PIC).=0A-=20=20=20=20=20=20=20=20case=20$target=20= in=0A-=20=20=20=20=20=20=20=20=20=20*mingw*)=20;;=0A-=20=20=20=20=20=20=20= =20=20=20*)=0A-=20=20=20=20=20=20=20=20=20=20case=20= ${add_this_lang}:${language}:${host_shared}=20in=0A-=20=20=20=20=20=20=20= =20=20=20=20=20yes:jit:no)=0A-=09=20=20=20=20=20=20=20=20=20=20=20#=20PR=20= jit/64780:=20explicitly=20specify=20--enable-host-shared=0A+=20=20=20=20=20= =20=20=20#=20Also=20disable=20if=20we=20are=20building=20a=20= cross-compiler.=20=20=20=20=20=20=20=20=0A+=09case=20= ${add_this_lang}:${language}:${is_cross_compiler}:${host_shared}:${target}= =20in=0A+=09=20=20yes:jit:yes:*:*)=0A+=09=20=20=20=20AC_MSG_ERROR([jit=20= is=20not=20supported=20for=20cross-compilers])=0A+=20=20=20=20=20=20=20=20= =20=20=20=20add_this_lang=3Dunsupported=0A+=20=20=20=20=20=20=20=20=20=20= =20=20;;=0A+=09=20=20=20all:jit:yes:*:*=20)=0A+=09=20=20=20=20= AC_MSG_WARN([jit=20is=20not=20supported=20for=20cross-compilers])=0A+=20=20= =20=20=20=20=20=20=20=20=20=20add_this_lang=3Dunsupported=0A+=20=20=20=20= =20=20=20=20=20=20=20=20;;=0A+=20=20=20=20=20=20=20=20=20=20= yes:jit:no:*:*mingw*=20|=20all:jit:no:*:*mingw*)=0A+=20=20=20=20=20=20=20= =20=20=20=20=20#=20Windows=20code=20is=20always=20PIC,=20so=20OK.=0A+=20=20= =20=20=20=20=20=20=20=20=20=20;;=0A+=20=20=20=20=20=20=20=20=20=20= yes:jit:no:no:*)=0A+=09=20=20=20=20#=20PR=20jit/64780:=20explicitly=20= specify=20--enable-host-shared=0A=20=09=20=20=20=20AC_MSG_ERROR([=0A=20= Enabling=20language=20"jit"=20requires=20--enable-host-shared.=0A=20=0A= @@=20-2190,18=20+2199,16=20@@=20If=20you=20want=20to=20build=20both=20= the=20jit=20and=20the=20regular=20compiler,=20it=20is=20often=0A=20best=20= to=20do=20this=20via=20two=20separate=20configure/builds,=20in=20= separate=0A=20directories,=20to=20avoid=20imposing=20the=20performance=20= cost=20of=0A=20--enable-host-shared=20on=20the=20regular=20compiler.])=0A= -=09=20=20=20=20=20=20=20=20=20=20=20=20;;=0A-=20=20=20=20=20=20=20=20=20= =20=20=20all:jit:no)=0A-=09=20=20=20=20=20=20= AC_MSG_WARN([--enable-host-shared=20required=20to=20build=20$language])=0A= -=20=20=20=20=20=20=20=20=20=20=20=20=20=20add_this_lang=3Dunsupported=0A= -=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=0A-=20=20=20=20=20=20=20=20= =20=20=20=20*:jit:no)=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20#=20= Silently=20disable.=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20= add_this_lang=3Dunsupported=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20= ;;=0A-=09=20=20=20=20=20=20=20=20esac=0A-=20=20=20=20=20=20=20=20=20=20= ;;=0A-=20=20=20=20=20=20=20=20esac=0A+=09=20=20=20=20;;=0A+=20=20=20=20=20= =20=20=20=20=20all:jit:no:no:*)=0A+=09=20=20=20=20= AC_MSG_WARN([--enable-host-shared=20required=20to=20build=20$language])=0A= +=20=20=20=20=20=20=20=20=20=20=20=20add_this_lang=3Dunsupported=0A+=20=20= =20=20=20=20=20=20=20=20=20=20;;=0A+=09=20=20*:jit:no:no:*)=0A+=09=20=20=20= =20#=20Silently=20disable.=0A+=20=20=20=20=20=20=20=20=20=20=20=20= add_this_lang=3Dunsupported=0A+=20=20=20=20=20=20=20=20=20=20=20=20;;=0A= +=09esac=0A=20=0A=20=20=20=20=20=20=20=20=20#=20Disable=20a=20language=20= that=20is=20unsupported=20by=20the=20target.=0A=20=09case=20= "${add_this_lang}:=20$unsupported_languages=20"=20in=0A--=20=0A2.24.3=20= (Apple=20Git-128)=0A=0A= --Apple-Mail=_2EE6CCFA-FDB6-4FED-9992-019F5006AA88--