From patchwork Thu Sep 7 13:36:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arthur Cohen X-Patchwork-Id: 137639 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ab0a:0:b0:3f2:4152:657d with SMTP id m10csp2965619vqo; Thu, 7 Sep 2023 06:44:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE4V9Bp7h+ZMAae/bVsrFb8n6MrNgDXHgM/8TnTUqAuEJ8VQ7fvR6F51mP5svstcYoHvCZd X-Received: by 2002:a17:906:cc1:b0:9a5:b875:d76 with SMTP id l1-20020a1709060cc100b009a5b8750d76mr5109401ejh.28.1694094286943; Thu, 07 Sep 2023 06:44:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694094286; cv=none; d=google.com; s=arc-20160816; b=hlGZnipBVOx4q0kG5j0FkYFxHEFulXP4PdfPiGB1Gn/2BdzKdO7CQUcMEepv7bO4Ko RLWAU2tBM91plHXFcemy4xGdiHGHH5INHDc/pcAk7cpo84fqyf4B0JZOzt08Q6Kpk042 Sj4s2vxxnb4F00IEEWr67FOIHhH/BQLOtRJakEK9k+U0vAWnBMunMASPCJyE/guruPE8 pEPNQ1Sb5Grm8ovT8uzBU3/pakkR0dixzioMpqWUrWIWXEXX/60FBJMdnIalDaISgFgF tUlRpjBQgLhmpDd1fII/ToXbay8DFrM9ITsfvdMmB6Kz3EHVWpeqTeo3yuYjyhDCB0HU pIFw== 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=4SnrvU23jdoUsZwk8bWxMc5AOO/QiPj3XCWJq2jcOeg=; fh=wFq7tT6aDoWtju83L9lDAhBMEFwd5hWtfnM+XVolLD0=; b=OUFV9+/wRHEXrcrP6x3dqNGc5vZ965hzoOzluH7rol0YenOG0Y3eeDgiQyVE8LJNzX dwOQ241HPBw6g0QQ2FCgsb2J6VsSYAYSaJz1ugWiMpEmcoF2zmj04nZNgmG35o2WWxEw vCfi3Y8CHYIF2RwavER1oIaB3u8SgXcUKdnfpzEBY80QFtmnOAazE3+xMqEcnISAfgik Q7yb3HY+ECu97Xo66O4hOb+pytJQCn32Xm/lPnG418EOm5dVBEc8cpynXObjlZR0/LR9 yPiZKQ9S3YUrp5Dgp+UwXJUi57Gp8nJ1USd2vrAiKPm/mYGLOuU9qoLdMnRoJPT74Dbl uykA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@embecosm.com header.s=google header.b=Fj2V1DvQ; 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 y19-20020a170906449300b0099cfbdae62dsi10730294ejo.590.2023.09.07.06.44.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Sep 2023 06:44:46 -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=Fj2V1DvQ; 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 DB5913953821 for ; Thu, 7 Sep 2023 13:40:20 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by sourceware.org (Postfix) with ESMTPS id 4D0263858D1E for ; Thu, 7 Sep 2023 13:38:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4D0263858D1E 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-x42c.google.com with SMTP id ffacd0b85a97d-31c5c06e8bbso964607f8f.1 for ; Thu, 07 Sep 2023 06:38:31 -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=4SnrvU23jdoUsZwk8bWxMc5AOO/QiPj3XCWJq2jcOeg=; b=Fj2V1DvQe+hu0tiH4rVR0gWQungSrYGbFaTtaZ2BqJ0hOTk677daA3P0gBqtM6prsD nFK34ObD4vH45uPjJJTTmXnWselQosegUMwJcAAMKC+YIOnKA8oF7LC6xOdMR2QGPegW SQRRCb0a7DhzQYtuU7VU0ieM6CSuAg+ivPwJ4j6sL0NxTMVf+nVbokM75n6QiG4hGmlv x9Xks2UH8xbTYrSfF1aBZ0PSbM995Dn1T/5GBOzoGLRkxS/mdyXrKEL/UndhR6x9PKIo ryQ7hvuT453Cba8qzLTP7hEsFtIR0AI9wUYBku0MJuyX3QPeBWXkZyLMs19h8mWNLR2J nwSw== 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=4SnrvU23jdoUsZwk8bWxMc5AOO/QiPj3XCWJq2jcOeg=; b=C4N9/EBaDoLiQ50yM73gDBPfBlKIVY3USZCs3KPv2c4Mg7ETrHWH+JArFZclrOL6HU /fReHhIccAoGBWwXBKsoFUHonODN/jEHNAK4rQuJVK86UQba0tABRL+AbkuIolOHioGi bdtPnGV0hN/SP5Iv7xBVU3p2/0pJgwEiaTS5qw5p92OE3sWZRuXj9X1MtzQgfxA/tLU0 mgkjWoR3CTswB8Rr1SCDInGl26LiDl2cx3FA5L5xElHTnj/dQHZXTbco0Pm1ZRzLtLef te5Yz4X/hLwYJxumELFjOy2KNQAdq2mVpngHVIt9DFbwW0eMlF4MqWJ+vkryYbrq55gX LMMg== X-Gm-Message-State: AOJu0Yw57FqBIZhJJBDWt2yYYiSkRmt1yWjx+S2+UIfZqcjyiTlVRYzG dKrFy0Bx1SOkxiACRtpZnr9RgDJuK/jZ19+yFw== X-Received: by 2002:adf:e912:0:b0:309:1532:8287 with SMTP id f18-20020adfe912000000b0030915328287mr4937322wrm.19.1694093909730; 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.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Sep 2023 06:38:29 -0700 (PDT) From: arthur.cohen@embecosm.com To: gcc-patches@gcc.gnu.org Subject: [PATCH 07/14] rust: Implement TARGET_RUST_OS_INFO for *-*-netbsd* Date: Thu, 7 Sep 2023 15:36:33 +0200 Message-ID: <20230907133729.2518969-8-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.4 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: 1776386611284729132 X-GMAIL-MSGID: 1776386611284729132 From: Iain Buclaw gcc/ChangeLog: * config.gcc (*-*-netbsd*): Set rust_target_objs and target_has_targetrustm. * config/t-netbsd (netbsd-rust.o): New rule. * config/netbsd-rust.cc: New file. --- gcc/config.gcc | 2 ++ gcc/config/netbsd-rust.cc | 40 +++++++++++++++++++++++++++++++++++++++ gcc/config/t-netbsd | 4 ++++ 3 files changed, 46 insertions(+) create mode 100644 gcc/config/netbsd-rust.cc diff --git a/gcc/config.gcc b/gcc/config.gcc index 61d77567bb6..ad4c01dfc89 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -973,6 +973,8 @@ case ${target} in default_gnu_indirect_function=yes ;; esac + rust_target_objs="${rust_target_objs} netbsd-rust.o" + target_has_targetrustm=yes ;; *-*-openbsd*) tmake_file="t-openbsd" diff --git a/gcc/config/netbsd-rust.cc b/gcc/config/netbsd-rust.cc new file mode 100644 index 00000000000..9395466cbbe --- /dev/null +++ b/gcc/config/netbsd-rust.cc @@ -0,0 +1,40 @@ +/* NetBSD 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 NetBSD targets. */ + +static void +netbsd_rust_target_os_info (void) +{ + rust_add_target_info ("target_family", "unix"); + rust_add_target_info ("target_os", "netbsd"); + rust_add_target_info ("target_vendor", "unknown"); + rust_add_target_info ("target_env", ""); +} + +#undef TARGET_RUST_OS_INFO +#define TARGET_RUST_OS_INFO netbsd_rust_target_os_info + +struct gcc_targetrustm targetrustm = TARGETRUSTM_INITIALIZER; diff --git a/gcc/config/t-netbsd b/gcc/config/t-netbsd index 1d9a8ce8c7b..fdbfda52412 100644 --- a/gcc/config/t-netbsd +++ b/gcc/config/t-netbsd @@ -23,3 +23,7 @@ netbsd.o: $(srcdir)/config/netbsd.cc netbsd-d.o: $(srcdir)/config/netbsd-d.cc $(COMPILE) $< $(POSTCOMPILE) + +netbsd-rust.o: $(srcdir)/config/netbsd-rust.cc + $(COMPILE) $< + $(POSTCOMPILE)