From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Gerd_M=C3=B6llmann?= Newsgroups: gmane.emacs.devel Subject: Re: MPS: Problem with dynamic modules Date: Mon, 20 May 2024 15:23:21 +0200 Message-ID: References: <868r06aqf4.fsf@gnu.org> <8634qdbyni.fsf@gnu.org> <86zfslahqf.fsf@gnu.org> <86o790aei6.fsf@gnu.org> <86ed9wab04.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="blaine.gmane.org:116.202.254.214"; logging-data="22576"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: dancol@dancol.org, eller.helmut@gmail.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon May 20 15:24:37 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 1s930E-0005Yv-Sw for ged-emacs-devel@m.gmane-mx.org; Mon, 20 May 2024 15:24:34 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s92zE-0002k9-AA; Mon, 20 May 2024 09:23:32 -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 1s92zB-0002jY-T4 for emacs-devel@gnu.org; Mon, 20 May 2024 09:23:29 -0400 Original-Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s92z9-0002KE-4W; Mon, 20 May 2024 09:23:28 -0400 Original-Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-5755fafa5a7so2257861a12.1; Mon, 20 May 2024 06:23:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716211403; x=1716816203; darn=gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=n5wbgCKoQh56SELkrkPrvw36ZPBo9kYJJN+05Ws8Ruc=; b=jgP4v/F4xCUmnJmyq6JKiiw3uSMpsu5pyEWJCD0i14JwszlhFJTaq1fm0uRfXgNkCw npe9bXfSn45UJinTbbknoLi7NRqF5egCCMuRWVIP+h47QPGPm0R7PdFXTUc1PAOGnfSj JvpUtMCNDrXdXM3MpbXqxGHjHquEugW7F5pZ6UYl/tCuv11M9eFcFxGF/qwNm45ZiHmS JizYMhH4RKdbEh8y1pGrHw5xMLMZynRMfyqUUx4t31qCUxfhxyq9S0ymZ2rMvNGdP64h 1d3SoB48dISKFcyqG02ENfkzFp1RBjHLTYnPdH7mEo0z7VedILRy822ikizAjSukvahK H8gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716211403; x=1716816203; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=n5wbgCKoQh56SELkrkPrvw36ZPBo9kYJJN+05Ws8Ruc=; b=gqkUDAvJvaHF+5EDT1b6t1XETdW3iVGX0XQ0bgLYHPwcwdlTQ4UUmsB919gzUcvkaK /l65tgo/rhdntf1Jo8qNi/DCWZ6Drq5NX0sWTC+XLqV9R0aE2+qqARg8eAcB3+GiZgz8 BC7xuQ4oHFA5ScVUlGMJVX0NVXTbufuJzX2pQ7t4JhRbcR0/5zdt8I+tZqNRCqCoVUMx TwSEyFwT5YH95K6L3Xq2zOp+mnAvUCMpCSULQcJq+17Nr7/urJ+/PMIu3S6zeeaBHyF/ Vi5zpJyx65NOPxcw+ORBtYyN6ArjEhgtt6RpVQmX1c2OF6Qzbcgj/3KaaFWE9tzBUBk7 LjLw== X-Forwarded-Encrypted: i=1; AJvYcCXzBwqIZagxX2m5v82KLJaLmDTS0uzeAnBm4oS2JHZa4Tyvdp8GI3vFuVVHPsWc3rEcAN9vDwndMzvq9kEL6W+Wuvhp X-Gm-Message-State: AOJu0Yy7zRzfM9O8kHL0AS4Scw+U8llh8gcopobT1WNZ1PYukttVy22n VIoH3ekaJ3ruLojrWFDj8VgjbkfKNlKtHQWYWLskyKjzMDREdBUf/aOPkw== X-Google-Smtp-Source: AGHT+IGt0LYD+/6zuU3cPHjbtmWFODzEqoQCafLnTKUYQmJRSVVgwbPrP4ggiazdz5vMvWJJgcYAuA== X-Received: by 2002:a50:cc48:0:b0:573:5c4c:a87a with SMTP id 4fb4d7f45d1cf-5735c4ca8b7mr18057534a12.27.1716211403055; Mon, 20 May 2024 06:23:23 -0700 (PDT) Original-Received: from pro2.fritz.box (pd9e36556.dip0.t-ipconnect.de. [217.227.101.86]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5733c323887sm15110497a12.89.2024.05.20.06.23.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 06:23:22 -0700 (PDT) In-Reply-To: <86ed9wab04.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 20 May 2024 16:06:19 +0300") Received-SPF: pass client-ip=2a00:1450:4864:20::536; envelope-from=gerd.moellmann@gmail.com; helo=mail-ed1-x536.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, 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:319419 Archived-At: Eli Zaretskii writes: >> From: Gerd M=C3=B6llmann >> Cc: dancol@dancol.org, eller.helmut@gmail.com, emacs-devel@gnu.org >> Date: Mon, 20 May 2024 14:07:19 +0200 >>=20 >> Eli Zaretskii writes: >>=20 >> > 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. >>=20 >> Because of this >>=20 >> 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; >> } >>=20 >> 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.