From patchwork Thu Sep 7 13:36:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arthur Cohen X-Patchwork-Id: 137637 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ab0a:0:b0:3f2:4152:657d with SMTP id m10csp2965302vqo; Thu, 7 Sep 2023 06:44:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHQilKBhJuvROLhs2zOslkpP/9UtIJ54oRo18nNgOGPFks3fM5+cC9lsenEDZVTl6J3K9sn X-Received: by 2002:a2e:9a84:0:b0:2bc:fd7b:8ded with SMTP id p4-20020a2e9a84000000b002bcfd7b8dedmr4861936lji.20.1694094242454; Thu, 07 Sep 2023 06:44:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694094242; cv=none; d=google.com; s=arc-20160816; b=WVtsTlqHhBFlSgbTEZrfcBTitFfEe94nb3nRZHWhPJcLN4H4gDyL/7ogaPULH6yyy1 SQdFmvjVX7MO0HrrOnuOJKYqm2W0giFrND5yIP6uuiuVFZwKmGygnbJ9WzjU3Ro2bTlb M8wF1TWd8Vl/hB7rHfeOBSFyEyJ4vEmLr8H+3PYfSTvl8jUzeJx/cfKemC6iqKduASE0 MOZncWRp5AiiRvCQgnqlB6U4atqzA0hJR73E8vde8leCUOTSdRwL3VBYwzD3gqU11dgO j+uj2HHIrcBYpE9T+Vj2akT5PfjL6CPFwLG92sRtawrFweoDoNlqrdb+0SyPAn9qSood 2XZA== 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=Hdi0TTbPXLL2KofkGjlaE+Q4TIaQM2y/B4wvDfWj3RM=; fh=wFq7tT6aDoWtju83L9lDAhBMEFwd5hWtfnM+XVolLD0=; b=RPW7whjy+B9DfRz27IWP93VrpOra4N6zMJK7EsjuedQNxS12g4EeR6KOdbw3PNPl+3 BJZBo0nC0Ic+WK0tTRYz8flJZNwjNWbURYqV1xx8L+wgKciZFa45vwkUCX/ekWQCNK84 3UpulOV1FtTy977ia+yS2T3YoD1WNWMT3qnwH9AH8m5SBqvnT3yxQ1VIaDTEibIz6xzo FzXVaucGcBlZzhLFXCI/keldrTmKi9/02LiO4SgRWZflJxRpN5LTA0TEfCrvSB7knTrD n/gJiriUUjDzsHQmKB6KEhdZx+7EeJc5/kNHXAQXsEvwKP+eced0+w4Fi/2jciM8XPzj zHGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@embecosm.com header.s=google header.b=ZiAd4SJX; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id z7-20020a1709060ac700b0099bcf3c0ac6si11169760ejf.472.2023.09.07.06.44.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Sep 2023 06:44:02 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=fail header.i=@embecosm.com header.s=google header.b=ZiAd4SJX; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c 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 41ED5394D8E1 for ; Thu, 7 Sep 2023 13:40:06 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by sourceware.org (Postfix) with ESMTPS id 76E3E3858C66 for ; Thu, 7 Sep 2023 13:38:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 76E3E3858C66 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-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-3fef56f7248so10528195e9.3 for ; Thu, 07 Sep 2023 06:38:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; t=1694093909; x=1694698709; 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=Hdi0TTbPXLL2KofkGjlaE+Q4TIaQM2y/B4wvDfWj3RM=; b=ZiAd4SJXxA8Lc2zm2TfLhy76EA+TicxChytukt6MPUhD8wNPYQrTQLUu7VOWVFb8LS zfAS43FQPLT5FurGnp8hKpMTkQ3Swh08IP8qPAYqRwVlQsF/vBtV4QES5lDlyDV9VRsF 1TgoTjewpptXbfrCEPR1+848SbAEju7JoXhROtH9Jx8Hu/1HTPMNZkMXpMrWMjLvOVWJ GMSU08Ud2EsvBdzsNopSEd+f2RdpRSJz8Dtv5To/s4VVY1HlXP2vG1+c624ds9sUw1yx Eg0jDoMo9Y29kHHQWxTw6Nb4Xa3JInbtVju77sNQjn7hSUC21KMqvezi5QkDsiHmC905 m3Yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1694093909; x=1694698709; 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=Hdi0TTbPXLL2KofkGjlaE+Q4TIaQM2y/B4wvDfWj3RM=; b=j4II71MfnT6/kWfg+H6mUpAaQ+mlKIJ8/I8jcUC9pqSJlFW9dd81zS3DJz/aHI/pTs DWvSCOh2z5I/au8lVWNSUDTOWfsic34q67oKmLEH06m7f0dDrmBorzC5cDvMVnmKExXf TT11aMcrvLfT8D56/z9IeyAt0h63Z4tNoKPjGhXxUH0/AQh2n2cs0cTWBPmXOaRDGyEd q+UeyaoQS6yhb4nQnvl4a8aPUxsUzwbBcmPC6S1GMkt3+3jmh91+S/EqUqkg3cNW6Qxn WChNHbAB7WDQl8YV3jQ9ffaT1ljWtvDccOG+PUwe7NK2mukuRnr+RUNUNVl4weNfCcgU x7UA== X-Gm-Message-State: AOJu0YxNgsJteQD0dRwU61xV8nAdzfNtoaq64kenM0+rbA+uqJ4rjoDn tuYrP9gziJSeeGE1vrnkes30XHxoRhbk0LnDIQ== X-Received: by 2002:a7b:c855:0:b0:3f8:fac0:ad40 with SMTP id c21-20020a7bc855000000b003f8fac0ad40mr4751810wml.29.1694093909014; Thu, 07 Sep 2023 06:38:29 -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.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Sep 2023 06:38:28 -0700 (PDT) From: arthur.cohen@embecosm.com To: gcc-patches@gcc.gnu.org Subject: [PATCH 06/14] rust: Implement TARGET_RUST_OS_INFO for *-*-freebsd* Date: Thu, 7 Sep 2023 15:36:32 +0200 Message-ID: <20230907133729.2518969-7-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, KAM_SHORT, 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: 1776386564533975366 X-GMAIL-MSGID: 1776386564533975366 From: Iain Buclaw gcc/ChangeLog: * config.gcc (*-*-freebsd*): Set rust_target_objs and target_has_targetrustm. * config/t-freebsd (freebsd-rust.o): New rule. * config/freebsd-rust.cc: New file. --- gcc/config.gcc | 2 ++ gcc/config/freebsd-rust.cc | 40 ++++++++++++++++++++++++++++++++++++++ gcc/config/t-freebsd | 4 ++++ 3 files changed, 46 insertions(+) create mode 100644 gcc/config/freebsd-rust.cc diff --git a/gcc/config.gcc b/gcc/config.gcc index a654c7c5a83..61d77567bb6 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -864,6 +864,8 @@ case ${target} in d_target_objs="${d_target_objs} freebsd-d.o" tmake_file="${tmake_file} t-freebsd" target_has_targetdm=yes + rust_target_objs="${rust_target_objs} freebsd-rust.o" + target_has_targetrustm=yes ;; *-*-fuchsia*) native_system_header_dir=/include diff --git a/gcc/config/freebsd-rust.cc b/gcc/config/freebsd-rust.cc new file mode 100644 index 00000000000..1dbf2ed8ef9 --- /dev/null +++ b/gcc/config/freebsd-rust.cc @@ -0,0 +1,40 @@ +/* FreeBSD support needed only by Rust front-end. + Copyright (C) 2022 Free Software Foundation, Inc. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 3, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +. */ + +#include "config.h" +#include "system.h" +#include "coretypes.h" +#include "tm.h" +#include "tm_rust.h" +#include "rust/rust-target.h" +#include "rust/rust-target-def.h" + +/* Implement TARGET_RUST_OS_INFO for FreeBSD targets. */ + +static void +freebsd_rust_target_os_info (void) +{ + rust_add_target_info ("target_family", "unix"); + rust_add_target_info ("target_os", "freebsd"); + rust_add_target_info ("target_vendor", "unknown"); + rust_add_target_info ("target_env", ""); +} + +#undef TARGET_RUST_OS_INFO +#define TARGET_RUST_OS_INFO freebsd_rust_target_os_info + +struct gcc_targetrustm targetrustm = TARGETRUSTM_INITIALIZER; diff --git a/gcc/config/t-freebsd b/gcc/config/t-freebsd index fb36685653a..d4b4615e567 100644 --- a/gcc/config/t-freebsd +++ b/gcc/config/t-freebsd @@ -19,3 +19,7 @@ freebsd-d.o: $(srcdir)/config/freebsd-d.cc $(COMPILE) $< $(POSTCOMPILE) + +freebsd-rust.o: $(srcdir)/config/freebsd-rust.cc + $(COMPILE) $< + $(POSTCOMPILE)