From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 2E53C38582A4 for ; Thu, 7 Sep 2023 13:38:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2E53C38582A4 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-31c3df710bdso913274f8f.1 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=Q8+dO0FkP/mO/tI9tV8Rd7X+dQBVmfQhgVfs0xHKlHGld3c3B0CzCUyREsAaTQVpTw SkZ9DjlFX5TvrxdZFoFs+IZ7kXI/a8tkfQSWv7YLZzB22iuuIJUdSYWkz0dq2xEwvzM+ 27S6kg9oCfpg91KdANXmBeMtmAlG7JESKe/YypQuYfUfU4kiE87WJg4iyRWs66JxSYkH cQiSkN2mdUuDp0b4Iiz2GnB8Af/8TtuRxgenNnmpsBVIFwQKMm6tYFJCL4nQNy2PCUWS dOWglFqSuexL3AgdYGL1eAoZSf1oT9afM9SZiue1hL4ss0nzgSDA0BxmsufZkMhYMWmP pUkA== X-Gm-Message-State: AOJu0YzqQmVCmuP/WjVoPGQ/fVS1Qd2DokIxlkdRLdISmlT/koWQQCp4 BKecK4/kzbgqFcoxMXBARKEq X-Google-Smtp-Source: AGHT+IGWdqJoOqLuMJvHmjdND4s9smIzSK1W4z6sO06g7mB+MZdHVj18b7Q3JsNL5thmVi3zGQif8w== 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 Cc: gcc-rust@gcc.gnu.org, ibuclaw@gdcproject.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> 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 (*-*-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) -- 2.42.0