From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.bugs Subject: bug#41242: Port feature/native-comp to Windows - Reduce the number of files probed when finding a lisp file. Date: Tue, 02 Jun 2020 23:08:16 +0000 Message-ID: References: <83blm1eciw.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="3608"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) Cc: 41242@debbugs.gnu.org To: Nicolas =?UTF-8?Q?B=C3=A9rtolo?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 03 01:09:10 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1jgG1u-0000pp-CK for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 03 Jun 2020 01:09:10 +0200 Original-Received: from localhost ([::1]:37106 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jgG1t-0007bu-4S for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 02 Jun 2020 19:09:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56842) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jgG1m-0007bn-TQ for bug-gnu-emacs@gnu.org; Tue, 02 Jun 2020 19:09:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57964) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jgG1m-0000YK-KT for bug-gnu-emacs@gnu.org; Tue, 02 Jun 2020 19:09:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jgG1m-0007AE-GD for bug-gnu-emacs@gnu.org; Tue, 02 Jun 2020 19:09:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 02 Jun 2020 23:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41242 X-GNU-PR-Package: emacs Original-Received: via spool by 41242-submit@debbugs.gnu.org id=B41242.159113930827498 (code B ref 41242); Tue, 02 Jun 2020 23:09:02 +0000 Original-Received: (at 41242) by debbugs.gnu.org; 2 Jun 2020 23:08:28 +0000 Original-Received: from localhost ([127.0.0.1]:41277 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jgG18-00079O-HN for submit@debbugs.gnu.org; Tue, 02 Jun 2020 19:08:27 -0400 Original-Received: from mx.sdf.org ([205.166.94.20]:53487) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jgG16-00079C-EU for 41242@debbugs.gnu.org; Tue, 02 Jun 2020 19:08:21 -0400 Original-Received: from sdf.org (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 052N8GBe004429 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Tue, 2 Jun 2020 23:08:16 GMT Original-Received: (from akrl@localhost) by sdf.org (8.15.2/8.12.8/Submit) id 052N8GpY016810; Tue, 2 Jun 2020 23:08:16 GMT In-Reply-To: ("Nicolas =?UTF-8?Q?B=C3=A9rtolo?="'s message of "Tue, 2 Jun 2020 18:17:38 -0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:181434 Archived-At: Nicolas B=C3=A9rtolo writes: > Hi, > > The recent patches broke the Windows build. There is one patch that > fixes it and another one that improves the way to check for the gccjit ve= rsion > functions. I've pushed "Fix DLL imports of gccjit version functions." on the second I've some perplexity. > Nico. > From 8aa7673f626bfa2c12e6f9c8bbec102ce2fb72d1 Mon Sep 17 00:00:00 2001 > From: =3D?UTF-8?q?Nicol=3DC3=3DA1s=3D20B=3DC3=3DA9rtolo?=3D > Date: Mon, 1 Jun 2020 19:56:37 -0300 > Subject: [PATCH 2/2] Remove kludge for detecting if gcc_jit_version_major= can > be called. > > * src/comp.c (comp-libgccjit-version): Use 'dlsym' in Posix and the > normal function loading mechanism in Windows. > --- > src/comp.c | 23 ++++++++++++++--------- > 1 file changed, 14 insertions(+), 9 deletions(-) > > diff --git a/src/comp.c b/src/comp.c > index 8e7582b3e65..084d0b6745b 100644 > --- a/src/comp.c > +++ b/src/comp.c > @@ -365,6 +365,8 @@ #define gcc_jit_version_major fn_gcc_jit_version_major > #define gcc_jit_version_minor fn_gcc_jit_version_minor > #define gcc_jit_version_patchlevel fn_gcc_jit_version_patchlevel >=20=20 > +#else > +#include > #endif >=20=20 > static bool > @@ -3999,15 +4001,18 @@ DEFUN ("comp-libgccjit-version", Fcomp_libgccjit_= version, > #if defined (LIBGCCJIT_HAVE_gcc_jit_version) || defined (WINDOWSNT) > load_gccjit_if_necessary (true); >=20=20 > - /* FIXME this kludge is quite bad. Can we dynamically load on all > - operating systems? */ > -#pragma GCC diagnostic ignored "-Waddress" > - return gcc_jit_version_major > - ? list3 (make_fixnum (gcc_jit_version_major ()), > - make_fixnum (gcc_jit_version_minor ()), > - make_fixnum (gcc_jit_version_patchlevel ())) > - : Qnil; > -#pragma GCC diagnostic pop > + bool ok_to_call; > + > +#if defined (WINDOWSNT) > + ok_to_call =3D !!fn_gcc_jit_version_major; > +#else > + ok_to_call =3D !!dlsym (RTLD_DEFAULT, "gcc_jit_version_major"); > +#endif > + > + return ok_to_call ? list3 (make_fixnum (gcc_jit_version_major ()), > + make_fixnum (gcc_jit_version_minor ()), > + make_fixnum (gcc_jit_version_patchlevel ())) > + : Qnil; > #else > return Qnil; > #endif First given is giving away two pragmas for adding three preprocessor directives I'd say it is adding more kludge then what is removing. Second this code would fail both link time and load time if the linker cannot resolve one of these three functions making the test on the result of dlsym in the run time pointless. To work one needs to go through function pointers as you are doing in Window, but some macrology is requested otherwise would be a kludge^2. Andrea --=20 akrl@sdf.org