public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug modula2/108261] New: modula-2 module registration process seems to fail with shared libraries.
@ 2023-01-01 17:14 iains at gcc dot gnu.org
  2023-01-01 17:16 ` [Bug modula2/108261] " iains at gcc dot gnu.org
                   ` (28 more replies)
  0 siblings, 29 replies; 30+ messages in thread
From: iains at gcc dot gnu.org @ 2023-01-01 17:14 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108261

            Bug ID: 108261
           Summary: modula-2 module registration process seems to fail
                    with shared libraries.
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: modula2
          Assignee: gaius at gcc dot gnu.org
          Reporter: iains at gcc dot gnu.org
  Target Milestone: ---

After fixing PR108259 so that linking against the shared libm2* libraries
works, a simple Hello World bow fails thus:

$ ./hm
/src-local/gcc-master-patched/libgm2/libm2iso/../../gcc/m2/gm2-libs-iso/RTentity.mod:244:in
findChildAndParent has caused internal runtime error, RTentity is either
corrupt or the module storage has not been initialized yet

Examining the libm2iso and libm2pim libraries, both seem to contain M2RTS which
seems to be a problem - since presumably only one instance of the module
registration system is workable ..?

.. likewise there are other duplicated modules.

... IIUC, the intention is that the link order should determine which SYSTEM.
definition is picked up ..?

... this all seems very fragile to me (except in the static linking case) ... I
wonder if the solution is:

 * to combine the target libraries into one
 * to make the SYSTEM spec something that the FE emits into the primary object
based on the various flags (so that it does not exist in the target library at
all)

 * now we have all the CTORs run from startup . this means that every module in
the shared libraries will be registered (whether it is used or not).

-- perhaps the M2_link() would be better in the end so:
 * remove the __attribute__((constructor)) / DECL_STATIC_CONSTRUCTOR() from the
_xctors
 * call the M2_link() function to get them registered (in arbitrary order) and
then the dependency tree will only be operating on actual used modules?

NOTE: I am guessing to some extent about the intent of various mechanisms here
..

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug modula2/108261] modula-2 module registration process seems to fail with shared libraries.
  2023-01-01 17:14 [Bug modula2/108261] New: modula-2 module registration process seems to fail with shared libraries iains at gcc dot gnu.org
@ 2023-01-01 17:16 ` iains at gcc dot gnu.org
  2023-01-01 17:24 ` iains at gcc dot gnu.org
                   ` (27 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: iains at gcc dot gnu.org @ 2023-01-01 17:16 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108261

--- Comment #1 from Iain Sandoe <iains at gcc dot gnu.org> ---
note that these changes would also simplify the driver (to some extent)
although, I guess the includes have to be adapted to the flags in force?

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug modula2/108261] modula-2 module registration process seems to fail with shared libraries.
  2023-01-01 17:14 [Bug modula2/108261] New: modula-2 module registration process seems to fail with shared libraries iains at gcc dot gnu.org
  2023-01-01 17:16 ` [Bug modula2/108261] " iains at gcc dot gnu.org
@ 2023-01-01 17:24 ` iains at gcc dot gnu.org
  2023-01-01 17:59 ` iains at gcc dot gnu.org
                   ` (26 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: iains at gcc dot gnu.org @ 2023-01-01 17:24 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108261

--- Comment #2 from Iain Sandoe <iains at gcc dot gnu.org> ---
I guess an alternate is to generate a dependent lib with the common code (e.g.
libm2common.so) and then layer the others on top.

However, it's no obvious that the separation into these sub-libraries is
actually saving anything in space (either on disk or in the process) .. so
simplifying the build and install seems a reasonable objective.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug modula2/108261] modula-2 module registration process seems to fail with shared libraries.
  2023-01-01 17:14 [Bug modula2/108261] New: modula-2 module registration process seems to fail with shared libraries iains at gcc dot gnu.org
  2023-01-01 17:16 ` [Bug modula2/108261] " iains at gcc dot gnu.org
  2023-01-01 17:24 ` iains at gcc dot gnu.org
@ 2023-01-01 17:59 ` iains at gcc dot gnu.org
  2023-01-02 13:39 ` iains at gcc dot gnu.org
                   ` (25 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: iains at gcc dot gnu.org @ 2023-01-01 17:59 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108261

--- Comment #3 from Iain Sandoe <iains at gcc dot gnu.org> ---
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
  * frame #0: 0x00000001002c728c libm2iso.17.dylib`findChildAndParent at
RTentity.mod:244:13
    frame #1: 0x00000001002c7848 libm2iso.17.dylib`RTentity_PutKey at
RTentity.mod:112:4
    frame #2: 0x00000001002bf5c0 libm2iso.17.dylib`IOLink_AllocateDeviceId at
IOLink.mod:79:16
    frame #3: 0x00000001002bb87c libm2iso.17.dylib`_M2_ClientSocket_init at
ClientSocket.mod:457:4
    frame #4: 0x00000001002135ec libm2pim.17.dylib`M2Dependent_ConstructModules
at M2Dependent.mod:661:16
    frame #5: 0x0000000100003c98 hm`_M2_init at hello.mod:1:1
    frame #6: 0x0000000100003d04 hm`main at hello.mod:1:1
    frame #7: 0x000000010001508c dyld`start + 520

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug modula2/108261] modula-2 module registration process seems to fail with shared libraries.
  2023-01-01 17:14 [Bug modula2/108261] New: modula-2 module registration process seems to fail with shared libraries iains at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2023-01-01 17:59 ` iains at gcc dot gnu.org
@ 2023-01-02 13:39 ` iains at gcc dot gnu.org
  2023-01-04 16:24 ` iains at gcc dot gnu.org
                   ` (24 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: iains at gcc dot gnu.org @ 2023-01-02 13:39 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108261

Iain Sandoe <iains at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2023-01-02
             Status|UNCONFIRMED                 |NEW

--- Comment #4 from Iain Sandoe <iains at gcc dot gnu.org> ---
(marking as New since I can repeat this on more than one platform)

one other datum:

adding -fscaffold-static makes the shared library version work on both Linux
and Darwin, which seems to support the hypothesis that the problem is to do
with how dynamic initialisation is constructed.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug modula2/108261] modula-2 module registration process seems to fail with shared libraries.
  2023-01-01 17:14 [Bug modula2/108261] New: modula-2 module registration process seems to fail with shared libraries iains at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2023-01-02 13:39 ` iains at gcc dot gnu.org
@ 2023-01-04 16:24 ` iains at gcc dot gnu.org
  2023-01-05 21:10 ` iains at gcc dot gnu.org
                   ` (23 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: iains at gcc dot gnu.org @ 2023-01-04 16:24 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108261

--- Comment #5 from Iain Sandoe <iains at gcc dot gnu.org> ---
this patch exposes the issue by allowing the linker to find the shared libs.

[PATCH] modula-2, driver: Do not add extra '-L' options that shadow
 $libdir.

The driver is adding one '-L' option for each path to libm2xxx.a which is
shadowing $libpath where the shared libraries are installed.  This prevents
the shared libraries from being found (there are also convenience libs
in $libdir, so the additional -L options are not needed).

gcc/m2/ChangeLog:

        * gm2spec.cc (add_default_combination): Do not add extra library
        paths for the libm2xxx.a libraries.
---
 gcc/m2/gm2spec.cc | 1 -
 1 file changed, 1 deletion(-)

diff --git a/gcc/m2/gm2spec.cc b/gcc/m2/gm2spec.cc
index 3c91479df16..4996fa49789 100644
--- a/gcc/m2/gm2spec.cc
+++ b/gcc/m2/gm2spec.cc
@@ -289,7 +289,6 @@ add_default_combination (const char *libpath, const char
*library)
 {
   if (library != NULL)
     {
-      append_option (OPT_L, build_archive_path (libpath, library), 1);
       append_option (OPT_l, safe_strdup (library), 1);
       return true;
     }
--

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug modula2/108261] modula-2 module registration process seems to fail with shared libraries.
  2023-01-01 17:14 [Bug modula2/108261] New: modula-2 module registration process seems to fail with shared libraries iains at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2023-01-04 16:24 ` iains at gcc dot gnu.org
@ 2023-01-05 21:10 ` iains at gcc dot gnu.org
  2023-01-09 15:10 ` gaius at gcc dot gnu.org
                   ` (22 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: iains at gcc dot gnu.org @ 2023-01-05 21:10 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108261

--- Comment #6 from Iain Sandoe <iains at gcc dot gnu.org> ---
and another datum (on x86_64linux):

$ ../gcc-13-0-0p/bin/gm2
/home/iains/gcc-master/src-patched/gcc/testsuite/gm2/coroutines/pim/run/pass/testiotransfer.mod
-flibs=cor,iso,pim -o tio -O

$ LD_LIBRARY_PATH=../gcc-13-0-0p/lib64 ./tio
now to TRANSFER...
clock starting
now to LISTEN
1000 IOTRANSFERs successfully completed
exit 0

$ ../gcc-13-0-0p/bin/gm2
/home/iains/gcc-master/src-patched/gcc/testsuite/gm2/coroutines/pim/run/pass/testiotransfer.mod
-flibs=cor,pim,iso -o tio -O

$ LD_LIBRARY_PATH=../gcc-13-0-0p/lib64 ./tio
../../../../src-patched/libgm2/libm2iso/../../gcc/m2/gm2-libs-iso/RTentity.mod:244:in
findChildAndParent has caused internal runtime error, RTentity is either
corrupt or the module storage has not been initialized yet

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug modula2/108261] modula-2 module registration process seems to fail with shared libraries.
  2023-01-01 17:14 [Bug modula2/108261] New: modula-2 module registration process seems to fail with shared libraries iains at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2023-01-05 21:10 ` iains at gcc dot gnu.org
@ 2023-01-09 15:10 ` gaius at gcc dot gnu.org
  2023-01-09 16:34 ` iains at gcc dot gnu.org
                   ` (21 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: gaius at gcc dot gnu.org @ 2023-01-09 15:10 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108261

--- Comment #7 from Gaius Mulley <gaius at gcc dot gnu.org> ---
Created attachment 54218
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54218&action=edit
Potential fix for target multilib_dir handling (version 4) shared lib fix

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug modula2/108261] modula-2 module registration process seems to fail with shared libraries.
  2023-01-01 17:14 [Bug modula2/108261] New: modula-2 module registration process seems to fail with shared libraries iains at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2023-01-09 15:10 ` gaius at gcc dot gnu.org
@ 2023-01-09 16:34 ` iains at gcc dot gnu.org
  2023-01-09 22:34 ` gaius at gcc dot gnu.org
                   ` (20 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: iains at gcc dot gnu.org @ 2023-01-09 16:34 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108261

--- Comment #8 from Iain Sandoe <iains at gcc dot gnu.org> ---
This is good in that it removes the extra -Ls, but ...

1. This will not work in general for targets with spec substitution for library
names - the library names *do* need to be on the driver line,

2. It will probably not work for -static-libgm2 on Bstatic/dynamic targets
either because those options need to be inserted in the lang-specific driver.

I think it would be quite hard to implement the target-specific changes in the
specs .. 

* The include spec are nicely handled by this change and now they do not appear
in parts of the driver output that does not need them.

* The library driving I *think* still needs to live in the language-specific
driver.

.. I'll add an updated patch later, if that's OK

Unfortunately, I do not think that the library ordering is enough to fix this
PR ..

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug modula2/108261] modula-2 module registration process seems to fail with shared libraries.
  2023-01-01 17:14 [Bug modula2/108261] New: modula-2 module registration process seems to fail with shared libraries iains at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2023-01-09 16:34 ` iains at gcc dot gnu.org
@ 2023-01-09 22:34 ` gaius at gcc dot gnu.org
  2023-01-10  0:01 ` iains at gcc dot gnu.org
                   ` (19 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: gaius at gcc dot gnu.org @ 2023-01-09 22:34 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108261

--- Comment #9 from Gaius Mulley <gaius at gcc dot gnu.org> ---

I wonder if:

0.  change link array to contain elements of
    { char *name, (*fn) module_init, (*fn) module_fini }.

1.  add new option for gm2 -flibname=foo when creating libraries.
    libname is buried inside the object.
    So we can build:
    gm2 -o iso/Storage.o  ../iso/Storage.mod  -flibname=iso
    build libiso from iso/*

    gm2 -o pim/Storage.o  ../pim/Storage.mod  -flibname=pim
    build libpim from pim/*

2.  change the per module ctor to pass the libname in the call to
    M2RTS_RegisterModule (modname, libname: ADDRESS;
                          init, fini: ArgCVEnvP;
                          dependencies: PROC) ;

3.  change M2RTS.def/mod:
       ConstructModules (applicationmodule, flibs: ADDRESS;
                         argc: INTEGER; argv, envp: ADDRESS) ;

4.  driver passes -flibs=pim,iso,etc to cc1gm2
    cc1gm2 emeddeds this string into the main when constructing
    scaffold and call M2RTS_ConstructModules with the string
    -flibs=... as the extra parameter.

5.  M2RTS_ConstructModules uses (in order):

       (a)  contents of link array (if it exists) as a dictionary
            lookup based on name -> init function.
       (b)  if the module name does not exist in the link array then
            it chooses the module which has registered itself and
            whose libname is earliest on the flibs path.

    the driver will have to link the libraries in flibs order to
    choose the dialect specific module versions.


6.  I think we have to retain the m2pimlib.a m2isolib.a as there are
    a few modules with the same name but different interface
    (Storage).  However as you mentioned we could split them:
    -lm2pim -lm2iso -lm2common.  In part this is how they were
    designed (but never split up).  There are a number of rtName
    (runtime) modules:  rtCo, rtEntity etc and these could be expanded
    as required to provide a better layered approach.  The rt modules
    were never expected to be presented to users.

I'm encouraged that -fscaffold-static fixes the shared library usage.
-fscaffold-static is in effect a similar solution to (0) above.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug modula2/108261] modula-2 module registration process seems to fail with shared libraries.
  2023-01-01 17:14 [Bug modula2/108261] New: modula-2 module registration process seems to fail with shared libraries iains at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2023-01-09 22:34 ` gaius at gcc dot gnu.org
@ 2023-01-10  0:01 ` iains at gcc dot gnu.org
  2023-01-11  2:00 ` gaius at gcc dot gnu.org
                   ` (18 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: iains at gcc dot gnu.org @ 2023-01-10  0:01 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108261

--- Comment #10 from Iain Sandoe <iains at gcc dot gnu.org> ---
Initial questions (still digesting the remainder).

--------

when a module has the same name but a different interface are the symbols
distinct (i.e. mangled differently)?

If not:

 - then I can see how it works with static archives - because the static linker
picks the first one presented.
 - but multiple shared libraries in the same process, with the same symbol in
them would seem to be challenging (I'm not sure how the various dynamic loaders
would behave - i.e. the load order might not be sufficient?).

If they are:

 - we could still build a monolithic library; it is up to the FE (presumably in
conjunction with the include paths) to ensure that it references the symbol
that is relevant to the interface style (iso/pim) chosen.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug modula2/108261] modula-2 module registration process seems to fail with shared libraries.
  2023-01-01 17:14 [Bug modula2/108261] New: modula-2 module registration process seems to fail with shared libraries iains at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2023-01-10  0:01 ` iains at gcc dot gnu.org
@ 2023-01-11  2:00 ` gaius at gcc dot gnu.org
  2023-01-11  8:57 ` iains at gcc dot gnu.org
                   ` (17 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: gaius at gcc dot gnu.org @ 2023-01-11  2:00 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108261

--- Comment #11 from Gaius Mulley <gaius at gcc dot gnu.org> ---
> when a module has the same name but a different interface are the
  symbols distinct (i.e. mangled differently)?

no.  So, as you say, the ordering of the static link works fine.  I
had assumed that dynamic libraries also adhered to a similar ordering.
From what we are observing it seems that all the ctors fire but the
API integrity is preserved due to library ordering?  (Or have I
misunderstood dynamic linking?).  (Or worse this might be true on
gnu/linux but not on other platforms?).

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug modula2/108261] modula-2 module registration process seems to fail with shared libraries.
  2023-01-01 17:14 [Bug modula2/108261] New: modula-2 module registration process seems to fail with shared libraries iains at gcc dot gnu.org
                   ` (10 preceding siblings ...)
  2023-01-11  2:00 ` gaius at gcc dot gnu.org
@ 2023-01-11  8:57 ` iains at gcc dot gnu.org
  2023-01-11  9:42 ` iains at gcc dot gnu.org
                   ` (16 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: iains at gcc dot gnu.org @ 2023-01-11  8:57 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108261

--- Comment #12 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Gaius Mulley from comment #11)
> > when a module has the same name but a different interface are the
>   symbols distinct (i.e. mangled differently)?
> 
> no.  So, as you say, the ordering of the static link works fine.  I
> had assumed that dynamic libraries also adhered to a similar ordering.
> From what we are observing it seems that all the ctors fire but the
> API integrity is preserved due to library ordering?  (Or have I
> misunderstood dynamic linking?).  (Or worse this might be true on
> gnu/linux but not on other platforms?).

comment #6 seems to indicate possible issues on linux too? (or I misunderstand)

To find out what's actually happening will mean digging through the init in the
debugger .. 

but yeah, there are clearly some differences (in some way) but honestly I'm not
sure we can say exactly where yet.

(I have a patch in the works that implements the v4 changes using the regular
FE include additions that should fix the relocatable compiler issues + avoid
some of the more intrusive changes ... after that I'll try to look at the init
stuff when next I have some time)

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug modula2/108261] modula-2 module registration process seems to fail with shared libraries.
  2023-01-01 17:14 [Bug modula2/108261] New: modula-2 module registration process seems to fail with shared libraries iains at gcc dot gnu.org
                   ` (11 preceding siblings ...)
  2023-01-11  8:57 ` iains at gcc dot gnu.org
@ 2023-01-11  9:42 ` iains at gcc dot gnu.org
  2023-01-11  9:45 ` iains at gcc dot gnu.org
                   ` (15 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: iains at gcc dot gnu.org @ 2023-01-11  9:42 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108261

--- Comment #13 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Iain Sandoe from comment #12)
> (In reply to Gaius Mulley from comment #11)
> > > when a module has the same name but a different interface are the
> >   symbols distinct (i.e. mangled differently)?
> > 
> > no.  So, as you say, the ordering of the static link works fine.  I
> > had assumed that dynamic libraries also adhered to a similar ordering.
> > From what we are observing it seems that all the ctors fire but the
> > API integrity is preserved due to library ordering?  (Or have I
> > misunderstood dynamic linking?).  (Or worse this might be true on
> > gnu/linux but not on other platforms?).
> 
> comment #6 seems to indicate possible issues on linux too? (or I
> misunderstand)
> 
> To find out what's actually happening will mean digging through the init in
> the debugger .. 

One additional thought, perhaps lazy binding could be responsible; usually
Darwin will not bind symbols on load, but on first use (speeds up startup). 
However there is an option to force bind-on-load (when I get a chance, will try
that - then I suppose that the order of library load should mean that the
symbols are then bound in that order too).

I do not know enough about Linux ld.so to comment on what might happen there.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug modula2/108261] modula-2 module registration process seems to fail with shared libraries.
  2023-01-01 17:14 [Bug modula2/108261] New: modula-2 module registration process seems to fail with shared libraries iains at gcc dot gnu.org
                   ` (12 preceding siblings ...)
  2023-01-11  9:42 ` iains at gcc dot gnu.org
@ 2023-01-11  9:45 ` iains at gcc dot gnu.org
  2023-01-11  9:55 ` iains at gcc dot gnu.org
                   ` (14 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: iains at gcc dot gnu.org @ 2023-01-11  9:45 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108261

--- Comment #14 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Iain Sandoe from comment #13)
> (In reply to Iain Sandoe from comment #12)
> > (In reply to Gaius Mulley from comment #11)
> > > > when a module has the same name but a different interface are the
> > >   symbols distinct (i.e. mangled differently)?
> > > 
> > > no.  So, as you say, the ordering of the static link works fine. 

What if we made them mangle differently?
That might solve a bunch of problems in one go.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug modula2/108261] modula-2 module registration process seems to fail with shared libraries.
  2023-01-01 17:14 [Bug modula2/108261] New: modula-2 module registration process seems to fail with shared libraries iains at gcc dot gnu.org
                   ` (13 preceding siblings ...)
  2023-01-11  9:45 ` iains at gcc dot gnu.org
@ 2023-01-11  9:55 ` iains at gcc dot gnu.org
  2023-01-11 15:02 ` iains at gcc dot gnu.org
                   ` (13 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: iains at gcc dot gnu.org @ 2023-01-11  9:55 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108261

--- Comment #15 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Iain Sandoe from comment #14)
> (In reply to Iain Sandoe from comment #13)
> > (In reply to Iain Sandoe from comment #12)
> > > (In reply to Gaius Mulley from comment #11)
> > > > > when a module has the same name but a different interface are the
> > > >   symbols distinct (i.e. mangled differently)?
> > > > 
> > > > no.  So, as you say, the ordering of the static link works fine. 
> 
> What if we made them mangle differently?
> That might solve a bunch of problems in one go.

or even less complex than that... 
IsoSystem, PimSystem, MinSystem .. etc and have the FE emit that (since it
knows the prevailing dialect)?

(I presume it's not that simple.. of course)

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug modula2/108261] modula-2 module registration process seems to fail with shared libraries.
  2023-01-01 17:14 [Bug modula2/108261] New: modula-2 module registration process seems to fail with shared libraries iains at gcc dot gnu.org
                   ` (14 preceding siblings ...)
  2023-01-11  9:55 ` iains at gcc dot gnu.org
@ 2023-01-11 15:02 ` iains at gcc dot gnu.org
  2023-01-11 15:07 ` gaius at gcc dot gnu.org
                   ` (12 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: iains at gcc dot gnu.org @ 2023-01-11 15:02 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108261

--- Comment #16 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Iain Sandoe from comment #13)
> (In reply to Iain Sandoe from comment #12)
> > (In reply to Gaius Mulley from comment #11)
> > > > when a module has the same name but a different interface are the
> > >   symbols distinct (i.e. mangled differently)?
> > > 
> > > no.  So, as you say, the ordering of the static link works fine.  I
> > > had assumed that dynamic libraries also adhered to a similar ordering.
> > > From what we are observing it seems that all the ctors fire but the
> > > API integrity is preserved due to library ordering?  (Or have I
> > > misunderstood dynamic linking?).  (Or worse this might be true on
> > > gnu/linux but not on other platforms?).
> > 
> > comment #6 seems to indicate possible issues on linux too? (or I
> > misunderstand)
> > 
> > To find out what's actually happening will mean digging through the init in
> > the debugger .. 
> 
> One additional thought, perhaps lazy binding could be responsible; usually
> Darwin will not bind symbols on load, but on first use (speeds up startup). 
> However there is an option to force bind-on-load (when I get a chance, will
> try that 

That did not resolve the problem.

Actually, to come back to the first conversation we had (about the
cross-linking issue) .. the underlying problem is a layering one.

Assuming that multiple symbols with the same name is not reliable in one
process...
... and we cannot (easily) rename one set....

the simplest solution is:
  - define a libm2com.so (containing the modules common to iso and pim.

  - make each of libm2iso and libm2pim depend on libm2com.

 so we have
   if (iso)
     libs = m2iso,m2com
   else
     libs = m2pim,m2com

That means we can get rid of the sledgehammer of "undefined, dynamic_lookup"
and we have no run-time symbols clashes.

We have suggested this before in various discussions .. and I guess it is a
bunch of configure work .. but I am beginning to think it is going to be a lot
less work than trying to solve the unknown issues we have now.

(we can, of course, make the default fscaffold-static as a work-around) but
then scaffold-dynamic is essentially unusable still.)

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug modula2/108261] modula-2 module registration process seems to fail with shared libraries.
  2023-01-01 17:14 [Bug modula2/108261] New: modula-2 module registration process seems to fail with shared libraries iains at gcc dot gnu.org
                   ` (15 preceding siblings ...)
  2023-01-11 15:02 ` iains at gcc dot gnu.org
@ 2023-01-11 15:07 ` gaius at gcc dot gnu.org
  2023-01-11 15:22 ` gaius at gcc dot gnu.org
                   ` (11 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: gaius at gcc dot gnu.org @ 2023-01-11 15:07 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108261

--- Comment #17 from Gaius Mulley <gaius at gcc dot gnu.org> ---
Yes I was coming to the same conclusion (re: name mangling).

If each library module had its mangled name component set via -flibname=pim or
-flibname=iso etc.  Then we have one universe of distinct named modules.

All ctors fire on startup registering themselves with M2RTS
(M2Dependents).

main calls M2RTS to traverse the import graph marking the used
modules.  (From the linking perspective it wouldn't matter if there
were two Storages with different API used by 3rd party libraries etc).

I'm liking the simplicity of the name mangling implementation.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug modula2/108261] modula-2 module registration process seems to fail with shared libraries.
  2023-01-01 17:14 [Bug modula2/108261] New: modula-2 module registration process seems to fail with shared libraries iains at gcc dot gnu.org
                   ` (16 preceding siblings ...)
  2023-01-11 15:07 ` gaius at gcc dot gnu.org
@ 2023-01-11 15:22 ` gaius at gcc dot gnu.org
  2023-01-11 21:10 ` iains at gcc dot gnu.org
                   ` (10 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: gaius at gcc dot gnu.org @ 2023-01-11 15:22 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108261

--- Comment #18 from Gaius Mulley <gaius at gcc dot gnu.org> ---
For the runtime perspective then your layered approach is much cleaner.
It would be good to allow users to be able to use pim and some iso
functionality or visa versa.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug modula2/108261] modula-2 module registration process seems to fail with shared libraries.
  2023-01-01 17:14 [Bug modula2/108261] New: modula-2 module registration process seems to fail with shared libraries iains at gcc dot gnu.org
                   ` (17 preceding siblings ...)
  2023-01-11 15:22 ` gaius at gcc dot gnu.org
@ 2023-01-11 21:10 ` iains at gcc dot gnu.org
  2023-02-14 23:30 ` gaius at gcc dot gnu.org
                   ` (9 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: iains at gcc dot gnu.org @ 2023-01-11 21:10 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108261

--- Comment #19 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Gaius Mulley from comment #18)
> For the runtime perspective then your layered approach is much cleaner.

indeed .. 

> It would be good to allow users to be able to use pim and some iso
> functionality or visa versa.

So we have:

1. some content that is common (unequivocally) = com

2. some content that must be local to iso (it conflicts with 3) = iso

3. some content that must be local to pim (it conflicts with 2) = pim

4. some iso content that could also be used by pim = ixt

5. some pim content that could also be used by iso = pxt

assuming we cannot combine ixt and pxt (because doing so would make it
impossible to have a 'strict' mode)

==== we could avoid a layering violation thus:

fiso (strict) = iso + ixt +  com
fiso (non-strict) = iso + ixt + pxt + com

fpim* (strict?) pim + pxt + com
fpim* (non-strict) pim + pxt + ixt + com


===== still seems overly complex (but workable) ..

Of course, if we can alter the mangling of the iso and pim content so that it
does not conflict .. 

.. then IMO we can just have one combined library and the FE should be
responsible for disallowing interfaces that are not permitted by the selected
dialect.

(i.e. if the code never refers to a disallowed symbol, then it does not matter
if the library contains it.)

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug modula2/108261] modula-2 module registration process seems to fail with shared libraries.
  2023-01-01 17:14 [Bug modula2/108261] New: modula-2 module registration process seems to fail with shared libraries iains at gcc dot gnu.org
                   ` (18 preceding siblings ...)
  2023-01-11 21:10 ` iains at gcc dot gnu.org
@ 2023-02-14 23:30 ` gaius at gcc dot gnu.org
  2023-02-14 23:32 ` gaius at gcc dot gnu.org
                   ` (8 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: gaius at gcc dot gnu.org @ 2023-02-14 23:30 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108261

Gaius Mulley <gaius at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gaius at gcc dot gnu.org

--- Comment #20 from Gaius Mulley <gaius at gcc dot gnu.org> ---
Created attachment 54461
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54461&action=edit
Proposed fix

Here is a proposed fix which implements name mangling using named paths.
The new command line arguments -fm2-pathname=foo and -Im2-prefix=bar are
implemented.  The RTentity uninitialized Storage module has disappeared as both
sets of libraries (m2pim and m2iso) can now co-exist.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug modula2/108261] modula-2 module registration process seems to fail with shared libraries.
  2023-01-01 17:14 [Bug modula2/108261] New: modula-2 module registration process seems to fail with shared libraries iains at gcc dot gnu.org
                   ` (19 preceding siblings ...)
  2023-02-14 23:30 ` gaius at gcc dot gnu.org
@ 2023-02-14 23:32 ` gaius at gcc dot gnu.org
  2023-02-14 23:34 ` gaius at gcc dot gnu.org
                   ` (7 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: gaius at gcc dot gnu.org @ 2023-02-14 23:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108261

--- Comment #21 from Gaius Mulley <gaius at gcc dot gnu.org> ---
For clarity the "RTentity uninitialized Storage module" error has disappeared.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug modula2/108261] modula-2 module registration process seems to fail with shared libraries.
  2023-01-01 17:14 [Bug modula2/108261] New: modula-2 module registration process seems to fail with shared libraries iains at gcc dot gnu.org
                   ` (20 preceding siblings ...)
  2023-02-14 23:32 ` gaius at gcc dot gnu.org
@ 2023-02-14 23:34 ` gaius at gcc dot gnu.org
  2023-02-19 16:59 ` gaius at gcc dot gnu.org
                   ` (6 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: gaius at gcc dot gnu.org @ 2023-02-14 23:34 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108261

Gaius Mulley <gaius at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |WAITING

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug modula2/108261] modula-2 module registration process seems to fail with shared libraries.
  2023-01-01 17:14 [Bug modula2/108261] New: modula-2 module registration process seems to fail with shared libraries iains at gcc dot gnu.org
                   ` (21 preceding siblings ...)
  2023-02-14 23:34 ` gaius at gcc dot gnu.org
@ 2023-02-19 16:59 ` gaius at gcc dot gnu.org
  2023-02-22  0:39 ` gaius at gcc dot gnu.org
                   ` (5 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: gaius at gcc dot gnu.org @ 2023-02-19 16:59 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108261

--- Comment #22 from Gaius Mulley <gaius at gcc dot gnu.org> ---
Created attachment 54486
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54486&action=edit
Proposed fix v3

Here is the latest version of the proposed patch with a new implementation of
RTco.cc

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug modula2/108261] modula-2 module registration process seems to fail with shared libraries.
  2023-01-01 17:14 [Bug modula2/108261] New: modula-2 module registration process seems to fail with shared libraries iains at gcc dot gnu.org
                   ` (22 preceding siblings ...)
  2023-02-19 16:59 ` gaius at gcc dot gnu.org
@ 2023-02-22  0:39 ` gaius at gcc dot gnu.org
  2023-02-23  9:48 ` gaius at gcc dot gnu.org
                   ` (4 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: gaius at gcc dot gnu.org @ 2023-02-22  0:39 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108261

Gaius Mulley <gaius at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #54461|0                           |1
        is obsolete|                            |
  Attachment #54486|0                           |1
        is obsolete|                            |

--- Comment #23 from Gaius Mulley <gaius at gcc dot gnu.org> ---
Created attachment 54504
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54504&action=edit
Proposed fix v4

Version 4 includes bugfix for RTco.cc and -fscaffold-static.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug modula2/108261] modula-2 module registration process seems to fail with shared libraries.
  2023-01-01 17:14 [Bug modula2/108261] New: modula-2 module registration process seems to fail with shared libraries iains at gcc dot gnu.org
                   ` (23 preceding siblings ...)
  2023-02-22  0:39 ` gaius at gcc dot gnu.org
@ 2023-02-23  9:48 ` gaius at gcc dot gnu.org
  2023-02-23 12:07 ` gaius at gcc dot gnu.org
                   ` (3 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: gaius at gcc dot gnu.org @ 2023-02-23  9:48 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108261

Gaius Mulley <gaius at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #54504|0                           |1
        is obsolete|                            |

--- Comment #24 from Gaius Mulley <gaius at gcc dot gnu.org> ---
Created attachment 54515
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54515&action=edit
Proposed fix version 5

The latest version of the pathname patch has been rebased and builds cleanly on
master x86_64 and generates no extra failures.  This version uses an internal
option (rather than a call back from the spec function).  If the gcc.cc/gcc.h
patch is oked the the internal option can be removed.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug modula2/108261] modula-2 module registration process seems to fail with shared libraries.
  2023-01-01 17:14 [Bug modula2/108261] New: modula-2 module registration process seems to fail with shared libraries iains at gcc dot gnu.org
                   ` (24 preceding siblings ...)
  2023-02-23  9:48 ` gaius at gcc dot gnu.org
@ 2023-02-23 12:07 ` gaius at gcc dot gnu.org
  2023-02-23 20:35 ` iains at gcc dot gnu.org
                   ` (2 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: gaius at gcc dot gnu.org @ 2023-02-23 12:07 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108261

Gaius Mulley <gaius at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #54515|0                           |1
        is obsolete|                            |

--- Comment #25 from Gaius Mulley <gaius at gcc dot gnu.org> ---
Created attachment 54516
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54516&action=edit
Proposed fix version 6

Version 6 (more coroutine tests) and RTint.mod with more descriptive variable
names.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug modula2/108261] modula-2 module registration process seems to fail with shared libraries.
  2023-01-01 17:14 [Bug modula2/108261] New: modula-2 module registration process seems to fail with shared libraries iains at gcc dot gnu.org
                   ` (25 preceding siblings ...)
  2023-02-23 12:07 ` gaius at gcc dot gnu.org
@ 2023-02-23 20:35 ` iains at gcc dot gnu.org
  2023-02-25 16:29 ` cvs-commit at gcc dot gnu.org
  2023-02-27 13:34 ` gaius at gcc dot gnu.org
  28 siblings, 0 replies; 30+ messages in thread
From: iains at gcc dot gnu.org @ 2023-02-23 20:35 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108261

--- Comment #26 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Gaius Mulley from comment #25)
> Created attachment 54516 [details]
> Proposed fix version 6
> 
> Version 6 (more coroutine tests) and RTint.mod with more descriptive
> variable names.

This does not solve the timeout issues on Darwin (mentioned here because we
were wondering if the issue was related to init ordering).

-----

Here's a patch that seems to prevent the hangs (but at the expense of a lot of
diagnostic output - it seems modula-2 is somehow calling the OS select with
some bad input) .. I cannot reproduce this calling it from C.

From 92cc7b7c19735ea32e0800b369a2e49f85047e27 Mon Sep 17 00:00:00 2001
From: Iain Sandoe <iain@sandoe.co.uk>
Date: Thu, 23 Feb 2023 09:54:01 +0000
Subject: [PATCH] modula-2 : Some TLC for  select fail case diagnostics

---
 gcc/m2/gm2-libs/RTint.mod | 52 ++++++++++++++++++++++++++-------------
 1 file changed, 35 insertions(+), 17 deletions(-)

diff --git a/gcc/m2/gm2-libs/RTint.mod b/gcc/m2/gm2-libs/RTint.mod
index d8ca8dd5694..796430a55df 100644
--- a/gcc/m2/gm2-libs/RTint.mod
+++ b/gcc/m2/gm2-libs/RTint.mod
@@ -669,6 +669,7 @@ PROCEDURE Listen (untilInterrupt: BOOLEAN;
 VAR
    found: BOOLEAN ;
    r    : INTEGER ;
+   zero,
    after,
    b4,
    t    : Timeval ;
@@ -742,6 +743,7 @@ BEGIN
       ELSE
          GetTime (t, s, m) ;
          Assert (m<Microseconds) ;
+         zero := InitTime (0, 0) ;
          b4 := InitTime (0, 0) ;
          after := InitTime (0, 0) ;
          r := GetTimeOfDay (b4) ;
@@ -762,23 +764,35 @@ BEGIN
             IF r=-1
             THEN
                perror ("select") ;
-               r := select (maxFd+1, i, o, NIL, NIL) ;
-               IF r=-1
+               r := select (maxFd+1, i, o, NIL, zero) ;
+               IF r#-1
                THEN
-                  perror ("select timeout argument is faulty")
-               END ;
-               r := select (maxFd+1, i, NIL, NIL, t) ;
-               IF r=-1
-               THEN
-                  perror ("select output fd argument is faulty")
-               END ;
-               r := select (maxFd+1, NIL, o, NIL, t) ;
-               IF r=-1
-               THEN
-                  perror ("select input fd argument is faulty")
+                  perror ("select timeout argument was faulty")
                ELSE
-                  perror ("select maxFD+1 argument is faulty")
-               END
+                 r := select (maxFd+1, i, NIL, NIL, t) ;
+                 IF r#-1
+                 THEN
+                    perror ("select output fd argument was faulty")
+                 ELSE
+                    r := select (maxFd+1, NIL, o, NIL, t) ;
+                    IF r#-1
+                    THEN
+                       perror ("select input fd argument was faulty")
+                    ELSE
+                       IF maxFd=-1
+                       THEN
+                          r := select (0, NIL, NIL, NIL, t) ;
+                          IF r=-1
+                          THEN
+                             perror ("select does not accept nfds == 0 ") ;
+                             r := 0
+                          END
+                       ELSE
+                          perror ("select maxFD+1 argument was faulty") ;
+                       END
+                    END
+                 END
+              END
             END
          UNTIL r#-1
       END ;
@@ -791,11 +805,15 @@ BEGIN
       END ;
       IF after#NIL
       THEN
-         t := KillTime (after)
+         after := KillTime (after)
       END ;
       IF b4#NIL
       THEN
-         t := KillTime (b4)
+         b4 := KillTime (b4)
+      END ;
+      IF zero#NIL
+      THEN
+         zero := KillTime (zero)
       END ;
       IF i#NIL
       THEN
-- 
2.24.3 (Apple Git-128)

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug modula2/108261] modula-2 module registration process seems to fail with shared libraries.
  2023-01-01 17:14 [Bug modula2/108261] New: modula-2 module registration process seems to fail with shared libraries iains at gcc dot gnu.org
                   ` (26 preceding siblings ...)
  2023-02-23 20:35 ` iains at gcc dot gnu.org
@ 2023-02-25 16:29 ` cvs-commit at gcc dot gnu.org
  2023-02-27 13:34 ` gaius at gcc dot gnu.org
  28 siblings, 0 replies; 30+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-02-25 16:29 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108261

--- Comment #27 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Gaius Mulley <gaius@gcc.gnu.org>:

https://gcc.gnu.org/g:05652ac4e8b8685fe0c0f4ee2f75516d28bbf892

commit r13-6343-g05652ac4e8b8685fe0c0f4ee2f75516d28bbf892
Author: Gaius Mulley <gaiusmod2@gmail.com>
Date:   Sat Feb 25 16:28:19 2023 +0000

    modula-2 module registration process seems to fail with shared libraries
[PR108261]

    The commit adds pathnames to modula-2 which in turn appears in any
    external symbol.  This is necessary to allow different dialects of
    libraries to coexist (different implementations of SYSTEM and Storage
    for example in libm2pim and libm2iso).  It also makes it easier to
    debug as the library name forms part of the external mangled name.
    By default pathnames are not user facing.  This commit fixes
    PR108261.

    gcc/ChangeLog:

            PR modula2/108261
            * doc/gm2.texi (-fm2-pathname): New option documented.
            (-fm2-pathnameI): New option documented.
            (-fm2-prefix=): New option documented.
            (-fruntime-modules=): Update default module list.

    gcc/m2/ChangeLog:

            PR modula2/108261
            * Make-lang.in (GM2-COMP-BOOT-DEFS): DynamicStringPath.def
            remove.  DynamicPath.def add.
            (GM2-COMP-BOOT-MODS): DynamicStringPath.mod remove.
            DynamicPath.mod add.
            * Make-maintainer.in (BUILD-BOOT-PPG-H): New dependency.
            (m2/gm2-ppg-boot/$(SRC_PREFIX)%.o): $(BUILD-BOOT-PPG-H) Add
            dependency.
            (PGE-DEF): New definition.
            (BUILD-BOOT-PG-H): New dependency.
            (m2/gm2-pg-boot/$(SRC_PREFIX)%.o): $(BUILD-BOOT-PG-H) Add
            dependency.
            (BUILD-BOOT-PGE-H): New dependency.
            (m2/gm2-pge-boot/$(SRC_PREFIX)%.o): $(BUILD-BOOT-PGE-H) Add
            dependency.
            (GM2PATH): Add pathname entries.
            (m2/boot-bin/mc-devel$(exeext)): Add m2/mc-boot-ch/Gm2rtsdummy.o
            dependency.
            (m2/boot-bin/mc-opt$(exeext)): Fix -I path.
            * gm2-compiler/DynamicStringPath.def: Renamed module to
            DynamicPath.
            (GetUserPath): Remove.
            (GetSystemPath): Remove.
            (SetUserPath): Remove.
            (SetSystemPath): Remove.
            (DumpPath): New procedure definition.
            * gm2-compiler/DynamicStringPath.mod: Renamed module to
            DynamicPath.
            (GetUserPath): Remove.
            (GetSystemPath): Remove.
            (SetUserPath): Remove.
            (SetSystemPath): Remove.
            (DumpPath): Remove Debugging conditional.
            * gm2-compiler/M2AsmUtil.mod: Import EqualArray, NulName and
            GetLibName.
            (Debugging): New declaration.
            (GetFullSymName): Re-implemented to prefix (mange) libname
            to any extern variable/procedure which is IsExportQualified.
            * gm2-compiler/M2Comp.mod (qprintLibName): New procedure.
            * gm2-compiler/M2Graph.mod (resolveImports): Add libname.
            * gm2-compiler/M2Options.def (SetM2Prefix): New procedure.
            (GetM2Prefix): New procedure function.
            (SetM2PathName): New procedure.
            (GetM2PathName): New procedure function.
            * gm2-compiler/M2Options.mod: (SetM2Prefix): New procedure
implemented.
            (GetM2Prefix): New procedure function implemented.
            (SetM2PathName): New procedure implemented.
            (GetM2PathName): New procedure function implemented.
            (RuntimeModuleOverride): Set to DefaultRuntimeModuleOverride.
            * gm2-compiler/M2Quads.mod: Import GetLibName.
            (SafeRequestSym) Pass result of GetLibName to RequestDependant.
            (callRequestDependant): Add libname as a parameter.
            (BuildM2InitFunction): Add libname as a parameter.
            (BuildM2FiniFunction): Add libname as a parameter.
            (BuildM2CtorFunction): Add libname as a parameter.
            * gm2-compiler/M2Scaffold.mod (LookupModuleSym): Set LibName
            if a definition source was found.
            * gm2-compiler/M2Search.def (FindSourceFile): Add named library
parameter.
            (FindSourceDefFile): Add named library parameter.
            (FindSourceModFile): Add named library parameter.
            * gm2-compiler/M2Search.mod (FindSourceFile): Reimplement.
            (FindSourceDefFile): Add named library parameter.
            (FindSourceModFile): Add named library parameter.
            * gm2-compiler/SymbolTable.def (MakeProcedureCtorExtern): Add
            libname parameter.
            (PutLibName): New procedure.
            (GetLibName): New procedure function.
            * gm2-compiler/SymbolTable.mod (MakeProcedureCtorExtern): Add
            libname parameter.
            (GenName): Add libname parameter.
            (InitCtorFields): Add moduleSym as a parameter.
            (PutCtorExtern): Add libname parameter to GenName.
            * gm2-gcc/init.cc (_M2_DynamicStringPath_init): Rename function...
            (_M2_DynamicPath_init): ...to this.
            (_M2_PathName_init): Added.
            * gm2-gcc/m2decl.cc (m2decl_DeclareM2linkStaticInitialization):
            Add m2pim as the manged component of the exported symbol.
            (m2decl_DeclareM2linkForcedModuleInitOrder): Add m2pim mangle
prefix.
            * gm2-gcc/m2options.h (M2Options_SetM2Prefix): New function.
            (M2Options_GetM2Prefix): New function.
            (M2Options_SetM2PathName): New function.
            (M2Options_GetM2PathName): New function.
            * gm2-lang.cc (push_back_Ipath): New function.
            (add_one_import_path): New function.
            (gm2_langhook_handle_option): Record -I component.  Call
            SetM2PathName when -fm2-pathname= is seen.  Record -fm2-pathnameI
            component.  Call SetM2Prefix when -fm2-prefix= is seen.
            (gm2_langhook_post_options): Iterative over pathname entries
            and call SetM2PathName, SetSearchPath as appropriate.
            * gm2-libs-iso/M2RTS.def (ConstructModules): Add libname parameter.
            (DeconstructModules): Add libname parameter.
            (RegisterModule): Add libname parameter.
            (RequestDependant): Add libname parameter.
            * gm2-libs-iso/M2RTS.mod (ConstructModules): Add libname parameter.
            (DeconstructModules): Add libname parameter.
            (RegisterModule): Add libname parameter.
            (RequestDependant): Add libname parameter.
            * gm2-libs-min/M2RTS.def (ConstructModules): Add libname parameter.
            (DeconstructModules): Add libname parameter.
            (RegisterModule): Add libname parameter.
            (RequestDependant): Add libname parameter.
            * gm2-libs-min/M2RTS.mod (ConstructModules): Add libname parameter.
            (DeconstructModules): Add libname parameter.
            (RegisterModule): Add libname parameter.
            (RequestDependant): Add libname parameter.
            * gm2-libs/M2Dependent.def (ConstructModules): Add libname
parameter.
            (DeconstructModules): Add libname parameter.
            (RegisterModule): Add libname parameter.
            (RequestDependant): Add libname parameter.
            * gm2-libs/M2Dependent.mod (ConstructModules): Add libname
parameter.
            (DeconstructModules): Add libname parameter.
            (RegisterModule): Add libname parameter.
            (RequestDependant): Add libname parameter.
            * gm2-libs/M2RTS.def (ConstructModules): Add libname parameter.
            (DeconstructModules): Add libname parameter.
            (RegisterModule): Add libname parameter.
            (RequestDependant): Add libname parameter.
            * gm2-libs/M2RTS.mod (ConstructModules): Add libname parameter.
            (DeconstructModules): Add libname parameter.
            (RegisterModule): Add libname parameter.
            (RequestDependant): Add libname parameter.
            * gm2-libs/RTint.mod (FindVector): Rename variables.
            (initInputVector): Rename variables.
            (initOutputVector): Rename variables.
            (InitTimeVector): Rename variables.
            (FindVectorNo): Rename variables.
            (FindPendingVector): Rename variables.
            (ReArmTimeVector): Rename variables.
            (GetTimeVector): Rename variables.
            (AttachVector): Rename variables.
            (AttachVector): Rename variables.
            (IncludeVector): Rename variables.
            (ExcludeVector): Rename variables.
            (AddFd): Rename variables.
            (AddFd): Rename variables.
            (DumpPendingQueue): Rename variables.
            (stop): Remove.
            (activatePending): Rename variables.
            (Listen): Rename variables.
            * gm2-libs/libc.def (snprintf): New function.
            * gm2-libs/sckt.def: Change all exported identifiers to be
            export qualified.
            * gm2spec.cc (push_back_Ipath): New function.
            (add_m2_I_path): New function.
            (lang_specific_driver): Skip -fm2-pathname= and remember pathname.
            Skip -I and record the path and current pathname.  Call
add_m2_I_path.
            * lang-specs.h: Replace %{I*} with %{fm2-pathname*}.
            * lang.opt (-fm2-pathname=): New entry.
            (-fm2-pathname): New entry.
            (-fm2-prefix=): New entry.
            * mc-boot-ch/GUnixArgs.cc (_M2_UnixArgs_dep): New function.
            (_M2_UnixArgs_ctor::_M2_UnixArgs_ctor): New method.
            * mc-boot-ch/Glibc.c (libc_snprintf): New function.
            * mc-boot-ch/m2rts.h (M2RTS_RequestDependant): Changed prototype.
            (M2RTS_RegisterModule): Changed prototype.
            * mc-boot/GDynamicStrings.c: Rebuild.
            * mc-boot/GFIO.c: Rebuild.
            * mc-boot/GIndexing.c: Rebuild.
            * mc-boot/GM2Dependent.c: Rebuild.
            * mc-boot/GM2Dependent.h: Rebuild.
            * mc-boot/GM2EXCEPTION.c: Rebuild.
            * mc-boot/GM2RTS.c: Rebuild.
            * mc-boot/GM2RTS.h: Rebuild.
            * mc-boot/GPushBackInput.c: Rebuild.
            * mc-boot/GRTExceptions.c: Rebuild.
            * mc-boot/GRTint.c: Rebuild.
            * mc-boot/GStdIO.c: Rebuild.
            * mc-boot/GStringConvert.c: Rebuild.
            * mc-boot/GSysStorage.c: Rebuild.
            * mc-boot/Gdecl.c: Rebuild.
            * mc-boot/Gkeyc.c: Rebuild.
            * mc-boot/Glibc.h: Rebuild.
            * mc-boot/GmcComment.c: Rebuild.
            * mc-boot/GmcComp.c: Rebuild.
            * mc-boot/GmcDebug.c: Rebuild.
            * mc-boot/GmcMetaError.c: Rebuild.
            * mc-boot/GmcStack.c: Rebuild.
            * mc-boot/GnameKey.c: Rebuild.
            * mc-boot/GsymbolKey.c: Rebuild.
            * pge-boot/GASCII.c: Rebuild.
            * pge-boot/GArgs.c: Rebuild.
            * pge-boot/GAssertion.c: Rebuild.
            * pge-boot/GDebug.c: Rebuild.
            * pge-boot/GDynamicStrings.c: Rebuild.
            * pge-boot/GFIO.c: Rebuild.
            * pge-boot/GIO.c: Rebuild.
            * pge-boot/GIndexing.c: Rebuild.
            * pge-boot/GLists.c: Rebuild.
            * pge-boot/GM2Dependent.c: Rebuild.
            * pge-boot/GM2Dependent.h: Rebuild.
            * pge-boot/GM2EXCEPTION.c: Rebuild.
            * pge-boot/GM2RTS.c: Rebuild.
            * pge-boot/GM2RTS.h: Rebuild.
            * pge-boot/GNameKey.c: Rebuild.
            * pge-boot/GNumberIO.c: Rebuild.
            * pge-boot/GOutput.c: Rebuild.
            * pge-boot/GPushBackInput.c: Rebuild.
            * pge-boot/GRTExceptions.c: Rebuild.
            * pge-boot/GSFIO.c: Rebuild.
            * pge-boot/GStdIO.c: Rebuild.
            * pge-boot/GStorage.c: Rebuild.
            * pge-boot/GStrCase.c: Rebuild.
            * pge-boot/GStrIO.c: Rebuild.
            * pge-boot/GStrLib.c: Rebuild.
            * pge-boot/GSymbolKey.c: Rebuild.
            * pge-boot/GSysExceptions.c (_M2_SysExceptions_finish): Rename
this...
            (_M2_SysExceptions_fini): ... to this.
            * pge-boot/GSysStorage.c: Rebuild.
            (_M2_SysStorage_finish): Rename this...
            (_M2_SysStorage_fini): ... to this.
            * pge-boot/GUnixArgs.cc: New file.
            * pge-boot/Gbnflex.c (_M2_bnflex_finish): Rename this...
            (_M2_bnflex_fini): ... to this.
            * pge-boot/Gerrno.c (_M2_errno_finish): Rename this...
            (_M2_errno_fini): ... to this.
            * pge-boot/Glibc.c (libc_snprintf): New function.
            * pge-boot/Glibc.h (libc_snprintf): New prototype.
            * pge-boot/Gpge.c (_M2_pge_finish): Rename this...
            (_M2_pge_fini): ... to this.
            * pge-boot/Gtermios.cc (_M2_termios_finish): Rename this...
            (_M2_termios_fini): ... to this.
            * pge-boot/main.c (_M2_RTExceptions_finish): Rename this...
            (_M2_RTExceptions_fini): ... to this.
            (_M2_M2EXCEPTION_finish): Rename this...
            (_M2_M2EXCEPTION_fini): ... to this.
            (_M2_M2RTS_finish): Rename this...
            (_M2_M2RTS_fini): ... to this.
            (_M2_SysExceptions_finish): Rename this...
            (_M2_SysExceptions_fini): ... to this.
            (_M2_StrLib_finish): Rename this...
            (_M2_StrLib_fini): ... to this.
            (_M2_errno_finish): Rename this...
            (_M2_errno_fini): ... to this.
            (_M2_termios_finish): Rename this...
            (_M2_termios_fini): ... to this.
            (_M2_IO_finish): Rename this...
            (_M2_IO_fini): ... to this.
            (_M2_StdIO_finish): Rename this...
            (_M2_StdIO_fini): ... to this.
            (_M2_Debug_finish): Rename this...
            (_M2_Debug_fini): ... to this.
            (_M2_SysStorage_finish): Rename this...
            (_M2_SysStorage_fini): ... to this.
            (_M2_Storage_finish): Rename this...
            (_M2_Storage_fini): ... to this.
            (_M2_StrIO_finish): Rename this...
            (_M2_StrIO_fini): ... to this.
            (_M2_DynamicStrings_finish): Rename this...
            (_M2_DynamicStrings_fini): ... to this.
            (_M2_Assertion_finish): Rename this...
            (_M2_Assertion_fini): ... to this.
            (_M2_Indexing_finish): Rename this...
            (_M2_Indexing_fini): ... to this.
            (_M2_NameKey_finish): Rename this...
            (_M2_NameKey_fini): ... to this.
            (_M2_NumberIO_finish): Rename this...
            (_M2_NumberIO_fini): ... to this.
            (_M2_PushBackInput_finish): Rename this...
            (_M2_PushBackInput_fini): ... to this.
            (_M2_SymbolKey_finish): Rename this...
            (_M2_SymbolKey_fini): ... to this.
            (_M2_UnixArgs_finish): Rename this...
            (_M2_UnixArgs_fini): ... to this.
            (_M2_FIO_finish): Rename this...
            (_M2_FIO_fini): ... to this.
            (_M2_SFIO_finish): Rename this...
            (_M2_SFIO_fini): ... to this.
            (_M2_StrCase_finish): Rename this...
            (_M2_StrCase_fini): ... to this.
            (_M2_bnflex_finish): Rename this...
            (_M2_bnflex_fini): ... to this.
            (_M2_Lists_finish): Rename this...
            (_M2_Lists_fini): ... to this.
            (_M2_Args_finish): Rename this...
            (_M2_Args_fini): ... to this.
            (_M2_Output_finish): Rename this...
            (_M2_Output_fini): ... to this.
            (_M2_pge_finish): Rename this...
            (_M2_pge_fini): ... to this.
            * plugin/m2rte.cc (m2_runtime_error_calls): Change all runtime
            procedure names to their name mangled counterparts.
            * gm2-libs-iso/wrapsock.c: Removed.
            * gm2-libs-iso/wraptime.c: Removed.
            * mc-boot/Gpth.h: Removed.
            * gm2-compiler/PathName.def: New file.
            * gm2-compiler/PathName.mod: New file.

    libgm2/ChangeLog:

            PR modula2/108261
            * libm2cor/KeyBoardLEDs.cc (EXPORT): New define.
            (M2EXPORT): New define.
            (M2LIBNAME): New define.
            (KeyBoardLEDs_SwitchScroll): EXPORT.
            (KeyBoardLEDs_SwitchNum): EXPORT.
            (KeyBoardLEDs_SwitchCaps): EXPORT.
            (KeyBoardLEDs_SwitchLeds): EXPORT.
            (_M2_KeyBoardLEDs_init): M2EXPORT.
            (_M2_KeyBoardLEDs_finish): M2EXPORT.
            (_M2_KeyBoardLEDs_dep): M2EXPORT.
            * libm2cor/Makefile.am (libm2cor_la_M2FLAGS): Define
            path names.
            * libm2cor/Makefile.in: Rebuild.
            * libm2iso/ErrnoCategory.cc (EXPORT): New define.
            (M2EXPORT): New define.
            (M2LIBNAME): New define.
            (ErrnoCategory_IsErrnoHard): EXPORT.
            (ErrnoCategory_IsErrnoSoft): EXPORT.
            (ErrnoCategory_UnAvailable): EXPORT.
            (ErrnoCategory_GetOpenResults): EXPORT.
            (_M2_ErrnoCategory_init): M2EXPORT.
            (_M2_ErrnoCategory_fini): M2EXPORT.
            (_M2_ErrnoCategory_dep): M2EXPORT.
            (_M2_ErrnoCategory_ctor): M2EXPORT.
            * libm2iso/Makefile.am (libm2iso_la_M2FLAGS): Define
            path names.
            * libm2iso/Makefile.in: Rebuild.
            * libm2iso/RTco.cc (EXPORT): New define.
            (M2EXPORT): New define.
            (M2LIBNAME): New define.
            (newSem): Add module libname prefix to HaltC.
            (currentThread): Remove variable and replace with a function.
            (never): Add module libname prefix to HaltC.
            (initThread): Add module libname prefix to HaltC.
            * libm2iso/m2rts.h (str): New define.
            (M2RTS_RequestDependant): Change to the mangled name equivalent.
            (M2RTS_RegisterModule): Change to the mangled name equivalent.
            (m2iso_M2RTS_RequestDependant): Add libname parameter.
            (m2iso_M2RTS_RegisterModule): Add libname parameter.
            (m2pim_M2RTS_RegisterModule): Add libname parameter.
            (_M2_M2RTS_init): Rename this...
            (m2iso_M2_M2RTS_init): ...to this.
            (M2RTS_ConstructModules): Change to the mangled name equivalent.
            (M2RTS_Terminate): Change to the mangled name equivalent.
            (M2RTS_DeconstructModules): Change to the mangled name equivalent.
            (m2iso_M2RTS_ConstructModules): Add libname parameter.
            (m2iso_M2RTS_Terminate): Add libname parameter.
            (m2iso_M2RTS_DeconstructModules): Add libname parameter.
            (M2RTS_HaltC): Rename this...
            (m2iso_M2RTS_HaltC): ...to this.
            * libm2iso/wrapsock.c (EXPORT): New define.
            (IMPORT): New define.
            (M2EXPORT): New define.
            (M2LIBNAME): New define.
            (m2iso_M2RTS_RequestDependant): Add prototype.
            (wrapsock_clientOpen): EXPORT.
            (wrapsock_clientOpenIP): EXPORT.
            (wrapsock_getClientPortNo): EXPORT.
            (wrapsock_getClientHostname): EXPORT.
            (wrapsock_getClientSocketFd): EXPORT.
            (wrapsock_getClientIP): EXPORT.
            (wrapsock_getPushBackChar): EXPORT.
            (wrapsock_setPushBackChar): EXPORT.
            (wrapsock_getSizeOfClientInfo): EXPORT.
            (_M2_wrapsock_init): M2EXPORT.
            (_M2_wrapsock_fini): M2EXPORT.
            (ctor): M2EXPORT.  New function.
            * libm2iso/wraptime.c: Rename to...
            * libm2iso/wraptime.cc: ...this.
            (EXPORT): New define.
            (M2EXPORT): New define.
            (M2LIBNAME): New define.
            (wraptime_InitTimeval): EXPORT.
            (wraptime_KillTimeval): EXPORT.
            (wraptime_InitTimezone): EXPORT.
            (wraptime_KillTimezone): EXPORT.
            (wraptime_InitTM): EXPORT.
            (wraptime_KillTM): EXPORT.
            (wraptime_gettimeofday): EXPORT.
            (wraptime_settimeofday): EXPORT.
            (wraptime_GetFractions): EXPORT.
            (wraptime_localtime_r): EXPORT.
            (wraptime_GetYear): EXPORT.
            (wraptime_GetMonth): EXPORT.
            (wraptime_GetDay): EXPORT.
            (wraptime_GetHour): EXPORT.
            (wraptime_GetMinute): EXPORT.
            (wraptime_GetSecond): EXPORT.
            (wraptime_GetSummerTime): EXPORT.
            (wraptime_GetDST): EXPORT.
            (wraptime_SetTimezone): EXPORT.
            (wraptime_SetTimeval): EXPORT.
            (_M2_wraptime_init): M2EXPORT.
            (_M2_wraptime_fini): M2EXPORT.
            (ctor): M2EXPORT.  New function.
            * libm2log/Makefile.am (libm2log_la_M2FLAGS): Define
            path names.
            * libm2log/Makefile.in:
            * libm2min/Makefile.am (libm2min_la_M2FLAGS): Define
            path names.
            * libm2min/Makefile.in:
            * libm2pim/Makefile.am (libm2pim_la_M2FLAGS): Define
            path names.
            * libm2pim/Makefile.in:
            * libm2pim/Selective.cc (EXPORT): New define.
            (M2EXPORT): New define.
            (M2LIBNAME): New define.
            (Selective_Select): EXPORT.
            (Selective_InitTime): EXPORT.
            (Selective_GetTime): EXPORT.
            (Selective_SetTime): EXPORT.
            (Selective_KillTime): EXPORT.
            (Selective_InitSet): EXPORT.
            (Selective_KillSet): EXPORT.
            (Selective_FdZero): EXPORT.
            (Selective_FdSet): EXPORT.
            (Selective_FdClr): EXPORT.
            (Selective_FdIsSet): EXPORT.
            (Selective_GetTimeOfDay): EXPORT.
            (Selective_MaxFdsPlusOne): EXPORT.
            (Selective_WriteCharRaw): EXPORT.
            (Selective_ReadCharRaw): EXPORT.
            (_M2_Selective_init): M2EXPORT.
            (_M2_Selective_fini): M2EXPORT.
            (_M2_Selective_dep): M2EXPORT.
            (_M2_Selective_ctor): M2EXPORT.
            * libm2pim/SysExceptions.cc (EXPORT): New define.
            (M2EXPORT): New define.
            (M2LIBNAME): New define.
            (SysExceptions_InitExceptionHandlers): EXPORT.
            (_M2_SysExceptions_init): M2EXPORT.
            (_M2_SysExceptions_fini): M2EXPORT.
            (_M2_SysExceptions_dep): M2EXPORT.
            (_M2_SysExceptions_ctor): M2EXPORT.
            * libm2pim/UnixArgs.cc (EXPORT): New define.
            (M2EXPORT): New define.
            (M2LIBNAME): New define.
            (UnixArgs_GetArgC): EXPORT.
            (UnixArgs_GetArgV): EXPORT.
            (UnixArgs_GetEnvV): EXPORT.
            (_M2_UnixArgs_init): M2EXPORT.
            (_M2_UnixArgs_fini): M2EXPORT.
            (_M2_UnixArgs_dep): M2EXPORT.
            (_M2_UnixArgs_ctor): M2EXPORT.
            * libm2pim/cgetopt.cc (EXPORT): New define.
            (M2EXPORT): New define.
            (M2LIBNAME): New define.
            (cgetopt_getopt): EXPORT.
            (cgetopt_getopt_long): EXPORT.
            (cgetopt_getopt_long_only): EXPORT.
            (cgetopt_InitOptions): EXPORT.
            (cgetopt_KillOptions): EXPORT.
            (cgetopt_SetOption): EXPORT.
            (cgetopt_GetLongOptionArray): EXPORT.
            (_M2_cgetopt_init): M2EXPORT.
            (_M2_cgetopt_fini): M2EXPORT.
            (_M2_cgetopt_dep): M2EXPORT.
            (_M2_cgetopt_ctor): M2EXPORT.
            * libm2pim/dtoa.cc (EXPORT): New define.
            (M2EXPORT): New define.
            (M2LIBNAME): New define.
            (dtoa_strtod): EXPORT.
            (dtoa_calcmaxsig): EXPORT.
            (dtoa_calcdecimal): EXPORT.
            (dtoa_calcsign): EXPORT.
            (dtoa_dtoa): EXPORT.
            (_M2_dtoa_init): M2EXPORT.
            (_M2_dtoa_fini): M2EXPORT.
            (_M2_dtoa_dep): M2EXPORT.
            (_M2_dtoa_ctor): M2EXPORT.
            * libm2pim/errno.cc (EXPORT): New define.
            (M2EXPORT): New define.
            (M2LIBNAME): New define.
            (errno_geterrno): EXPORT.
            (_M2_errno_init): M2EXPORT.
            (_M2_errno_fini): M2EXPORT.
            (_M2_errno_dep): M2EXPORT.
            (_M2_errno_ctor): M2EXPORT.
            * libm2pim/ldtoa.cc (EXPORT): New define.
            (IMPORT): New define.
            (M2EXPORT): New define.
            (M2LIBNAME): New define.
            (dtoa_calcmaxsig): EXPORT.
            (dtoa_calcdecimal): EXPORT.
            (dtoa_calcsign): EXPORT.
            (ldtoa_strtold): EXPORT.
            (ldtoa_ldtoa): EXPORT.
            (_M2_ldtoa_init): M2EXPORT.
            (_M2_ldtoa_fini): M2EXPORT.
            (_M2_ldtoa_dep): M2EXPORT.
            (_M2_ldtoa_ctor): M2EXPORT.
            * libm2pim/sckt.cc (EXPORT): New define.
            (M2EXPORT): New define.
            (M2LIBNAME): New define.
            (tcpServerEstablishPort): EXPORT.
            (tcpServerEstablish): EXPORT.
            (tcpServerAccept): EXPORT.
            (tcpServerPortNo): EXPORT.
            (tcpServerSocketFd): EXPORT.
            (getLocalIP): EXPORT.
            (tcpServerIP): EXPORT.
            (tcpServerClientIP): EXPORT.
            (tcpServerClientPortNo): EXPORT.
            (tcpClientSocket): EXPORT.
            (tcpClientSocketIP): EXPORT.
            (tcpClientConnect): EXPORT.
            (tcpClientPortNo): EXPORT.
            (tcpClientSocketFd): EXPORT.
            (tcpClientIP): EXPORT.
            (_M2_sckt_init): M2EXPORT.
            (_M2_sckt_finish): M2EXPORT.
            (_M2_sckt_dep): M2EXPORT.
            (_M2_sckt_ctor): M2EXPORT.
            * libm2pim/termios.cc (EXPORT): New define.
            (M2EXPORT): New define.
            (M2LIBNAME): New define.
            (_M2_termios_init): M2EXPORT.
            (_M2_termios_fini): M2EXPORT.
            (_M2_termios_dep): M2EXPORT.
            (_M2_termios_ctor): M2EXPORT.
            * libm2pim/wrapc.c (EXPORT): New define.
            (M2EXPORT): New define.
            (M2LIBNAME): New define.
            (wrapc_strtime): EXPORT.
            (wrapc_filesize): EXPORT.
            (wrapc_filemtime): EXPORT.
            (wrapc_fileinode): EXPORT.
            (wrapc_getrand): EXPORT.
            (wrapc_getusername): EXPORT.
            (wrapc_getnameuidgid): EXPORT.
            (wrapc_signbit): EXPORT.
            (wrapc_signbitl): EXPORT.
            (wrapc_signbitf): EXPORT.
            (wrapc_isfinite): EXPORT.
            (wrapc_isfinitel): EXPORT.
            (wrapc_isfinitef): EXPORT.
            (_M2_wrapc_init): M2EXPORT.
            (_M2_wrapc_fini): M2EXPORT.
            (_M2_wrapc_ctor): M2EXPORT.

    gcc/testsuite/ChangeLog:

            PR modula2/108261
            * gm2/examples/callingC/pass/examples-callingC-pass.exp: Tidy up
            variable access.
            * gm2/examples/callingC/run/pass/examples-callingC-run-pass.exp:
Tidy up
            variable access.
            * gm2/examples/cpp/pass/examples-cpp-pass.exp: Tidy up
            variable access.
            * gm2/examples/cppDef/pass/examples-cppDef-pass.exp: Tidy up
            variable access.
            * gm2/examples/hello/pass/examples-hello-pass.exp: Tidy up
            variable access.
            * gm2/examples/map/pass/examples-map-pass.exp: Tidy up
            variable access.
            * gm2/iso/check/fail/iso-check-fail.exp: Add pathname.
            * gm2/link/externalscaffold/pass/link-externalscaffold-pass.exp:
            Add pathname.
            * gm2/link/externalscaffold/pass/scaffold.c: Add mangled export
name.
            * gm2/pimlib/base/run/pass/FIO.mod: Updated test code.
            * gm2/pimlib/base/run/pass/StrLib.mod: Updated test code.
            * gm2/pimlib/base/run/pass/pimlib-base-run-pass.exp: Remove path.
            *
gm2/projects/pim/run/pass/random/projects-pim-run-pass-random.exp:
            Tidy up variable access.
            * gm2/switches/auto-init/fail/switches-auto-init-fail.exp: Add
pathname.
            *
gm2/switches/check-all/pim2/fail/switches-check-all-pim2-fail.exp:
            Add pathname.
            * gm2/switches/makeall/fail/switches-makeall-fail.exp: Remove
-fmakeall.
            * gm2/switches/makeall/pass/switches-makeall-pass.exp: Remove
-fmakeall.
            * lib/gm2-simple.exp (gm2_keep_executable): New global variable.
            (gm2_simple_execute): Keep executable if global is true.
            * lib/gm2-torture.exp: Add ; after global variable access.
            * lib/gm2.exp: Set up pathnames.
            * gm2/projects/pim/run/pass/tower/AdvCmd.def: New test.
            * gm2/projects/pim/run/pass/tower/AdvCmd.mod: New test.
            * gm2/projects/pim/run/pass/tower/AdvIntroduction.def: New test.
            * gm2/projects/pim/run/pass/tower/AdvIntroduction.mod: New test.
            * gm2/projects/pim/run/pass/tower/AdvMap.def: New test.
            * gm2/projects/pim/run/pass/tower/AdvMap.mod: New test.
            * gm2/projects/pim/run/pass/tower/AdvMath.def: New test.
            * gm2/projects/pim/run/pass/tower/AdvMath.mod: New test.
            * gm2/projects/pim/run/pass/tower/AdvParse.bnf: New test.
            * gm2/projects/pim/run/pass/tower/AdvParse.def: New test.
            * gm2/projects/pim/run/pass/tower/AdvParse.mod: New test.
            * gm2/projects/pim/run/pass/tower/AdvSound.def: New test.
            * gm2/projects/pim/run/pass/tower/AdvSound.mod: New test.
            * gm2/projects/pim/run/pass/tower/AdvSystem.def: New test.
            * gm2/projects/pim/run/pass/tower/AdvSystem.mod: New test.
            * gm2/projects/pim/run/pass/tower/AdvTreasure.def: New test.
            * gm2/projects/pim/run/pass/tower/AdvTreasure.mod: New test.
            * gm2/projects/pim/run/pass/tower/AdvUtil.def: New test.
            * gm2/projects/pim/run/pass/tower/AdvUtil.mod: New test.
            * gm2/projects/pim/run/pass/tower/DrawG.def: New test.
            * gm2/projects/pim/run/pass/tower/DrawG.mod: New test.
            * gm2/projects/pim/run/pass/tower/DrawL.def: New test.
            * gm2/projects/pim/run/pass/tower/DrawL.mod: New test.
            * gm2/projects/pim/run/pass/tower/Dungeon.mod: New test.
            * gm2/projects/pim/run/pass/tower/Lock.def: New test.
            * gm2/projects/pim/run/pass/tower/Lock.mod: New test.
            * gm2/projects/pim/run/pass/tower/ProcArgs.def: New test.
            * gm2/projects/pim/run/pass/tower/ProcArgs.mod: New test.
            * gm2/projects/pim/run/pass/tower/Screen.def: New test.
            * gm2/projects/pim/run/pass/tower/Screen.mod: New test.
            * gm2/projects/pim/run/pass/tower/SocketControl.c: New test.
            * gm2/projects/pim/run/pass/tower/SocketControl.def: New test.
            * gm2/projects/pim/run/pass/tower/Window.def: New test.
            * gm2/projects/pim/run/pass/tower/Window.mod: New test.
            * gm2/projects/pim/run/pass/tower/adv.flex: New test.
            * gm2/projects/pim/run/pass/tower/advflex.c: New test.
            * gm2/projects/pim/run/pass/tower/advflex.def: New test.
            * gm2/projects/pim/run/pass/tower/projects-pim-run-pass-tower.exp:
            New test.
            * gm2/projects/pim/run/pass/tower/star: New test.

    Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug modula2/108261] modula-2 module registration process seems to fail with shared libraries.
  2023-01-01 17:14 [Bug modula2/108261] New: modula-2 module registration process seems to fail with shared libraries iains at gcc dot gnu.org
                   ` (27 preceding siblings ...)
  2023-02-25 16:29 ` cvs-commit at gcc dot gnu.org
@ 2023-02-27 13:34 ` gaius at gcc dot gnu.org
  28 siblings, 0 replies; 30+ messages in thread
From: gaius at gcc dot gnu.org @ 2023-02-27 13:34 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108261

Gaius Mulley <gaius at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|---                         |FIXED

--- Comment #28 from Gaius Mulley <gaius at gcc dot gnu.org> ---
Closing as this original PR has now been solved.  The focus now moves onto
coroutines (RTco.cc and RTint.cc in particular) which are reported in PR108835.

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2023-02-27 13:34 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-01 17:14 [Bug modula2/108261] New: modula-2 module registration process seems to fail with shared libraries iains at gcc dot gnu.org
2023-01-01 17:16 ` [Bug modula2/108261] " iains at gcc dot gnu.org
2023-01-01 17:24 ` iains at gcc dot gnu.org
2023-01-01 17:59 ` iains at gcc dot gnu.org
2023-01-02 13:39 ` iains at gcc dot gnu.org
2023-01-04 16:24 ` iains at gcc dot gnu.org
2023-01-05 21:10 ` iains at gcc dot gnu.org
2023-01-09 15:10 ` gaius at gcc dot gnu.org
2023-01-09 16:34 ` iains at gcc dot gnu.org
2023-01-09 22:34 ` gaius at gcc dot gnu.org
2023-01-10  0:01 ` iains at gcc dot gnu.org
2023-01-11  2:00 ` gaius at gcc dot gnu.org
2023-01-11  8:57 ` iains at gcc dot gnu.org
2023-01-11  9:42 ` iains at gcc dot gnu.org
2023-01-11  9:45 ` iains at gcc dot gnu.org
2023-01-11  9:55 ` iains at gcc dot gnu.org
2023-01-11 15:02 ` iains at gcc dot gnu.org
2023-01-11 15:07 ` gaius at gcc dot gnu.org
2023-01-11 15:22 ` gaius at gcc dot gnu.org
2023-01-11 21:10 ` iains at gcc dot gnu.org
2023-02-14 23:30 ` gaius at gcc dot gnu.org
2023-02-14 23:32 ` gaius at gcc dot gnu.org
2023-02-14 23:34 ` gaius at gcc dot gnu.org
2023-02-19 16:59 ` gaius at gcc dot gnu.org
2023-02-22  0:39 ` gaius at gcc dot gnu.org
2023-02-23  9:48 ` gaius at gcc dot gnu.org
2023-02-23 12:07 ` gaius at gcc dot gnu.org
2023-02-23 20:35 ` iains at gcc dot gnu.org
2023-02-25 16:29 ` cvs-commit at gcc dot gnu.org
2023-02-27 13:34 ` gaius at gcc dot gnu.org

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).