From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by sourceware.org (Postfix) with ESMTPS id 1F3503857724 for ; Thu, 7 Sep 2023 13:38:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1F3503857724 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-wm1-x333.google.com with SMTP id 5b1f17b1804b1-401b5516104so10832895e9.2 for ; Thu, 07 Sep 2023 06:38:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; t=1694093913; x=1694698713; 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=kj/SMz1nEQ/oehb1jKfyY/MJ28i9npIUeSjpM1sPWL8=; b=MsY5xuWwnbfDtR0zlJr+qDXKzqw4oGJoFPDwhZOYKbL/BwN8zHWAGtsC7EpvaIIkV2 vkVyDCWTqrgllvsiO4fU9gcT40bCpKX9koXhdYeHkVF0NG8cYkzVGz/fJBkoFYvi+4hX mrOkrzHL1dhmUKmtSkAfjE+4vSDDhQwNEoM6uIsgM3UdVA2ysPw6Bhj+aeCDCoqqTfGX Fb/Futc/kQ3f+blZVuFkG6F6JB/xqaDHPmQUs3zsr+xqrfD40E+LKPQo6ql0KLKKxF1R zQYWirgJ2rHaZsENHuRHkQpggIldUBs661nEhDN0RhH1VvsiJy18zTYdtD09muIxzsPe LRyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1694093913; x=1694698713; 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=kj/SMz1nEQ/oehb1jKfyY/MJ28i9npIUeSjpM1sPWL8=; b=GlIyMeIg+xo0JDp1FoRrshTw9zswbdJtU7nIBG8GoRUMdeXRmGDlqJNrn2UqJw49N7 xJfdS2VasUYMglMdP3b9/vJFdUJaP3wZN/5wd37KwBgEHUBkR7bRPatXCecG1NYiwAhx sOT0ldzbqFO348KvWyjVD0yQtdDlM0YbtM9T3DxswakYtL5m+naMYSmRtN5/KxqxiRVt kYQIvBKQZDzLKxc4XhlNCtIMk+3ZZapvYRvY4Fz8KR69s7LOZdBIc8Mk2FZrZ3cypoLb l2J/ne0J2BS+fScxtyTplWMC0benZukKzerXC83Lz70IiO9ct1SuDa2OEV7bwyqHH78R 43MQ== X-Gm-Message-State: AOJu0YzsZuAi8JLX2u6iBdDPGuzugbniRWIoMM+ErsOYN5YexKDg/yKz 16PXRUafTl3uixfVbPpjLuMj X-Google-Smtp-Source: AGHT+IFtXWqgwQonhOC0MbYvty7ahESPa00xF2cl5UsMBZPgTr89GdEPjbgyCk57ks+DGg3FTIE81g== X-Received: by 2002:a5d:50c9:0:b0:31a:d450:c513 with SMTP id f9-20020a5d50c9000000b0031ad450c513mr5357181wrt.26.1694093912821; Thu, 07 Sep 2023 06:38:32 -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.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Sep 2023 06:38:32 -0700 (PDT) From: arthur.cohen@embecosm.com To: gcc-patches@gcc.gnu.org Cc: gcc-rust@gcc.gnu.org, ibuclaw@gdcproject.org Subject: [PATCH 11/14] rust: Implement TARGET_RUST_OS_INFO for *-*-vxworks* Date: Thu, 7 Sep 2023 15:36:37 +0200 Message-ID: <20230907133729.2518969-12-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 (*-*-vxworks*): Set rust_target_objs and target_has_targetrustm. * config/t-vxworks (vxworks-rust.o): New rule. * config/vxworks-rust.cc: New file. --- gcc/config.gcc | 3 +++ gcc/config/t-vxworks | 4 ++++ gcc/config/vxworks-rust.cc | 40 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 gcc/config/vxworks-rust.cc diff --git a/gcc/config.gcc b/gcc/config.gcc index 9344e26a48e..da59fa3eecd 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -1092,6 +1092,9 @@ case ${target} in extra_headers="${extra_headers} ../vxworks/vxworks-predef.h" target_has_targetcm="yes" + rust_target_objs="${rust_target_objs} vxworks-rust.o" + target_has_targetrustm=yes + extra_gcc_objs="vxworks-driver.o" # This private header exposes a consistent interface for checks on diff --git a/gcc/config/t-vxworks b/gcc/config/t-vxworks index 164869a7bf0..639b2fd7a21 100644 --- a/gcc/config/t-vxworks +++ b/gcc/config/t-vxworks @@ -28,6 +28,10 @@ vxworks-c.o: $(srcdir)/config/vxworks-c.cc $(COMPILE) $< $(POSTCOMPILE) +vxworks-rust.o: $(srcdir)/config/vxworks-rust.cc + $(COMPILE) $< + $(POSTCOMPILE) + # We leverage $sysroot to find target system headers only, distributed # in a VxWorks (a)typical fashion with a different set of headers for # rtp vs kernel mode. We setup SYSROOT_HEADERS_SUFFIX_SPEC to handle diff --git a/gcc/config/vxworks-rust.cc b/gcc/config/vxworks-rust.cc new file mode 100644 index 00000000000..76d618cdcd1 --- /dev/null +++ b/gcc/config/vxworks-rust.cc @@ -0,0 +1,40 @@ +/* VxWorks 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 VxWorks targets. */ + +static void +vxworks_rust_target_os_info (void) +{ + rust_add_target_info ("target_family", "unix"); + rust_add_target_info ("target_os", "vxworks"); + rust_add_target_info ("target_vendor", "wrs"); + rust_add_target_info ("target_env", "gnu"); +} + +#undef TARGET_RUST_OS_INFO +#define TARGET_RUST_OS_INFO vxworks_rust_target_os_info + +struct gcc_targetrustm targetrustm = TARGETRUSTM_INITIALIZER; -- 2.42.0