public inbox for gcc-rust@gcc.gnu.org
 help / color / mirror / Atom feed
From: arthur.cohen@embecosm.com
To: gcc-patches@gcc.gnu.org
Cc: gcc-rust@gcc.gnu.org, ibuclaw@gdcproject.org
Subject: [PATCH 03/14] rust: Reintroduce TARGET_RUST_OS_INFO hook
Date: Thu,  7 Sep 2023 15:36:29 +0200	[thread overview]
Message-ID: <20230907133729.2518969-4-arthur.cohen@embecosm.com> (raw)
In-Reply-To: <20230907133729.2518969-2-arthur.cohen@embecosm.com>

From: Iain Buclaw <ibuclaw@gdcproject.org>

gcc/ChangeLog:

	* doc/tm.texi: Regenerate.
	* doc/tm.texi.in: Document TARGET_RUST_OS_INFO.

gcc/rust/ChangeLog:

	* rust-session-manager.cc (Session::init): Call
	targetrustm.rust_os_info.
	* rust-target.def (rust_os_info): New hook.
---
 gcc/doc/tm.texi                  | 5 +++++
 gcc/doc/tm.texi.in               | 2 ++
 gcc/rust/rust-session-manager.cc | 1 +
 gcc/rust/rust-target.def         | 8 ++++++++
 4 files changed, 16 insertions(+)

diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index f7a2f8be542..b0779724d30 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -10975,6 +10975,11 @@ Configuration pairs predefined by this hook apply to all files that are being
 compiled.
 @end deftypefn
 
+@deftypefn {Rust Target Hook} void TARGET_RUST_OS_INFO (void)
+Similar to @code{TARGET_RUST_CPU_INFO}, but is used for configuration info
+relating to the target operating system.
+@end deftypefn
+
 @node Named Address Spaces
 @section Adding support for named address spaces
 @cindex named address spaces
diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in
index cd4e687aea1..d3e18955628 100644
--- a/gcc/doc/tm.texi.in
+++ b/gcc/doc/tm.texi.in
@@ -7150,6 +7150,8 @@ floating-point support; they are not included in this mechanism.
 
 @hook TARGET_RUST_CPU_INFO
 
+@hook TARGET_RUST_OS_INFO
+
 @node Named Address Spaces
 @section Adding support for named address spaces
 @cindex named address spaces
diff --git a/gcc/rust/rust-session-manager.cc b/gcc/rust/rust-session-manager.cc
index 112960ad3c0..ce1fdbb02af 100644
--- a/gcc/rust/rust-session-manager.cc
+++ b/gcc/rust/rust-session-manager.cc
@@ -140,6 +140,7 @@ Session::init ()
 {
   // initialize target hooks
   targetrustm.rust_cpu_info ();
+  targetrustm.rust_os_info ();
 
   // target-independent values that should exist in all targets
   options.target_data.insert_key_value_pair ("target_pointer_width",
diff --git a/gcc/rust/rust-target.def b/gcc/rust/rust-target.def
index 285b7503528..9c72c1c86d3 100644
--- a/gcc/rust/rust-target.def
+++ b/gcc/rust/rust-target.def
@@ -40,5 +40,13 @@ compiled.",
  void, (void),
  hook_void_void)
 
+/* Environmental OS info relating to the target OS.  */
+DEFHOOK
+(rust_os_info,
+ "Similar to @code{TARGET_RUST_CPU_INFO}, but is used for configuration info\n\
+relating to the target operating system.",
+ void, (void),
+ hook_void_void)
+
 /* Close the 'struct gcc_targetrustm' definition.  */
 HOOK_VECTOR_END (C90_EMPTY_HACK)
-- 
2.42.0


  parent reply	other threads:[~2023-09-07 13:38 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-07 13:36 [PATCH 01/14] rust: Add skeleton support and documentation for targetrustm hooks arthur.cohen
2023-09-07 13:36 ` [PATCH 02/14] rust: Reintroduce TARGET_RUST_CPU_INFO hook arthur.cohen
2023-09-07 13:36 ` arthur.cohen [this message]
2023-09-07 13:36 ` [PATCH 04/14] rust: Implement TARGET_RUST_CPU_INFO for i[34567]86-*-* and x86_64-*-* arthur.cohen
2023-09-07 13:36 ` [PATCH 05/14] rust: Implement TARGET_RUST_OS_INFO for *-*-darwin* arthur.cohen
2023-09-07 13:36 ` [PATCH 06/14] rust: Implement TARGET_RUST_OS_INFO for *-*-freebsd* arthur.cohen
2023-09-07 13:36 ` [PATCH 07/14] rust: Implement TARGET_RUST_OS_INFO for *-*-netbsd* arthur.cohen
2023-09-07 13:36 ` [PATCH 08/14] rust: Implement TARGET_RUST_OS_INFO for *-*-openbsd* arthur.cohen
2023-09-07 13:36 ` [PATCH 09/14] rust: Implement TARGET_RUST_OS_INFO for *-*-solaris2* arthur.cohen
2023-09-07 13:36 ` [PATCH 10/14] rust: Implement TARGET_RUST_OS_INFO for *-*-dragonfly* arthur.cohen
2023-09-07 13:36 ` [PATCH 11/14] rust: Implement TARGET_RUST_OS_INFO for *-*-vxworks* arthur.cohen
2023-09-07 13:36 ` [PATCH 12/14] rust: Implement TARGET_RUST_OS_INFO for *-*-fuchsia* arthur.cohen
2023-09-07 13:36 ` [PATCH 13/14] rust: Implement TARGET_RUST_OS_INFO for i[34567]86-*-mingw* and x86_64-*-mingw* arthur.cohen
2023-09-07 13:36 ` [PATCH 14/14] rust: Implement TARGET_RUST_OS_INFO for *-*-*linux* arthur.cohen

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=20230907133729.2518969-4-arthur.cohen@embecosm.com \
    --to=arthur.cohen@embecosm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gcc-rust@gcc.gnu.org \
    --cc=ibuclaw@gdcproject.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).