From patchwork Thu Sep 7 13:36:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arthur Cohen X-Patchwork-Id: 137632 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ab0a:0:b0:3f2:4152:657d with SMTP id m10csp2963443vqo; Thu, 7 Sep 2023 06:40:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEqdAkEm8ZlfgyD8yaKpKMD7QQTF0AjTKvw3kzEJy4WTSWxghY+GrfWUSMpNZJYAH4xMqXH X-Received: by 2002:a17:906:3ca9:b0:9a5:a701:2b90 with SMTP id b9-20020a1709063ca900b009a5a7012b90mr4636790ejh.40.1694094006635; Thu, 07 Sep 2023 06:40:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694094006; cv=none; d=google.com; s=arc-20160816; b=qdQOIkHlDXKsDQsLKA6TtI6I0UnxNLyzbQugVyuBd5pGKt08f1oiTNEvrUJSiEPIyC lJr1JUWp4xkZT+f2DDYcniv/KK/H3Fft0KmudIvTrNlRfxbRnko7uCWwuIDuYZ1P8XSg w0TCVKzZ7TKuoS0yZEk226P6LwdY2aaKjaoxETSoJvtcI5e3MAUi7HRktV5MBfbx/33+ YZM4sLEE/zCZO0i5izJzBKHoNEeoSCObxrg9Mfc5PhvYCYppIlRq4exajID2UlRcbqc8 bldpeDFdug1BGW+DARd3hsd0gFL8XfZI4loW4JPg39yXYhzwr5wmlXClX83GsOq1Dz4k Lm5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature:dmarc-filter :delivered-to; bh=O3ESbbjJGuCLOZ+lKD0smOJZNgNyq9wBq2S2V+ukR88=; fh=wFq7tT6aDoWtju83L9lDAhBMEFwd5hWtfnM+XVolLD0=; b=tQumLuvQSLae8cDWZnCEMqAvXXMuDibOZVfkuCmFQ/sIvQxfvY/auLrk1rXRuZ2rlh 9mc0hIQiJb8VZCsWQ4Fwbmibtj+FLtdNFL5zKpyJy8Aupf9mdiq9Oe0mjM6/uTTEg8Xe aec8zFsZ4bg5OE6y8YebfZhrshEdyC9ytalqnTBBprcEkNzxtsuYkMgcK+f3u0QR5AVo JHsLKNwUG0vjfikF3cB/VGMYRijepR1Pymxo2YU/y+EXZ69YUCa0d1jG1XHmauiYYXdv pwHioDF1Zt46Q+8cRJacNNbAbMb4zO1hzxAOewy1rVJtceWmd/wjEiB9p8ltp/kITJdL ee1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@embecosm.com header.s=google header.b=hqQHz7k3; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id md15-20020a170906ae8f00b0099da03ea7d7si10308985ejb.94.2023.09.07.06.40.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Sep 2023 06:40:06 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=fail header.i=@embecosm.com header.s=google header.b=hqQHz7k3; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D2F0B38319FE for ; Thu, 7 Sep 2023 13:39:00 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by sourceware.org (Postfix) with ESMTPS id 8626B3858410 for ; Thu, 7 Sep 2023 13:38:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8626B3858410 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-x436.google.com with SMTP id ffacd0b85a97d-31f7638be6eso216583f8f.3 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=lbVJ3rtY4SttNS0TVzN8wmjmAGHxkIdDb7QS5OnfX7IEAk6wsqchbx6alB/qMfll09 hFy8NW9hUzpMtRxw4BadCWnWS5m36j2ovIZ+nqHzPQaNP4OIktAzeEaOznjTgJs8Le3o pDIgzD6hsRaQrkR4gijAqU6f6x2sVWGQOC7RZTiP1TeeoqDBezBGSdygWRoyhbgLGMZD +OGGNXjhAaK9/LBkHvop0TAcNlhYN8AWmAELUuJYNQlQ/UldXYSpg4whdZP9HSU+cxsl u7Yk8I1wezye9XxAnx68hnFh3KFlmIRCxMU0/5J97ijxWYpFTOHPo5tOdo1FpcVm/aYP zVmw== X-Gm-Message-State: AOJu0YxRxf3vLBBIDjQl9MxzAKMZ7KdL+BD0CvmSy2qMuldGOZC0rkUb P9gnmLSKICZL2GkrW3WauWYFST9TZiBSTW4ypQ== 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 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> MIME-Version: 1.0 X-Spam-Status: No, score=-14.2 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=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: arthur.cohen@embecosm.com Cc: gcc-rust@gcc.gnu.org Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776386316837976926 X-GMAIL-MSGID: 1776386316837976926 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)