From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by sourceware.org (Postfix) with ESMTPS id 54D553858C2D for ; Thu, 7 Sep 2023 13:38:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 54D553858C2D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-31c479ede21so986197f8f.2 for ; Thu, 07 Sep 2023 06:38:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; t=1694093907; x=1694698707; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=O3ESbbjJGuCLOZ+lKD0smOJZNgNyq9wBq2S2V+ukR88=; b=hqQHz7k3C/2JeRXh7csLe6CqUS7G7tIE8o7u0aK+tVZp4fFeLWzNtXuctyqGykYQs+ YOvndlyWsk5voWqptDQyuzS9ZSR+7Hp9OJJPe3zvfdxOvM1pPyo0Hmx4B8inXXZFS6sh 8MLjtLy8QsROBw4rlOf/Ls/wwgCRjQSKwRDwV3JrCsxr85AOffZi5HBjuro572ZHKtpY zmx9b/OOBXDQpjFwAA0ZX446hXcDFFme1Auoq20hE8T+uA0nfOsZjFbC541TpgnUxyiL Vwm3skcKlA3E7h+6MjoTyt2bioyiZroctFaqCZPJGjFQWTil6dvcaM08RTGV8D9i1gax RTSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1694093907; x=1694698707; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=O3ESbbjJGuCLOZ+lKD0smOJZNgNyq9wBq2S2V+ukR88=; b=N0gSAIotH6TtmwWxjPt6ZGGCA0FEWixWFcTkx8luKKQHuT8j81NEUjCv5h9SYgqsNw PGJGp23MsBzYGQICl56i+uLtgNiAnj5uhh1/SVN1o30Wi7PHHwrA6H35ixreEGXUcubM mO/dRrIen/Pg9YSVP9Waswtp/PbBrh5r0SocAdExqnDQjFTyhLapA+gKzcKtE9n04bEz 0S5Egp6PqajP6fC6ZQZ7l6V9DeM+1az5ubhkJCAG6razxfA7HGeVJZK00FCJF0U9s9qj nZLmNMn9L6oe1E1tbx9E9SaKjLjPtI0ZXrznZAGuCHp1YmJdnCRmD8W0rlYtzTMJm668 IMgg== X-Gm-Message-State: AOJu0YyvkSWH6a4vm4qHkbVLVkwSaZKz5C4PJ0nfRC8xh5e4goS2GTql fSZrTt+FY+1zbzPT5MuVAjRkFFBLna50bl4GhQ== X-Google-Smtp-Source: AGHT+IEJjLdz0ISMEO+HZgd20BvahLrjGjIep8a7muguIequE31qOaKGdRqHxtHJkajiZc/SySiKAw== X-Received: by 2002:a5d:43c2:0:b0:31f:4173:2ac8 with SMTP id v2-20020a5d43c2000000b0031f41732ac8mr4859841wrr.18.1694093906911; Thu, 07 Sep 2023 06:38:26 -0700 (PDT) Received: from platypus.localdomain ([62.23.166.218]) by smtp.gmail.com with ESMTPSA id bt12-20020a056000080c00b0031433443265sm17693052wrb.53.2023.09.07.06.38.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Sep 2023 06:38:26 -0700 (PDT) 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 Message-ID: <20230907133729.2518969-4-arthur.cohen@embecosm.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230907133729.2518969-2-arthur.cohen@embecosm.com> References: <20230907133729.2518969-2-arthur.cohen@embecosm.com> Reply-To: arthur.cohen@embecosm.com MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-14.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: From: Iain Buclaw 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