From: "Gerd Möllmann" <gerd.moellmann@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: dancol@dancol.org, eller.helmut@gmail.com, emacs-devel@gnu.org
Subject: Re: MPS: Problem with dynamic modules
Date: Mon, 20 May 2024 15:23:21 +0200 [thread overview]
Message-ID: <m25xv8d3cm.fsf@pro2.fritz.box> (raw)
In-Reply-To: <86ed9wab04.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 20 May 2024 16:06:19 +0300")
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Gerd Möllmann <gerd.moellmann@gmail.com>
>> Cc: dancol@dancol.org, eller.helmut@gmail.com, emacs-devel@gnu.org
>> Date: Mon, 20 May 2024 14:07:19 +0200
>>
>> Eli Zaretskii <eliz@gnu.org> 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?
Probably not, but we also need MPS data types and macros like
MPS_FIX_CALL. That's a PITA, because it means that wherever that
function wanders, that place will need to include MPS headers, and maybe
macros from igc.
Isn't there something easier? Can emacs_value_tag be changed to
something containing s struct Lisp_X *, for example? I think that's what
native comp does, at least judging from the C that it generates.
next prev parent reply other threads:[~2024-05-20 13:23 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-19 13:01 MPS: Problem with dynamic modules Gerd Möllmann
2024-05-19 13:21 ` Eli Zaretskii
2024-05-19 13:58 ` Gerd Möllmann
2024-05-19 15:37 ` Eli Zaretskii
2024-05-19 16:17 ` Gerd Möllmann
2024-05-19 16:28 ` Eli Zaretskii
2024-05-19 16:47 ` Gerd Möllmann
2024-05-20 5:35 ` Gerd Möllmann
2024-05-20 11:50 ` Eli Zaretskii
2024-05-20 12:07 ` Gerd Möllmann
2024-05-20 13:06 ` Eli Zaretskii
2024-05-20 13:23 ` Gerd Möllmann [this message]
2024-05-20 13:50 ` Eli Zaretskii
2024-05-21 7:56 ` Andrea Corallo
2024-05-21 8:25 ` Gerd Möllmann
2024-05-21 10:26 ` Andrea Corallo
2024-05-21 11:49 ` Gerd Möllmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m25xv8d3cm.fsf@pro2.fritz.box \
--to=gerd.moellmann@gmail.com \
--cc=dancol@dancol.org \
--cc=eliz@gnu.org \
--cc=eller.helmut@gmail.com \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).