public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Gaius Mulley <gaius@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc/devel/modula-2] PR-105410 Bugfix implement save-temps across every temporary file.
Date: Wed,  4 May 2022 15:07:33 +0000 (GMT)	[thread overview]
Message-ID: <20220504150733.162FC3858C53@sourceware.org> (raw)

https://gcc.gnu.org/g:b94876d89da4b36e67982d0a402ea021b280c27a

commit b94876d89da4b36e67982d0a402ea021b280c27a
Author: Gaius Mulley <gaius.mulley@southwales.ac.uk>
Date:   Wed May 4 15:24:18 2022 +0100

    PR-105410 Bugfix implement save-temps across every temporary file.
    
    2022-05-04   Gaius Mulley   <gaius.mulley@southwales.ac.uk>
    
    gcc/m2/ChangeLog:
    
            * m2/m2-link-support.h (RM_IF_NOSAVETEMP) New macro.
            (GM2CC) Use RM_IF_NOSAVETEMP on the assembler intermediate file.
            (GM2LCC) Use RM_IF_NOSAVETEMP when creating an archive of the
            application.  (GEN_SCAFFOLD_SRC) Use RM_IF_NOSAVETEMP when
            creating the scaffold source program.  (M2LINK) Use
            RM_IF_NOSAVETEMP when creating the assembler source name and use
            RM_IF_NOSAVETEMP when creating the main program object.
    
    Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>

Diff:
---
 gcc/m2/m2-link-support.h | 15 ++++++++++-----
 gm2tools/Makefile.in     |  2 +-
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/gcc/m2/m2-link-support.h b/gcc/m2/m2-link-support.h
index eb52f2b4f0d..66a444edbe7 100644
--- a/gcc/m2/m2-link-support.h
+++ b/gcc/m2/m2-link-support.h
@@ -48,12 +48,16 @@ along with GCC; see the file COPYING3.  If not see
 
 #define SCAFFOLDNAME "%b_m2"
 
+/* RM_IF_NOSAVETEMP remove the next file if save-temps is absent.  */
+
+#define RM_IF_NOSAVETEMP "%{!save-temps*:%d}"
+
 /* GM2CC compile the link scaffold either with the C or C++
    compiler.  */
 
 #define GM2CC(INPUT,OUTPUT) \
   "%{!fno-exceptions:cc1plus;:cc1} " GM2CC_OPTIONS " " INPUT " \
-     -o %d" SCAFFOLDNAME ".s \n\
+     -o " RM_IF_NOSAVETEMP SCAFFOLDNAME ".s \n\
   " AS(SCAFFOLDNAME ".s",OUTPUT) " "
 
 /* GM2LCC invoke the sub program gm2lcc with the object path options
@@ -67,7 +71,8 @@ along with GCC; see the file COPYING3.  If not see
           %{ftarget-ranlib=*} \
           %{fobject-path=*} %{v} --exec --startup \
           " SCAFFOLDNAME "%O \
-          %{!fshared:--ar %:objects() %:noobjects() -o %w%d%g.a } \
+          %{!fshared:--ar %:objects() %:noobjects() -o " \
+          RM_IF_NOSAVETEMP "%w%g.a } \
           " OBJECT " \
           %{fshared:%w%{o:%{o*}}%:nolink() %:objects() %:noobjects() \
             %:linkargs() } " LST " "
@@ -173,19 +178,19 @@ along with GCC; see the file COPYING3.  If not see
 
 #define GEN_SCAFFOLD_SRC \
      "%{fmakeinit:" SCAFFOLDNAME ".cpp;:" \
-                    SCAFFOLDNAME "%d.cpp}"
+                    RM_IF_NOSAVETEMP SCAFFOLDNAME ".cpp}"
 
 /* M2LINK compile main module (providing absense of -fonlylink)
    and link all project dependent modules.  */
 
 #define M2LINK \
-  "%{!S:%{!gm2gcc:%{!fonlylink:" GM2("%i","%d%g.s") " \n\
+  "%{!S:%{!gm2gcc:%{!fonlylink:" GM2("%i",RM_IF_NOSAVETEMP "%g.s") " \n\
                                " AS("%g.s","%w%b%O") " } \n\
                    %{!fuselist:" GM2L("%i"," -o %g.l ") " \n\
                                " GM2LORDER("%g.l","%g.lst") " \n\
                    " GM2LGEN("%{fuselist:%b.lst;:%g.lst}",\
                              GEN_SCAFFOLD_SRC,\
-			     "%d" SCAFFOLDNAME "%O") "}}\n\
+			     RM_IF_NOSAVETEMP SCAFFOLDNAME "%O") "}}\n\
     }"
 
 /* MODULA_LINK_SUPPORT only invoke link subprocesses if no -c option.  */
diff --git a/gm2tools/Makefile.in b/gm2tools/Makefile.in
index d228a6a9b39..386f2e4163a 100644
--- a/gm2tools/Makefile.in
+++ b/gm2tools/Makefile.in
@@ -639,8 +639,8 @@ distclean-generic:
 maintainer-clean-generic:
 	@echo "This command is intended for maintainers to use"
 	@echo "it deletes files that may require special tools to rebuild."
-@NATIVE_FALSE@install-exec-local:
 @NATIVE_FALSE@uninstall-local:
+@NATIVE_FALSE@install-exec-local:
 clean: clean-am
 
 clean-am: clean-binPROGRAMS clean-generic mostlyclean-am


                 reply	other threads:[~2022-05-04 15:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220504150733.162FC3858C53@sourceware.org \
    --to=gaius@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).