From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: MPS: Problem with dynamic modules Date: Mon, 20 May 2024 16:06:19 +0300 Message-ID: <86ed9wab04.fsf@gnu.org> References: <868r06aqf4.fsf@gnu.org> <8634qdbyni.fsf@gnu.org> <86zfslahqf.fsf@gnu.org> <86o790aei6.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="blaine.gmane.org:116.202.254.214"; logging-data="7537"; mail-complaints-to="usenet@ciao.gmane.io" Cc: dancol@dancol.org, eller.helmut@gmail.com, emacs-devel@gnu.org To: Gerd =?utf-8?Q?M=C3=B6llmann?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon May 20 15:07:20 2024 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 1s92jX-0001jH-Nr for ged-emacs-devel@m.gmane-mx.org; Mon, 20 May 2024 15:07:19 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s92ir-0005uu-IQ; Mon, 20 May 2024 09:06:37 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s92in-0005uS-4h for emacs-devel@gnu.org; Mon, 20 May 2024 09:06:33 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s92ik-0007CF-IL; Mon, 20 May 2024 09:06:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=uA7VFQCdJ2y+tr0LKSwW6T5pKfLHfUbE9pg4hJXrNq8=; b=qCnk20M39N6Ci2a4sXxk AYgvg5S5LQtr3p0RlGOGElBvacYmWNUFDd4BljCqKl/1KiVpBFjCE8QnBzFdUw5IV7z1csKQpKwjA R/wwUQlaJ7Tns4XhIWH4Ht0yQZAVFeovlY5sHz69ZuRPS/lgPIOIBcXdjWc86caAUBX0CCfNHUwVp DHe6Bq1GnIctIGVniAgUiq1I+WUxHrVydsHyMPCgDrsaK0Ik0zTz6YZurf7QtnFhos+lKk8XKh3+g 4UOfWBoYL63cRlpkz+DEUQ83YuFKicHKB1g1nRFH778XFEBQDSJn7IE98BOpFBEmF3oQ2IJYpUV16 Ry35X0CHQ0sqYQ==; In-Reply-To: (message from Gerd =?utf-8?Q?M=C3=B6llmann?= on Mon, 20 May 2024 14:07:19 +0200) 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:319417 Archived-At: > From: Gerd Möllmann > Cc: dancol@dancol.org, eller.helmut@gmail.com, emacs-devel@gnu.org > Date: Mon, 20 May 2024 14:07:19 +0200 > > Eli Zaretskii writes: > > > I tried to run the emacs-module test, but it doesn't compile here: > > > > CCLD src/emacs-module-resources/mod-test.dll > > make[1]: Entering directory `/d/gnu/git/emacs/feature/test' > > In file included from src/emacs-module-resources/mod-test.c:47: > > ../src/emacs-module.h:1120:26: error: unknown type name 'Lisp_Object' > > 1120 | struct emacs_value_tag { Lisp_Object v; }; > > | ^~~~~~~~~~~ > > ../src/emacs-module.h:1128:27: error: field 'header' has incomplete type > > 1128 | union vectorlike_header header; > > | ^~~~~~ > > > > Does it compile for you? Why did you move the emacs_value_tag stuff > > from emacs-module.c (which is compiled as part of Emacs) to > > emacs-module.h (which is included by modules, which aren't supposed to > > know about Lisp_Object, they are supposed to use emacs_value instead. > > But not a module cannot be compiled without including lisp.h, which I > > think is wrong. > > Because of this > > static mps_res_t > fix_global_ref (mps_ss_t ss, struct module_global_reference *r) > { > MPS_SCAN_BEGIN (ss) > { > IGC_FIX_CALL_FN (ss, struct Lisp_Vector, r, fix_vectorlike); > IGC_FIX12_OBJ (ss, &r->value.v); > } > MPS_SCAN_END (ss); > return MPS_RES_OK; > } > > a longer time ago. What would be a good fix? Move fix_global_ref (or at least its part that knows about module_global_reference) to emacs-module.c? There's a tangled web of data types there, and I don't know which ones are important (e.g., does IGC_FIX_CALL_FN really need to know the data type of client_addr?), but I'm quite sure some way of using an opaque data type can work here. AFAIU, all you need is to supply to IGC_FIX_CALL_FN a value that it will pass to fix_global_ref, and it looks to me like both of them treat those as 'void *' pointers. So the actual type is not really important, is it?