public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Thomas Fitzsimmons <fitzsim@fitzsim.org>
To: Philip Herron <philip.herron@embecosm.com>
Cc: gcc@gcc.gnu.org
Subject: Re: GCC Rust git branch
Date: Thu, 27 May 2021 23:05:51 -0400	[thread overview]
Message-ID: <m3v9735zhs.fsf@fitzsim.org> (raw)
In-Reply-To: <5b2057ae-039c-6805-20fe-133df71c120e@embecosm.com>

[-- Attachment #1: Type: text/plain, Size: 569 bytes --]

Hi Philip,

Philip Herron <philip.herron@embecosm.com> writes:

> As some of you might know, I have been working on GCC Rust over on
> GitHub https://github.com/Rust-GCC/gccrs. As the project is moving
> forward and enforcing GCC copyright assignments for contributors, I
> would like to create a branch on the GCC git repo to show the intention
> to be upstream with GCC someday.

I tried building GCC Rust on ppc64le.  With the attached patches,
"make check-rust" succeeds with:

		=== rust Summary ===

# of expected passes		2368
# of expected failures		26

Thomas


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-rs6000-Override-TARGET_RUST_OS_INFO-in-linux64.h.patch --]
[-- Type: text/x-diff, Size: 1356 bytes --]

From 42099a90a23c31d1af95ceac590938d50a362cf9 Mon Sep 17 00:00:00 2001
From: Thomas Fitzsimmons <fitzsim@fitzsim.org>
Date: Thu, 27 May 2021 21:53:29 -0400
Subject: [PATCH 1/2] rs6000: Override TARGET_RUST_OS_INFO in linux64.h

Both config/rs6000/sysv4.h and config/rs6000/linux64.h define
TARGET_RUST_OS_INFO, and both are included in that order in tm.h.  This
change eliminates the error directive, permitting the more specific
definition in linux64.h to override the prior definition in sysv4.h.

gcc/ChangeLog:

2021-05-27  Thomas Fitzsimmons  <fitzsim@fitzsim.org>

	* config/rs6000/linux64.h: Undefine TARGET_RUST_OS_INFO before
	defining it.
---
 gcc/config/rs6000/linux64.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
index fbd8cf0a693..536007ca685 100644
--- a/gcc/config/rs6000/linux64.h
+++ b/gcc/config/rs6000/linux64.h
@@ -314,9 +314,8 @@ extern int dot_symbols;
     }							\
   while (0)
 
-#ifdef TARGET_RUST_OS_INFO
-# error "TARGET_RUST_OS_INFO already defined in linux64.h (rs6000) - c++ undefines it and redefines it."
-#endif
+/* Override less-specific rs6000/sysv4.h definition. */
+#undef TARGET_RUST_OS_INFO
 #define TARGET_RUST_OS_INFO()          \
   do {                                 \
     GNU_USER_TARGET_RUST_OS_INFO();		\
-- 
2.30.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-rs6000-Recognize-GNU-Rust-when-producing-epilogue.patch --]
[-- Type: text/x-diff, Size: 1690 bytes --]

From cd4d663c13d27a53ccabeef3d7d8cffa7a5a5365 Mon Sep 17 00:00:00 2001
From: Thomas Fitzsimmons <fitzsim@fitzsim.org>
Date: Thu, 27 May 2021 21:55:46 -0400
Subject: [PATCH 2/2] rs6000: Recognize GNU Rust when producing epilogue

Handling the GNU Rust language when writing a function's epilogue is
necessary to avoid an internal compiler error.

gcc/ChangeLog:

2021-05-27  Thomas Fitzsimmons  <fitzsim@fitzsim.org>
            Mark Wielaard  <mark@klomp.org>

	* config/rs6000/rs6000-logue.c (rs6000_output_function_epilogue):
	Set language type field to 0 for GNU Rust.

Co-Authored-By: Mark Wielaard <mark@klomp.org>
---
 gcc/config/rs6000/rs6000-logue.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gcc/config/rs6000/rs6000-logue.c b/gcc/config/rs6000/rs6000-logue.c
index b0ac183ceff..7da8db6d232 100644
--- a/gcc/config/rs6000/rs6000-logue.c
+++ b/gcc/config/rs6000/rs6000-logue.c
@@ -5262,12 +5262,13 @@ rs6000_output_function_epilogue (FILE *file)
 	 use language_string.
 	 C is 0.  Fortran is 1.  Ada is 3.  Modula-2 is 8.  C++ is 9.
 	 Java is 13.  Objective-C is 14.  Objective-C++ isn't assigned
-	 a number, so for now use 9.  LTO, Go, D, and JIT aren't assigned
-	 numbers either, so for now use 0.  */
+	 a number, so for now use 9.  LTO, Go, D, Rust, and JIT aren't
+	 assigned numbers either, so for now use 0.  */
       if (lang_GNU_C ()
 	  || ! strcmp (language_string, "GNU GIMPLE")
 	  || ! strcmp (language_string, "GNU Go")
 	  || ! strcmp (language_string, "GNU D")
+	  || ! strcmp (language_string, "GNU Rust")
 	  || ! strcmp (language_string, "libgccjit"))
 	i = 0;
       else if (! strcmp (language_string, "GNU F77")
-- 
2.30.0


  parent reply	other threads:[~2021-05-28  3:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-24 13:24 Philip Herron
2021-05-24 16:24 ` Joseph Myers
2022-06-08 12:36   ` Thomas Schwinge
2021-05-24 18:29 ` Mark Wielaard
2021-05-28 10:31   ` Philip Herron
2021-05-30 22:33     ` Mark Wielaard
2021-05-28  3:05 ` Thomas Fitzsimmons [this message]
2021-05-28 10:18   ` Philip Herron
2021-05-28 11:48     ` Marc Poulhiès
2021-05-30 22:49     ` Mark Wielaard
2021-05-28  3:22 ` Jason Merrill
2021-05-28 10:19   ` Philip Herron
2022-06-08 10:58     ` Document <gcc-rust@gcc.gnu.org> mailing list (was: GCC Rust git branch) Thomas Schwinge

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=m3v9735zhs.fsf@fitzsim.org \
    --to=fitzsim@fitzsim.org \
    --cc=gcc@gcc.gnu.org \
    --cc=philip.herron@embecosm.com \
    /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).