Hi

I couldn't get gdb og gcc to build even for epiphany-elf but I did
include patch that I think is all that is needed for RTEMS.

I did manage to build binutils from their repo for both elf
and rtems variants.

At least it is a starting point. You can work with their
community to get their tools built as epiphany-elf and
then just change the target.

--joel

On 11/13/2014 12:22 PM, Hesham Moustafa wrote:
>
>
> On Thu Nov 13 2014 at 5:58:25 PM Joel Sherrill
> <joel.sherr...@oarcorp.com <mailto:joel.sherr...@oarcorp.com>> wrote:
>
>
>
>     On November 13, 2014 11:56:32 AM CST, Hesham Moustafa
>     <heshamelmat...@gmail.com <mailto:heshamelmat...@gmail.com>> wrote:
>     >Hi,
>     >
>     >
>     >I want to let you know that I found their main repos [1] Can I start
>     >from there? Imitating what has been done with OpenRISC?
>     >
>
>     Basically. Except you only need their repos for binutils and gdb.
>     We use GCC and Newlib from upstream.
>
> Great, I am waiting for these patches. 
>
>     I have binutils patches
>
>     >[1] https://github.com/adapteva
>     >
>     >
>     >Regards,
>     >
>     >Hesham
>     >
>     >On Thu Nov 13 2014 at 3:29:14 PM Hesham Moustafa
>     ><heshamelmat...@gmail.com <mailto:heshamelmat...@gmail.com>> wrote:
>     >
>     >On Thu Nov 13 2014 at 2:59:33 PM Joel Sherrill
>     ><joel.sherr...@oarcorp.com <mailto:joel.sherr...@oarcorp.com>> wrote:
>     >
>     >
>     >On 11/13/2014 8:07 AM, Joel Sherrill wrote:
>     >>
>     >> On November 13, 2014 6:30:48 AM CST, Hesham Moustafa
>     ><heshamelmat...@gmail.com <mailto:heshamelmat...@gmail.com>> wrote:
>     >>> Hi all,
>     >>>
>     >>>
>     >>> I want to ask about the status of RTEMS toolchain for Epiphany
>     >>> architecture. I think Joel mentioned that there are some previous
>     >>> support for it; and if yes, does the toolchain need some
>     additional
>     >>> work?
>     >> To give you a quick answer, I emailed the people who did the port.
>     >There apparently is a github repo with some of it and some is
>     merged. I
>     >will dig through the emails and post the proper links.
>     >>
>     >> One issue they mentioned was that the gdb port had many core/thread
>     >support that made it more than a simple port.
>     >From Jeremy Bennett:
>     >
>     >> piphany tool chain development runs on quite a tight budget,
>     and its
>     >> GDB implementation is quite complex (it has to pretend cores are
>     >> threads, when they don't completely share an address space).  So we
>     >> haven't had the effort to devote to upstreaming.  And we were
>     >> reluctant to push the simulator upstream without a GDB
>     implementation
>     >> to go with it.  You can of course access the code here:
>     >>
>     >>   https://github.com/adapteva/epiphany-binutils-gdb
>     >>
>     >> Epiphany GDB is still in quite substantial flux, due to the need to
>     >> support the Eclipse multicore visualizer with asynchronous and
>     >> non-stop support.
>     >The upstream gcc and newlib are OK. But since binutils and gdb are
>     >now in a single repo, it will need to come from the github site until
>     >it is merged upstream. And obviously patches just need to go upstream
>     >to whereever the code is. :)
>     >
>     >Jeremy also encouraged you to openly discuss things on their forums.
>     >He thought you would get good insight and advice there. And I don't
>     >doubt that.
>     >
>     >Thank you, I will.
>     >
>     >If it is a relatively low volume place, I may track it. But my email
>     >volume
>     >is already high and I don't have time to poke around on a bulletin
>     >board.
>     >
>     >> It will not have RTEMS as a target but that shouldn't be hard to
>     >address once we know where the master binutils, GCC, Newlib, and gdb
>     >are.
>     >So do you want me to try to build a toolchain and get you some
>     starting
>     >patches?
>     >
>     >Sure that will definitely help as a starting point. And if you are so
>     >busy, you can just drop me HOWTO  instructions.
>     >
>     >> Then you are porting.
>     >>
>     >>> Regards,
>     >>>
>     >>> Hesham
>     >> _______________________________________________
>     >> devel mailing list
>     >> devel@rtems.org <mailto:devel@rtems.org>
>     >> http://lists.rtems.org/mailman/listinfo/devel
>     >
>     >--
>     >Joel Sherrill, Ph.D.             Director of Research & Development
>     >joel.sherr...@oarcorp.com        On-Line Applications Research
>     >Ask me about RTEMS: a free RTOS  Huntsville AL 35805
>     >Support Available                (256) 722-9985
>

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel.sherr...@oarcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985

From a65be6da99e754614ddbe2b57e82caa511c457fb Mon Sep 17 00:00:00 2001
From: Joel Sherrill <joel.sherr...@oarcorp.com>
Date: Thu, 13 Nov 2014 10:26:23 -0600
Subject: [PATCH 1/2] bfd/config.bfd: Add epiphany-*-rtems*

2014-11-13  Joel Sherrill <joel.sherr...@oarcorp.com>

	* config.bfd: Add epiphany-*-rtems* target
---
 bfd/config.bfd | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bfd/config.bfd b/bfd/config.bfd
index 6025f26..8b56eea 100644
--- a/bfd/config.bfd
+++ b/bfd/config.bfd
@@ -395,7 +395,7 @@ case "${targ}" in
     targ_defvec=bfd_elf32_d30v_vec
     ;;
 
-  epiphany-*-elf)
+  epiphany-*-elf | epiphany-*-rtems*)
     targ_defvec=bfd_elf32_epiphany_vec
     ;;
 
-- 
1.9.3

From 264dfba15fdc77377ca25c959cbeacd0cee6f868 Mon Sep 17 00:00:00 2001
From: Joel Sherrill <joel.sherr...@oarcorp.com>
Date: Thu, 13 Nov 2014 12:45:07 -0600
Subject: [PATCH] GCC: Add epiphany-rtems target

2014-11-13  Joel Sherrill <joel.sherr...@oarcorp.com>

	* config.gcc: Add epiphany-*-rtems* target.
	* config/epiphany/rtems.h: New file.
---
 gcc/config.gcc              |  9 +++++++++
 gcc/config/epiphany/rtems.h | 33 +++++++++++++++++++++++++++++++++
 2 files changed, 42 insertions(+)
 create mode 100644 gcc/config/epiphany/rtems.h

diff --git a/gcc/config.gcc b/gcc/config.gcc
index a6b37d8..9ee2a57 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -1137,6 +1137,15 @@ crisv32-*-linux* | cris-*-linux*)
 		;;
 	esac
 	;;
+	tmake_file="${tmake_file} sparc/t-sparc sparc/t-rtems"
+epiphany-*-rtems* )
+	tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file} epiphany/rtems.h rtems.h"
+	tmake_file="epiphany/t-epiphany"
+	extra_options="${extra_options} fused-madd.opt"
+	extra_objs="$extra_objs mode-switch-use.o resolve-sw-modes.o"
+	tm_defines="${tm_defines} EPIPHANY_STACK_OFFSET=${with_stack_offset:-8}"
+	extra_headers="epiphany_intrinsics.h"
+	;;
 epiphany-*-elf )
 	tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
 	tmake_file="epiphany/t-epiphany"
diff --git a/gcc/config/epiphany/rtems.h b/gcc/config/epiphany/rtems.h
new file mode 100644
index 0000000..c2cb4bd
--- /dev/null
+++ b/gcc/config/epiphany/rtems.h
@@ -0,0 +1,33 @@
+/* Definitions for rtems targeting a RTEMS using ELF.
+   Copyright (C) 2014 Free Software Foundation, Inc.
+   Contributed by Joel Sherrill (j...@oarcorp.com).
+
+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/>.  */
+
+/* Target OS builtins.  */
+#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)
+
+/* Use the default */
+#undef LINK_GCC_C_SEQUENCE_SPEC
-- 
1.9.3

From 3d63bd5a7de127dae5489e4d25f076dad05b7167 Mon Sep 17 00:00:00 2001
From: Joel Sherrill <joel.sherr...@oarcorp.com>
Date: Thu, 13 Nov 2014 12:29:38 -0600
Subject: [PATCH] gdb/configure.tgt: Add epiphany-rtems

2014-11-13  Joel Sherrill <joel.sherr...@oarcorp.com>

	* configure.tgt: Add epiphany-rtems target.
---
 gdb/configure.tgt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/configure.tgt b/gdb/configure.tgt
index 90cefaa..8053043 100644
--- a/gdb/configure.tgt
+++ b/gdb/configure.tgt
@@ -133,7 +133,7 @@ cris*)
 	gdb_target_obs="cris-tdep.o solib-svr4.o"
 	;;
 
-epiphany-*-elf*)
+epiphany-*-elf* | epiphany-*-rtems*)
 	# Target: Adapteva EPIPHANY embedded system
 	gdb_target_obs="epiphany-tdep.o"
 	gdb_sim=../sim/epiphany/libsim.a
-- 
1.9.3

From 7d6a7d0f5776f1b56beac9996ebcf734451a556b Mon Sep 17 00:00:00 2001
From: Joel Sherrill <joel.sherr...@oarcorp.com>
Date: Thu, 13 Nov 2014 10:27:47 -0600
Subject: [PATCH 2/2] ld/configure.tgt: Add epiphany-*-rtems*

2014-11-13  Joel Sherrill <joel.sherr...@oarcorp.com>

        * configure.tgt: Add epiphany-*-rtems* target
---
 ld/configure.tgt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ld/configure.tgt b/ld/configure.tgt
index 9adace1..a211534 100644
--- a/ld/configure.tgt
+++ b/ld/configure.tgt
@@ -157,7 +157,8 @@ d30v-*-*)		targ_emul=d30velf; targ_extra_emuls="d30v_e d30v_o"
 			;;
 dlx-*-elf*)		targ_emul=elf32_dlx
 			;;
-epiphany-*-elf)		targ_emul=elf32epiphany
+epiphany-*-elf | epiphany-*-rtems*)
+			targ_emul=elf32epiphany
 			targ_extra_emuls="elf32epiphany_4x4"
 			;;
 fido*-*-elf*)		targ_emul=m68kelf ;;
-- 
1.9.3

_______________________________________________
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Reply via email to