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 E1F2F3858D35 for ; Thu, 7 Sep 2023 13:38:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E1F2F3858D35 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-307d20548adso970344f8f.0 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=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=Sf2YxHDCu3NUQBw2TB+5rJfrMElRGFJmclQwNyR9ptPI6dPf9R8IdLRIWXxQ8csOXb P8QvYxVQBdJC08siJ0R5cc2zTANddbrpdCSzB518cAgMQlEvRBf2eoXZYcHtEhqXp8WX h2ym+BsvMpFqR7tMfisBbbbte7ld71sivwn1y1yhDA8+0LIMz+q+im1xdSD/qcnEkfnh KYd75kPvlSPNzSrNhkEX6eHrMxJfb6vbh/QyF1Dwy9+vl4Mf5RDv1niD1c7SdSyy7lrE V+Wnv1zM8iyjCu7b4Svx9VOM27UXPs8mTpLQFgKl1hMw5KHBjcwfHdy/9RyD9dIRq4CW CqxQ== X-Gm-Message-State: AOJu0YzG1QoP/+ba0r6oxr2WDjyJJP9sKLR6g7lMwWIwm78VHjjnlH/f lRs/rG5t8jeoKCsXW2dmH04k8ccnEn5D++eCCA== X-Google-Smtp-Source: AGHT+IFRioW236rLgb1JKqWOLhtMvEQGvqjwiCksXLF+WTTPY4GbBaF1DU4WICm2GrrNaqwG7KhC8g== 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 Cc: gcc-rust@gcc.gnu.org, ibuclaw@gdcproject.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> 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,KAM_SHORT,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: * 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) -- 2.42.0