[PATCH] Add nios2-*-rtems*

Joel Sherrill joel.sherrill at oarcorp.com
Thu Jul 17 18:35:07 UTC 2014


---
 gcc/ChangeLog            |  6 ++++++
 gcc/config.gcc           |  6 +++++-
 gcc/config/nios2/rtems.h | 33 +++++++++++++++++++++++++++++++++
 gcc/config/nios2/t-rtems |  3 +++
 4 files changed, 47 insertions(+), 1 deletion(-)
 create mode 100644 gcc/config/nios2/rtems.h
 create mode 100644 gcc/config/nios2/t-rtems

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f3a404f..607b915 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2014-07-17  Joel Sherrill <joel.sherrill at oarcorp.com>
+
+	* config.gcc: Add nios2-*-rtems*.
+	* config/nios2/rtems.h: New file.
+	* gcc/config/nios2/t-rtems: New file.
+
 2014-07-16  David Wohlferd <dw at LimeGreenSocks.com>
 
 	PR target/61662
diff --git a/gcc/config.gcc b/gcc/config.gcc
index cfb5014..de216f8 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -419,7 +419,7 @@ nds32*)
 nios2-*-*)
 	cpu_type=nios2
 	extra_options="${extra_options} g.opt"
-	;;	
+	;;
 picochip-*-*)
         cpu_type=picochip
         ;;
@@ -2137,6 +2137,10 @@ nios2-*-*)
 		tm_file="${tm_file} newlib-stdint.h nios2/elf.h"
 		extra_options="${extra_options} nios2/elf.opt"
 		;;
+	nios2-*-rtems*)
+		tm_file="${tm_file} nios2/rtems.h rtems.h"
+		tmake_file="${tmake_file} t-rtems nios2/t-rtems"
+		;;
         esac
 	;;
 pdp11-*-*)
diff --git a/gcc/config/nios2/rtems.h b/gcc/config/nios2/rtems.h
new file mode 100644
index 0000000..cc5b5d6
--- /dev/null
+++ b/gcc/config/nios2/rtems.h
@@ -0,0 +1,33 @@
+/* Definitions for rtems targeting a NIOS2 using ELF.
+   Contributed by Chris Johns (chrisj at rtems.org).
+
+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
+<http://www.gnu.org/licenses/>.  */
+
+/* Specify predefined symbols in preprocessor.  */
+#define TARGET_OS_CPP_BUILTINS()        \
+do {                                    \
+  builtin_define ("__rtems__");         \
+  builtin_define ("__USE_INIT_FINI__"); \
+  builtin_assert ("system=rtems");      \
+} while (0)
+
+/* This toolchain implements the ABI for Linux Systems documented in the
+   Nios II Processor Reference Handbook.
+
+   This is done so RTEMS targets have Thread Local Storage like Linux.  */
+#define TARGET_LINUX_ABI 1
+
diff --git a/gcc/config/nios2/t-rtems b/gcc/config/nios2/t-rtems
new file mode 100644
index 0000000..48dce34
--- /dev/null
+++ b/gcc/config/nios2/t-rtems
@@ -0,0 +1,3 @@
+# Multilibs for NIOS2 RTEMS targets.
+
+# Use all.
-- 
1.9.3



More information about the devel mailing list