]> gcc.gnu.org Git - gcc.git/commit
PR modula2/109336 - The -fmod= and -fdef= options do not work
authorGaius Mulley <gaiusmod2@gmail.com>
Wed, 29 Mar 2023 16:38:22 +0000 (17:38 +0100)
committerGaius Mulley <gaiusmod2@gmail.com>
Wed, 29 Mar 2023 16:38:22 +0000 (17:38 +0100)
commit3be4e43a6a0f429648ea188c8e110b74268fed27
treead07cf9e70e6dcd9d12ef9dd7a289ab538a04acd
parentb2f327b9be81326c9e59fc6da98074c909ac7408
PR modula2/109336 - The -fmod= and -fdef= options do not work

The -fmod= and -fdef= options do not work.  After the linking
re-implementation and subsequent restructuring the -fmod= amd -fdef= are
now broken.  This patch adds -fmod= and -fdef= processing into gm2spec.cc.
It also reduces the complexity of extension handling within M2Search
by storing the preceeding "." in the extension.

gcc/m2/ChangeLog:

PR modula2/109336
PR modula2/109315
* gm2-compiler/M2FileName.mod (CalculateFileName): Simplified by
ensuring the extension contains the ".".
(CalculateStemName): Re-formatted.
(ExtractExtension): Re-formatted.
(ExtractModule): Re-formatted.
* gm2-compiler/M2Options.def (setdefextension): Add block comment.
(setmodextension): Add block comment.  Re-formatted.
* gm2-compiler/M2Options.mod (setdefextension): Add block comment.
(setmodextension): Add block comment.  Re-formatted.
* gm2-compiler/M2Search.mod (FindSourceDefFile): Use
DefaultDefExt.
(DefaultDefExt): New constant.
(DefaultModExt): New constant.
(FindSourceModFile): Use DefaultModExt.
* gm2-gcc/m2decl.cc (m2decl_DeclareKnownVariable): Correct
spelling.
* gm2spec.cc (M2SOURCE): New constant.
(LANGSPEC): New value.
(MATHLIB): New value.
(WITHLIBC): New value.
(SKIPOPT): New value.
(lang_specific_driver): Replace seen_module_extension bool with
module_extension char *.  Detect -fmod= and remember extension.
Use the extension to detect modula-2 source and mark it as such.

gcc/testsuite/ChangeLog:

PR modula2/109336
* gm2/link/nondefaultext/pass/hello.md: New test.
* gm2/link/nondefaultext/pass/liba.dm: New test.
* gm2/link/nondefaultext/pass/liba.md: New test.
* gm2/link/nondefaultext/pass/link-nondefaultext-pass.exp: New test.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
gcc/m2/gm2-compiler/M2FileName.mod
gcc/m2/gm2-compiler/M2Options.def
gcc/m2/gm2-compiler/M2Options.mod
gcc/m2/gm2-compiler/M2Search.mod
gcc/m2/gm2-gcc/m2decl.cc
gcc/m2/gm2spec.cc
gcc/testsuite/gm2/link/nondefaultext/pass/hello.md [new file with mode: 0644]
gcc/testsuite/gm2/link/nondefaultext/pass/liba.dm [new file with mode: 0644]
gcc/testsuite/gm2/link/nondefaultext/pass/liba.md [new file with mode: 0644]
gcc/testsuite/gm2/link/nondefaultext/pass/link-nondefaultext-pass.exp [new file with mode: 0755]
This page took 0.061918 seconds and 5 git commands to generate.