C++ Logo

sg15

Advanced search

Re: Provide build systems with ways to build the std(.compat) modules

From: Tom Honermann <tom_at_[hidden]>
Date: Tue, 11 Jul 2023 16:07:10 -0400
On 7/11/23 2:44 PM, Ben Boeckel wrote:
> On Tue, Jul 11, 2023 at 11:10:33 -0400, Tom Honermann wrote:
>> On 7/11/23 10:23 AM, Ben Boeckel wrote:
>>> My probing question is: how to satisfy the ODR for the module
>>> initialization function called on `import`?
>> What module initialization function? The standard doesn't specify one.
> Hmm. I can't find the wording that I remember, but it's about the rule
> that (maybe removed?) imported modules' statics are initialized before
> the importing module's globals. This is implemented via a function call
> inserted into the importer's initializer:
>
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105397

That seems doable via a COMDAT section that could be present in each
importer and in any object file created for the MIU.

Tom.

>
> --Ben

Received on 2023-07-11 20:07:13