PR modula2/107630 Remove M2LINK and remove some cross linking
authorGaius Mulley <gaiusmod2@gmail.com>
Wed, 22 Mar 2023 01:45:58 +0000 (01:45 +0000)
committerGaius Mulley <gaiusmod2@gmail.com>
Wed, 22 Mar 2023 01:45:58 +0000 (01:45 +0000)
commit573dbd5175dbf16a3b4551ec55800febf0d1b617
treed7358f15c164995df2f4398918975320fab56588
parent031785270ab84d7291b200d8e3e345cd36239ad5
PR modula2/107630 Remove M2LINK and remove some cross linking

Remove M2LINK.def.  Pass the user forced module initialization string as
a parameter to M2RTS.ConstructModules.  This patch allows
-fm2-whole-program to link successfully using dynamic libraries.

gcc/m2/ChangeLog:

PR modula2/107630
* Make-lang.in (m2/stage2/cc1gm2$(exeext)): Remove
m2/gm2-libs-boot/M2LINK.o.
(m2/stage1/cc1gm2$(exeext)): Ditto.
(GM2-LIBS-BOOT-DEFS): Remove M2LINK.def.
(GM2-LIBS-DEFS): Ditto.
(m2/mc-boot/$(SRC_PREFIX)%.o): Replace CXX_FLAGS with CXXFLAGS.
(m2/mc-boot-ch/$(SRC_PREFIX)%.o): Ditto.
(m2/mc-boot/main.o): Ditto.
(mcflex.o): Add $(CFLAGS).
(m2/gm2-libs-boot/M2LINK.o): Remove rule.
* gm2-compiler/M2GCCDeclare.def (DeclareM2linkGlobals): Remove.
* gm2-compiler/M2GCCDeclare.mod: (M2LinkEntry): Remove.
(M2LinkIndex): Remove.
(DoVariableDeclaration): Remove initial and call to
AddEntryM2Link.
(AddEntryM2Link): Remove.
(GetEntryM2Link): Remove.
(DeclareM2linkGlobals): Remove.
(DetectM2LinkInitial): Remove.
(InitM2LinkModule): Remove.
* gm2-compiler/M2GenGCC.mod (CodeFinallyEnd): Remove call to
DeclareM2linkGlobals.
* gm2-compiler/M2Quads.mod (BuildM2InitFunction): Add extra
parameter containing runtime module override to ConstructModules.
* gm2-compiler/M2Scaffold.mod: Update comment describing
ConstructModules.
* gm2-gcc/m2decl.cc (m2decl_DeclareM2linkForcedModuleInitOrder):
Remove.
* gm2-libs-iso/M2RTS.def (ConstructModules): Add overrideliborder
parameter.
* gm2-libs-iso/M2RTS.mod: Add overrideliborder parameter.
* gm2-libs/M2Dependent.def (ConstructModules): Add overrideliborder
parameter.
* gm2-libs/M2Dependent.mod (ConstructModules): Add overrideliborder
parameter.
* gm2-libs/M2RTS.def (ConstructModules): Add overrideliborder parameter.
* gm2-libs/M2RTS.mod (ConstructModules): Add overrideliborder
parameter.
* gm2-libs/M2LINK.def: Removed.

libgm2/ChangeLog:

* libm2pim/Makefile.am (M2DEFS): Remove M2LINK.def.
* libm2pim/Makefile.in: Rebuild.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
16 files changed:
gcc/m2/Make-lang.in
gcc/m2/gm2-compiler/M2GCCDeclare.def
gcc/m2/gm2-compiler/M2GCCDeclare.mod
gcc/m2/gm2-compiler/M2GenGCC.mod
gcc/m2/gm2-compiler/M2Quads.mod
gcc/m2/gm2-compiler/M2Scaffold.mod
gcc/m2/gm2-gcc/m2decl.cc
gcc/m2/gm2-libs-iso/M2RTS.def
gcc/m2/gm2-libs-iso/M2RTS.mod
gcc/m2/gm2-libs/M2Dependent.def
gcc/m2/gm2-libs/M2Dependent.mod
gcc/m2/gm2-libs/M2LINK.def [deleted file]
gcc/m2/gm2-libs/M2RTS.def
gcc/m2/gm2-libs/M2RTS.mod
libgm2/libm2pim/Makefile.am
libgm2/libm2pim/Makefile.in