]> git.ipfire.org Git - thirdparty/gcc.git/commit
Static scaffold fixes, gm2l tidyup.
authorGaius Mulley <gaius.mulley@southwales.ac.uk>
Tue, 5 Jul 2022 13:15:16 +0000 (14:15 +0100)
committerGaius Mulley <gaius.mulley@southwales.ac.uk>
Tue, 5 Jul 2022 13:15:16 +0000 (14:15 +0100)
commit33abd43d4cac0e932f64e5dcce0c5ddf338bf625
tree0c71e725dc4cb226ff71cb7d259d0d48f96ea74a
parentb3ba35e9f8859a0b663b158bdc346c889fb69c1d
Static scaffold fixes, gm2l tidyup.

This patch fixes many static scaffold bugs and contains
a re-implementation of UnixArgs.cc and termios.cc.  gm2l
contains new options --exlude=, --include= and -flibs=.

2022-07-04  Gaius Mulley  <gaius.mulley@southwales.ac.uk>

gcc/ChangeLog:

* doc/gm2.texi (-fscaffold-c): Removed.  (-fscaffold-c++)
Removed.  (-fmodules) Removed.  (-fonlylink) Removed.

gcc/m2/ChangLog:

* Make-lang.in (UnixArgs.o): Use UnixArgs.cc.
(gm2-pge-boot/Gtermsios.o) Use mc-boot-ch/Gtermios.cc.
* bnf/gm2l.bnf: Partial re-write and introduced
--include=, --exclude= and -flibs=.  (AddUserInclude)
New procedure.  (ScanSources) Remove IncludeM2RTS
filter.  (MakeModule) Return a boolean if a new module
is seen.  (source) New field userInclude.
(source) New field userExclude.  (DisplaySources)
test for userExclude and userInclude and produce
appropriate diagnostic.  (DisplayUsage) Remove
--M2RTS.  Add -flibs=, --include-list= and --exclude-list=.
(PopulateList) New procedure.  (addInclude) New procedure.
(SetLibs) New procedure.  (SetExclude) New procedure.
(ScanArgs) Remove IncludeM2RTS.  Remove --M2RTS.
Add --include=, --exclude= and -flibs=.  Detect if multiple
source files are given and detect any unrecognized option.
* bnf/gm2m.bnf (main): Renamed as mainModule.
* gm2-compiler/M2Options.mod (SetScaffoldDynamic): Ensure that
ScaffoldStatic is not also set.  (SetScaffoldStatic) Ensure
that ScaffoldDynamic is not also set.
* gm2-compiler/M2Quads.mod (BuildM2FiniFunction):
Add ForeachModuleCallFinish for the static clause.
(BuildM2InitFunction) Add ForeachModuleCallInit for the
static clause.
* gm2-compiler/M2Scaffold.def (ForeachModuleCallInit):
New procedure.  (ForeachModuleCallFinish) New Procedure.
* gm2-compiler/M2Scaffold.mod (ForeachModuleCallInit):
New procedure implemented.  (ForeachModuleCallFinish) New
Procedure implemented.  (LookupModuleSym) New procedure.
(ReadModules) Addition parameter tok and populate
uselistModules.  (DeclareModuleExtern) Renamed from
DeclareCtorModuleExtern.
* gm2-compiler/M2Swig.mod (main): Renamed as mainModule.
* gm2-compiler/SymbolTable.def (PutModuleCtorExtern): Exported
and declared.  (MakeModuleCtor) Pass extra boolean public true.
(InitCtorFields) pub new parameter.  (PutProcedureExternPublic)
New procedure.  (PutCtorExtern) New procedure.
(PutModuleCtorExtern) New procedure.
* gm2-gcc/init.cc: Rewritten to pass envp to call init and fini
functions.
* gm2-gcc/m2expr.def: FOR "C" removed.
* gm2-libs-ch/RTcodummy.c: Undo removal of _init and _finish
functions.
* gm2-libs-ch/pthdummy.c (Removed).
* m2/gm2spec.cc (seen_scaffold_static): New boolean.
(seen_scaffold_dynamic) New boolean.  (scaffold_static)
New boolean.  (scaffold_dynamic) New boolean.
(get_libexec) Removed.  (add_exec_dir) Rewritten comment.
(lang_specific_driver) Check that dynamic scaffold and static
scaffold are not both enabled.
* mc-boot-ch/Gpth.c (Removed).
* mc-boot-ch/Gtermios.c (Removed).
* mc-boot-ch/Gtermios.cc (Added).  Converted from Gtermios.c.

gm2tools/ChangeLog:

* gm2l.1 (--M2RTS) Removed.  (-M2RTS) Removed.  (--include=) Added.
(--exclude=) Added.  (-flibs=) Added.

libgm2/ChangeLog:

* libm2iso/ErrnoCategory.cc (_finish): Changed to _fini.
* libm2iso/RTco.cc (_finish): Changed to _fini.
* libm2pim/SysExceptions.cc (_finish): Changed to _fini.
* libm2pim/errno.cc (_finish): Changed to _fini.
* libm2pim/termios.cc (_finish): Changed to _fini.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
26 files changed:
gcc/doc/gm2.texi
gcc/m2/Make-lang.in
gcc/m2/bnf/gm2l.bnf
gcc/m2/bnf/gm2m.bnf
gcc/m2/gm2-compiler/M2Batch.def
gcc/m2/gm2-compiler/M2Options.mod
gcc/m2/gm2-compiler/M2Quads.mod
gcc/m2/gm2-compiler/M2Scaffold.def
gcc/m2/gm2-compiler/M2Scaffold.mod
gcc/m2/gm2-compiler/M2Swig.mod
gcc/m2/gm2-compiler/SymbolTable.def
gcc/m2/gm2-compiler/SymbolTable.mod
gcc/m2/gm2-gcc/init.cc
gcc/m2/gm2-gcc/m2expr.def
gcc/m2/gm2-libs-ch/RTcodummy.c
gcc/m2/gm2-libs-ch/pthdummy.c [deleted file]
gcc/m2/gm2spec.cc
gcc/m2/mc-boot-ch/Gpth.c [deleted file]
gcc/m2/mc-boot-ch/Gtermios.c [deleted file]
gcc/testsuite/gm2/link/pimc/pass/testunixargs.mod
gm2tools/gm2l.1
libgm2/libm2iso/ErrnoCategory.cc
libgm2/libm2iso/RTco.cc
libgm2/libm2pim/SysExceptions.cc
libgm2/libm2pim/errno.cc
libgm2/libm2pim/termios.cc