From patchwork Thu Sep 7 13:36:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arthur Cohen X-Patchwork-Id: 137640 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ab0a:0:b0:3f2:4152:657d with SMTP id m10csp2966046vqo; Thu, 7 Sep 2023 06:45:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHqyUzUy1a1/86NRiuQD/Wzey+A+WSbjd9W7quuNANfaFoFSX4WJu16pudTxRUvq/gzfucA X-Received: by 2002:a17:906:8442:b0:9a1:e613:2569 with SMTP id e2-20020a170906844200b009a1e6132569mr4863619ejy.16.1694094328796; Thu, 07 Sep 2023 06:45:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694094328; cv=none; d=google.com; s=arc-20160816; b=QSdiGiDWfMsmuij2NvXVEo6U83m+29kAd8U934jL1TDMHZBppN31ihNb/5vFmNshxb EvF40j0V6bL514yEngoNAjM+gPCXDesHn5eaT/ID5lYw2+mikSiz2HvvcJIHEXz71Ngs B4LgczWxvwbmSAN07S01B9EmSZXVt1ocTnUo0cTfx0+tq4aaI8L7EjcNwyK56T+nZZWS 6cLU7dLc5lvtXvTK6jdHpmltvmNV0nJ8oyPclSsnZB1QAcwYXbEy+bR660CfDieeyMbt 8NAkCKlMsxPjCniLXvI8gVNDZLOIeUg9EqsrJIRy2T+bc2oKZV/8M7ElhqQqzdEVDeXX 1Z2w== 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=kqOU5lN5r+wR6NUXRSam3b2vkSF4erA7P5xTu1WF2b8=; fh=wFq7tT6aDoWtju83L9lDAhBMEFwd5hWtfnM+XVolLD0=; b=cJFjR3IGFAORx4ngoo/Eq3LPshwCq26Z+qTBNzvx1ez57tQQ8WQgkbDGRbIHAxgomX aHuxCVdfHi93H6KjNwHfarqmnHH+J+JqAEzY9Fy4sx3Px16sRLLDrDpZu4N807yqWtKr C6r1GCCfLqUENnZp3PMlf9u2Rp70PPkjx3VzHDIVuJZ2kbndrBg1SnHIyQuwM7/4GWpN OUq6BIIVqb/Os/j2QhaOmI/fxafDytKQRowrfFIBHh6YDInEoL9/EoUkTLtEesEOdEoJ Zefg8YDlaibheAyVdNlSqWziaZyPbsIw90x+3nh4VI0WnCJFf+ycGGnppu9PPdn67Ggx tnnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@embecosm.com header.s=google header.b=R8A1E9cY; 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 ke25-20020a17090798f900b0098874379199si11419181ejc.163.2023.09.07.06.45.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Sep 2023 06:45:28 -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=R8A1E9cY; 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 DF91539490AB for ; Thu, 7 Sep 2023 13:40:37 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org 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 73E5F3857C43 for ; Thu, 7 Sep 2023 13:38:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 73E5F3857C43 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-307d58b3efbso923828f8f.0 for ; Thu, 07 Sep 2023 06:38:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; t=1694093912; x=1694698712; 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=kqOU5lN5r+wR6NUXRSam3b2vkSF4erA7P5xTu1WF2b8=; b=R8A1E9cYpclX1fW66RAb1PbkEqNstQ85x2Pw5smHecIIjKZJ7ztv2+WnTxqtpcAGFV cBeZjzr+OLueSEADu3HygeZFfol4abFqlx+gzIrIFSNmB5Q4NgH9FW2RIDsI6LNvMPbD vyLbk4FNbmOoK/k1S9bEvGk/XYDxB/eiaovjranHBp5SGbd1RdFxV+tYF+TB7IoQVBaq c2+1NrS3EFpGhumdenhE2Fke1XPOuwkH7AKqAWe694mdLLB1x+KbocWGygCRDnEwW7Cx j3B9pq+ZYWLg/Noi5Ijrx99Ugxe5UZCTRkaoi1Ppjun99YIS2hI1RITfR2PdFjGslhY4 ndwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1694093912; x=1694698712; 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=kqOU5lN5r+wR6NUXRSam3b2vkSF4erA7P5xTu1WF2b8=; b=ZFvtk1Tl8MAFppPjpU9WrPrAQUqV/qZ/KjdE9NuFNYv7VWzpYzkFkKIyy18+ZHo6hs kjCjiMKkXxnXWOxgM2NprPaJrCeqM8bCSs38iv+pXfx21pFFV+3tz/BhMVrmyIuEncfg 40Ak7Bznr1lXVc0TrcuMVdsv07GQE0iy+dvI+xdMu10U5hZzmv1FG0UpIw5idY/wy248 agyMI9pCnTj+yIawPHxdTBMbKuaqxA8ZaqrBabBmJHGy95WWb+T9/mbn9wd1GiZ6o87h co3ujW2+MArdOJKP8HsB4HBk+IZMXzRRqRkstK7ChEtCrdSOVScOrqbaDv2rkMQX7289 KgHQ== X-Gm-Message-State: AOJu0Ywjsyp92o91LM7/NZubZSMYF2DK2M2fKdUQweoNX135VCHDK6aL wl9i9rPtPuv474CmrdLRLww6rIfwbcwpk13pRw== X-Received: by 2002:a5d:6b49:0:b0:31a:ed75:75d6 with SMTP id x9-20020a5d6b49000000b0031aed7575d6mr4931005wrw.15.1694093911987; Thu, 07 Sep 2023 06:38:31 -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.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Sep 2023 06:38:31 -0700 (PDT) From: arthur.cohen@embecosm.com To: gcc-patches@gcc.gnu.org Subject: [PATCH 10/14] rust: Implement TARGET_RUST_OS_INFO for *-*-dragonfly* Date: Thu, 7 Sep 2023 15:36:36 +0200 Message-ID: <20230907133729.2518969-11-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: 1776386654490105982 X-GMAIL-MSGID: 1776386654490105982 From: Iain Buclaw gcc/ChangeLog: * config.gcc (*-*-dragonfly*): Set rust_target_objs and target_has_targetrustm. * config/t-dragonfly (dragonfly-rust.o): New rule. * config/dragonfly-rust.cc: New file. --- gcc/config.gcc | 2 ++ gcc/config/dragonfly-rust.cc | 40 ++++++++++++++++++++++++++++++++++++ gcc/config/t-dragonfly | 4 ++++ 3 files changed, 46 insertions(+) create mode 100644 gcc/config/dragonfly-rust.cc diff --git a/gcc/config.gcc b/gcc/config.gcc index 81142763ac2..9344e26a48e 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -813,6 +813,8 @@ case ${target} in d_target_objs="${d_target_objs} dragonfly-d.o" tmake_file="${tmake_file} t-dragonfly" target_has_targetdm=yes + rust_target_objs="${rust_target_objs} dragonfly-rust.o" + target_has_targetrustm=yes ;; *-*-freebsd*) # This is the generic ELF configuration of FreeBSD. Later diff --git a/gcc/config/dragonfly-rust.cc b/gcc/config/dragonfly-rust.cc new file mode 100644 index 00000000000..ce501d1b6fd --- /dev/null +++ b/gcc/config/dragonfly-rust.cc @@ -0,0 +1,40 @@ +/* DragonFly 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 DragonFly targets. */ + +static void +dragonfly_rust_target_os_info (void) +{ + rust_add_target_info ("target_family", "unix"); + rust_add_target_info ("target_os", "dragonfly"); + rust_add_target_info ("target_vendor", "unknown"); + rust_add_target_info ("target_env", ""); +} + +#undef TARGET_RUST_OS_INFO +#define TARGET_RUST_OS_INFO dragonfly_rust_target_os_info + +struct gcc_targetrustm targetrustm = TARGETRUSTM_INITIALIZER; diff --git a/gcc/config/t-dragonfly b/gcc/config/t-dragonfly index b80587dd0d3..e60fa18f116 100644 --- a/gcc/config/t-dragonfly +++ b/gcc/config/t-dragonfly @@ -19,3 +19,7 @@ dragonfly-d.o: $(srcdir)/config/dragonfly-d.cc $(COMPILE) $< $(POSTCOMPILE) + +dragonfly-rust.o: $(srcdir)/config/dragonfly-rust.cc + $(COMPILE) $< + $(POSTCOMPILE)