From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] [WIP] Port feature/native-comp to Windows. Date: Sat, 09 May 2020 19:15:07 +0300 Message-ID: <83o8qxdr04.fsf@gnu.org> References: <5eb5b953.1c69fb81.a67ce.a764@mx.google.com> <83sgg9drx1.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="18998"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org, akrl@sdf.org To: Nicolas =?utf-8?Q?B=C3=A9rtolo?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat May 09 18:16:05 2020 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 1jXS8z-0004rG-EZ for ged-emacs-devel@m.gmane-mx.org; Sat, 09 May 2020 18:16:05 +0200 Original-Received: from localhost ([::1]:38964 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jXS8x-0005qf-V3 for ged-emacs-devel@m.gmane-mx.org; Sat, 09 May 2020 12:16:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50970) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jXS8E-0005Df-JW for emacs-devel@gnu.org; Sat, 09 May 2020 12:15:18 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:54896) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jXS8E-0001xW-AZ; Sat, 09 May 2020 12:15:18 -0400 Original-Received: from [176.228.60.248] (port=4820 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jXS8C-0008TH-H1; Sat, 09 May 2020 12:15:17 -0400 In-Reply-To: (message from Nicolas =?utf-8?Q?B=C3=A9rtolo?= on Sat, 9 May 2020 13:07:44 -0300) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:249497 Archived-At: > From: Nicolas BĂ©rtolo > Date: Sat, 9 May 2020 13:07:44 -0300 > Cc: Andrea Corallo , emacs-devel@gnu.org > > > Can you tell the details? Where does the freloc table come into play > > in this context? > > It does not. It was a question to Andrea because I do not understand why we > can't use the OS dynamic linker. It is not related to the MSYS issue. > The freloc table stores a bunch of function pointers to internal Emacs > functions. > I think it would be cleaner to just declare each of those functions as an > "IMPORTED" function, which is equivalent to adding a line like this to > the generated code: > > extern T a_function(T1, T2, ... Tn); > > Then the dynamic linker will wire things together when loading the eln file. > Maybe I am missing something about how dynamic linking works. There's an issue here due to the differences in how shared libraries are loaded on Posix platforms and on MS-Windows. Andrea probably doesn't know how this is done on MS-Windows. I'm sorry to ask questions about the native-comp branch, I don't remember the details: how does it load the *.eln files? Does it use dlopen and dlsym? If so, we should do the same on Windows, which means functions from *.eln will be called via a function pointer and not directly. Calling functions from *.eln files directly is less desirable, as that will require import libraries and other similar atrocities.