From patchwork Thu Jul 27 11:05:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Huber X-Patchwork-Id: 794344 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-459144-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="EzLZgkSX"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xJ8Kz4p4Mz9s76 for ; Thu, 27 Jul 2017 21:06:13 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id; q=dns; s=default; b=mdWhvI7ivvPz 5W5iYYyUxZbrNI53g7v+4+i9ZtgtyxnjmCoTQRHhbXVO5JBPYVLxujfGqo2j7+jJ gVFNf5ZfdRDuqKXvaVIAj9rNrQ7cSmQbxtSB81Nwflcf7n/xPkN6t2mzQST5QHcR U9QS+cSQDZ2i0AiHEyP7Mfr9gTBZims= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id; s=default; bh=ajr303/PGzwzxrkTBu luYoSm5fs=; b=EzLZgkSXaPapUeTptS+y10GE4wuAoEstBhRLV3FjYBUdLlJXvU 0c6kN0qdfBdWec+3SweLNtKy4Gsd7DUXPioYHxDmKABr5N1cgqCG4Nz52sn65MfF 9/QJKBo/3VpjvUEImotRJLOzRaDegvayAHdvH5wUbGvaZIOmqaztXm8Q8= Received: (qmail 37598 invoked by alias); 27 Jul 2017 11:06:03 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 32497 invoked by uid 89); 27 Jul 2017 11:05:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: dedi548.your-server.de Received: from dedi548.your-server.de (HELO dedi548.your-server.de) (85.10.215.148) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 27 Jul 2017 11:05:57 +0000 Received: from [88.198.220.131] (helo=sslproxy02.your-server.de) by dedi548.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.85_2) (envelope-from ) id 1dagc6-0006lg-Db; Thu, 27 Jul 2017 13:05:54 +0200 Received: from [82.135.62.35] (helo=mail.embedded-brains.de) by sslproxy02.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dagc6-0002j8-6f; Thu, 27 Jul 2017 13:05:54 +0200 Received: from localhost (localhost.localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 088F92A001D; Thu, 27 Jul 2017 13:06:03 +0200 (CEST) Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id nVECNoR8AF-1; Thu, 27 Jul 2017 13:06:00 +0200 (CEST) Received: from localhost (localhost.localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id CA1472A160A; Thu, 27 Jul 2017 13:06:00 +0200 (CEST) Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id pXhYN_aJoe5J; Thu, 27 Jul 2017 13:06:00 +0200 (CEST) Received: from linux-diu0.suse (unknown [192.168.96.129]) by mail.embedded-brains.de (Postfix) with ESMTP id B193F2A001D; Thu, 27 Jul 2017 13:06:00 +0200 (CEST) From: Sebastian Huber To: gcc-patches@gcc.gnu.org Cc: kito.cheng@gmail.com Subject: [PATCH] [RISCV] Add RTEMS support Date: Thu, 27 Jul 2017 13:05:51 +0200 Message-Id: <20170727110551.26385-1-sebastian.huber@embedded-brains.de> X-IsSubscribed: yes gcc/ * config.gcc (riscv*-*-elf*): Add (riscv*-*-rtems*). * config/riscv/rtems.h: New file. --- gcc/config.gcc | 7 ++++++- gcc/config/riscv/rtems.h | 31 +++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 gcc/config/riscv/rtems.h diff --git a/gcc/config.gcc b/gcc/config.gcc index aab7f65c1df..f28164646c3 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -2040,7 +2040,7 @@ riscv*-*-linux*) # automatically detect that GAS supports it, yet we require it. gcc_cv_initfini_array=yes ;; -riscv*-*-elf*) +riscv*-*-elf* | riscv*-*-rtems*) tm_file="elfos.h newlib-stdint.h ${tm_file} riscv/elf.h" case "x${enable_multilib}" in xno) ;; @@ -2053,6 +2053,11 @@ riscv*-*-elf*) # Force .init_array support. The configure script cannot always # automatically detect that GAS supports it, yet we require it. gcc_cv_initfini_array=yes + case ${target} in + riscv*-*-rtems*) + tm_file="${tm_file} rtems.h riscv/rtems.h" + ;; + esac ;; mips*-*-netbsd*) # NetBSD/mips, either endian. target_cpu_default="MASK_ABICALLS" diff --git a/gcc/config/riscv/rtems.h b/gcc/config/riscv/rtems.h new file mode 100644 index 00000000000..221e2f69815 --- /dev/null +++ b/gcc/config/riscv/rtems.h @@ -0,0 +1,31 @@ +/* Definitions for RISC-V RTEMS systems with ELF format. + Copyright (C) 2017 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. + + Under Section 7 of GPL version 3, you are granted additional + permissions described in the GCC Runtime Library Exception, version + 3.1, as published by the Free Software Foundation. + + You should have received a copy of the GNU General Public License and + a copy of the GCC Runtime Library Exception along with this program; + see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + . */ + +#undef TARGET_OS_CPP_BUILTINS +#define TARGET_OS_CPP_BUILTINS() \ + do { \ + builtin_define ("__rtems__"); \ + builtin_define ("__USE_INIT_FINI__"); \ + builtin_assert ("system=rtems"); \ + } while (0)