From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lynn Winebarger Newsgroups: gmane.emacs.devel Subject: Re: Suppressing native compilation (short and long term) Date: Sun, 16 Oct 2022 07:55:21 -0400 Message-ID: References: <87ill8paw7.fsf@trouble.defaultvalue.org> <83o7uzivey.fsf@gnu.org> <3ac9d2b9632f75018327a1bcde0c373f152c404a.camel@gmail.com> <835ygob7ja.fsf@gnu.org> <8335bra2rl.fsf@gnu.org> <87ilkncugg.fsf@gnus.org> <83zgdz7x8u.fsf@gnu.org> <83leph7e4c.fsf@gnu.org> <83y1th5fe7.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000058d5cf05eb2589df" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12440"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Stefan Monnier , Andrea Corallo , Lars Ingebrigtsen , liliana.prikler@gmail.com, rlb@defaultvalue.org, emacs-devel To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Oct 16 13:56:34 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ok2Ft-0002zl-5y for ged-emacs-devel@m.gmane-mx.org; Sun, 16 Oct 2022 13:56:33 +0200 Original-Received: from localhost ([::1]:51716 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ok2Fr-0007Iz-SV for ged-emacs-devel@m.gmane-mx.org; Sun, 16 Oct 2022 07:56:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43740) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ok2F0-0006Sp-C7 for emacs-devel@gnu.org; Sun, 16 Oct 2022 07:55:38 -0400 Original-Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]:46700) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ok2Ey-0003AG-Eo; Sun, 16 Oct 2022 07:55:37 -0400 Original-Received: by mail-pj1-x1030.google.com with SMTP id t12-20020a17090a3b4c00b0020b04251529so8634623pjf.5; Sun, 16 Oct 2022 04:55:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=by79sDUgdsyB/Ep3b/6ob8FQvMQDt/5fTMt83dXwZGs=; b=NOSdEqgMI1nnOi9d24cqar+7gbcQaeVYsM+7CaE0DEyiz1GHi+GU+hyy3QCoPR+g2N m64q6O5J7MMDIDutuXI7QwcZRxg38qrJXziuJ7AJAaPjrdRDZa12Q27dTQV2o8TwvgMR TDIEV8oRFoFLyCJopJREhyzUyUv8PfvtUNUR1FwQbOSo0xzB8KGRB0f+t1hDiSvmPWmP l5JzYHDC5mmiGPQVUpoeyPQve3Ksxh499+B1aCNMreJvP1hx54XSgI1bEY5CZENQryvk YAMyUchipsmzB7EHNWzLR7WjVIKeme4K843oAAL/o+Ip4YPyj7e1A+6QIVNMN/J6PkZq QAyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=by79sDUgdsyB/Ep3b/6ob8FQvMQDt/5fTMt83dXwZGs=; b=o6pbQ18Y4YmpQaRFeRidtet+2dfWYZn00Xj9+WLypVt6FCgkYEfX2ZRDr6DFNUQADr Yzoz8n4j2dBeWfyI9lOmgAvfcbOjgslx8xWO8lC9GvcQBKWJnhWz1V8ZmhU6v2p+E4wI zPG2wdHR2eyszIiMeVz8OIabbtdJ6tn7R4AovsuuSJwxHlgwNbfsOJKR0JxBlIMLr5pD K5+nUPOwncmdYYWKAoYE4dRAFPx9QR38T3IgXAGh0S3KCFwIm5voZKZsYEqzYkyF4piG +irAy5lLuGpY6j3gm3rGNF4NeFF/XLQJ0+mf7q7XAllpPVidlnNw/7wqCoQ8XldJ6hXw 1BZA== X-Gm-Message-State: ACrzQf1RBywHhsHF5yzhWifqeJp7+HxPg0t0pfggoEuxzBM5hHz0F7Ly hwX73krb0xAXc+wdCXCV6xm59VULQnqb4Jvkiv/34WNy4wk= X-Google-Smtp-Source: AMsMyM7pkgs/ofjtumvFwm24MDw+cCKAmgft/ybqk4JPPMbX46AX1Qwn9Ocg2OcuuZ68f4YQPzyxybc8EkwB5z7ylUY= X-Received: by 2002:a17:90b:1644:b0:20b:aa58:125c with SMTP id il4-20020a17090b164400b0020baa58125cmr8090097pjb.110.1665921334169; Sun, 16 Oct 2022 04:55:34 -0700 (PDT) In-Reply-To: <83y1th5fe7.fsf@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::1030; envelope-from=owinebar@gmail.com; helo=mail-pj1-x1030.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, FREEMAIL_REPLY=1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:297861 Archived-At: --00000000000058d5cf05eb2589df Content-Type: text/plain; charset="UTF-8" On Sat, Oct 15, 2022, 10:29 AM Eli Zaretskii wrote: > > From: Lynn Winebarger > > Date: Sat, 15 Oct 2022 10:10:23 -0400 > > Cc: Eli Zaretskii , Andrea Corallo , Lars > Ingebrigtsen , > > liliana.prikler@gmail.com, rlb@defaultvalue.org, > > emacs-devel > > > > Didn't you, a couple of years ago, suggest generating generic > trampolines (per function signature), compile > > those with gccjit, then just use them as needed rather than compiling > separate trampolines for every subr? > > Presumably the system would still occasionally need to compile a > trampoline for a new signature, but the > > generic trampoline would not be named so it couldn't cause an infinite > recursion by being advised before > > being compiled. > > If we want to compile all the trampolines AOT, that is already > possible in Emacs 29, one just needs to actually do it when building > Emacs. > The question was about whether trampolines could be designed in such a way as to avoid invoking a separate compiler process without requiring architecture-dependent binary hacking on templates. I believe I was recalling one of Stefan M's suggestions for just this problem from a couple of years ago. Also, my understanding from this conversation is that trampolines may be required at run-time that aren't known at build-time. The issue is when the advised function is somehow called by the compiler while compiling it's own trampoline. Since the call may come from the advised version of some function used by the compiler, it's difficult to limit the risk without controlling both the dump and the startup/configuration files. Lynn --00000000000058d5cf05eb2589df Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Sat, Oct 15, 2022, 10:29 AM Eli Zaretskii <eliz@gnu.org> wrote:
> From: Lynn Winebarger <owinebar@gmail.com>
> Date: Sat, 15 Oct 2022 10:10:23 -0400
> Cc: Eli Zaretskii <eliz@gnu.org>, Andrea Corallo <akrl@sdf.org>= ;, Lars Ingebrigtsen <larsi@gnus.org>,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0liliana.prikler@gmail.com, rlb@= defaultvalue.org,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0emacs-devel <emacs-devel@gnu.org>=
>
> Didn't you, a couple of years ago, suggest generating generic tram= polines (per function signature), compile
> those with gccjit, then just use them as needed rather than compiling = separate trampolines for every subr?
> Presumably the system would still occasionally need to compile a tramp= oline for a new signature, but the
> generic trampoline would not be named so it couldn't cause an infi= nite recursion by being advised before
> being compiled.

If we want to compile all the trampolines AOT, that is already
possible in Emacs 29, one just needs to actually do it when building
Emacs.

The question was about whether trampolines could be designed in such = a way as to avoid invoking a separate compiler process without requiring ar= chitecture-dependent binary hacking on templates.
I = believe I was recalling one of Stefan M's suggestions for just this pro= blem from a couple of years ago.=C2=A0=C2=A0
Also, m= y understanding from this conversation is that trampolines may be required = at run-time that aren't known at build-time.=C2=A0 The issue is when th= e advised function is somehow called by the compiler while compiling it'= ;s own trampoline.=C2=A0 Since the call may come from the advised version o= f some function used by the compiler, it's difficult to limit the risk = without controlling both the dump and the startup/configuration files.

Lynn
=
--00000000000058d5cf05eb2589df--