From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by sourceware.org (Postfix) with ESMTPS id 16B593857737 for ; Thu, 7 Sep 2023 13:38:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 16B593857737 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-x42a.google.com with SMTP id ffacd0b85a97d-31dcf18f9e2so1010842f8f.0 for ; Thu, 07 Sep 2023 06:38:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; t=1694093914; x=1694698714; 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=kNgIupn1HABzgFIxPXpLsoEBn38A8a/9a9GhPDbma/0=; b=eHz38/SrDN6lXCjyZ98WlMW2fbme9a4yq19spVGGrBdbxc0k1llJpdHcERxz4JubQe OFWg2rRaXP0lBuum3yrjiHNTOz7TBhbLPhTxdqYE9uZOXyUUPseiainei5gVIwDv8w3Y aHNFQ8YK4FAyvPnwSfkAUMKu0xktlKRDTW4y0sd7Zv4QlyXSLhuzEPIihwVuitjjMhU9 1nvlVjOrqgxfXNZqfKGLSWv2zOyNF7GTx+xcsWevLtei/FFJnymqe/lFnaXJeBA1jLqq ulpi8rBmJyvSrOToz94g0ygRBTYh+SL70BTIhrr7p7jHEB27OJFNkyaL1tfQ5TF5+G8c DitA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1694093914; x=1694698714; 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=kNgIupn1HABzgFIxPXpLsoEBn38A8a/9a9GhPDbma/0=; b=MQX+/JCG3ytZ3yKASGsXvFYvxqZUFR5SI2T2lnXgZkI+zMUQ5jc8rOeE7SetM7J86w elLIjoeaAQRAIvsImEmFWGmbdti5bNtazuk3sLE8C532xt/pL42wE6EUU96cyqDhnqux auVsI7zpTf8B9NtrPlotXFd16Gere0zNhZGZ3T/iTt0p2A/1xMhePzAQVOPumdKn6LGI LvmCYQuztPFHFU+JqigLLBGOR1lLQe28cSqBm+uW7RC3gLOQsrBqk9S1WUclorxpcIYW yFWeBd8ikKocJSVlL2TN+zPEnwYXSC54RiBZjmtAwxsA5RDGycLCKCs+gvKnvZL964Yf zhFw== X-Gm-Message-State: AOJu0YwvMg3PFFbvR6NV1UypnvMzn8Ay4Fxqvo0h/1UJUC1/yWI3uklZ pXZ8IkId6oeDYsbjnyqsgUNj X-Google-Smtp-Source: AGHT+IE4cFPfc9+MlIMPcaNDn1bGiFGYe/wCS85ITf36HleJTW0+j6Ox2Q+kqOzXLbUZx2zHg9P41Q== X-Received: by 2002:adf:e5c7:0:b0:314:3e77:f210 with SMTP id a7-20020adfe5c7000000b003143e77f210mr4959896wrn.59.1694093913734; Thu, 07 Sep 2023 06:38:33 -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.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Sep 2023 06:38:33 -0700 (PDT) From: arthur.cohen@embecosm.com To: gcc-patches@gcc.gnu.org Cc: gcc-rust@gcc.gnu.org, ibuclaw@gdcproject.org Subject: [PATCH 12/14] rust: Implement TARGET_RUST_OS_INFO for *-*-fuchsia*. Date: Thu, 7 Sep 2023 15:36:38 +0200 Message-ID: <20230907133729.2518969-13-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=unavailable 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 (*-*-fuchsia): Set tmake_rule, rust_target_objs, and target_has_targetrustm. * config/fuchsia-rust.cc: New file. * config/t-fuchsia: New file. --- gcc/config.gcc | 3 +++ gcc/config/fuchsia-rust.cc | 40 ++++++++++++++++++++++++++++++++++++++ gcc/config/t-fuchsia | 21 ++++++++++++++++++++ 3 files changed, 64 insertions(+) create mode 100644 gcc/config/fuchsia-rust.cc create mode 100644 gcc/config/t-fuchsia diff --git a/gcc/config.gcc b/gcc/config.gcc index da59fa3eecd..a512eb37275 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -871,6 +871,9 @@ case ${target} in ;; *-*-fuchsia*) native_system_header_dir=/include + tmake_file="t-fuchsia" + rust_target_objs="${rust_target_objs} fuchsia-rust.o" + target_has_targetrustm=yes ;; *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu | *-*-uclinuxfdpiceabi) extra_options="$extra_options gnu-user.opt" diff --git a/gcc/config/fuchsia-rust.cc b/gcc/config/fuchsia-rust.cc new file mode 100644 index 00000000000..86262504ac2 --- /dev/null +++ b/gcc/config/fuchsia-rust.cc @@ -0,0 +1,40 @@ +/* Fuchsia 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 Fuchsia targets. */ + +static void +fushsia_rust_target_os_info (void) +{ + rust_add_target_info ("target_family", "unix"); + rust_add_target_info ("target_os", "fushsia"); + rust_add_target_info ("target_vendor", "unknown"); + rust_add_target_info ("target_env", ""); +} + +#undef TARGET_RUST_OS_INFO +#define TARGET_RUST_OS_INFO fushsia_rust_target_os_info + +struct gcc_targetrustm targetrustm = TARGETRUSTM_INITIALIZER; diff --git a/gcc/config/t-fuchsia b/gcc/config/t-fuchsia new file mode 100644 index 00000000000..55c884bcb2e --- /dev/null +++ b/gcc/config/t-fuchsia @@ -0,0 +1,21 @@ +# Copyright (C) 2022 Free Software Foundation, Inc. +# +# This file is part of GCC. +# +# 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 +# . + +fuchsia-rust.o: $(srcdir)/config/fuchsia-rust.cc + $(COMPILE) $< + $(POSTCOMPILE) -- 2.42.0