This is the mail archive of the crossgcc@cygnus.com mailing list for the crossgcc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Motorola coldfire520X and gcc/gdb


Well I can help a little....

Here is an example patch to add a cpu32 flag to the compiler, that should
point you in the right direction.

The CPP_SPEC controls the cpp flags, CC1_SPEC the compiler, and
ASM_SPEC the gas flags.

%{fred: bill}
If the compiler flag fred is given, causes bill to passed. Compiler flags
must be listed in SUBTARGET_SWITCHES
%{!ansi:%{fred:bill}}
Passes bill if the fred flag is give if the ansi flag is not given etc.

So the long complex line is setting the defaults....

I recommend NOT changing the default behaviour, though you will need to
edit the default line.

This file is overriding m68k-none.h. Make sure you base your specs on the
correct ones from that file.

YOU may be able to just edit an installed spec text file, though you would
presumably still need to build with a special SUBTARGET_SWITCHES defined.

Good Luck
Mark

----------------------------------------------------------------------------
*** config/m68k/m68k-coff.h.orig	Tue May 27 10:52:30 1997
--- config/m68k/m68k-coff.h	Tue May 27 10:53:12 1997
***************
*** 20,28 ****
--- 20,42 ----
  Boston, MA 02111-1307, USA.  */
  
  #define MOTOROLA	/* Use Motorola syntax rather than MIT.  */
+ #define CPP_SPEC \
+ "%{m68881:-D__HAVE_68881__ }%{mfpa:-D__HAVE_FPA__ }\
+ %{!ansi:%{m68010:-Dmc68010 }%{m68020:-Dmc68020 }%{mc68020:-Dmc68020 }%{m68030:-Dmc68030 }%{m68040:-Dmc68040 }%{m68020-40:-Dmc68020 -Dmc68030 -Dmc68040 }%{m68302:-Dmc68302 }%{m68332:-Dmc68332 }%{mcpu32:-Dmcpu32 }%{!mc68000:%{!m68000:%{!m68010:%{!mc68020:
%{!m68020:%{!m68030:%{!m68040:%{!m68020-40:%{!m68302:%{!m68332:%{!mcpu32:-Dmc68020 }}}}}}}}}}}}\
+ %{m68010:-D__mc68010__ -D__mc68010 }%{m68020:-D__mc68020__ -D__mc68020 }%{mc68020:-D__mc68020__ -D__mc68020 }%{m68030:-D__mc68030__ -D__mc68030 }%{m68040:-D__mc68040__ -D__mc68040 }%{m68020-40:-D__mc68020__ -D__mc68030__ -D__mc68040__ -D__mc68020 -D__mc
68030 -D__mc68040 }%{m68302:-D__mc68302__ -D__mc68302 }%{m68332:-D__mc68332__ -D__mc68332 }%{mcpu32:-D__mcpu32__ -D__mcpu32 }%{!mc68000:%{!m68000:%{!m68010:%{!mc68020:%{!m68020:%{!m68030:%{!m68040:%{!m68020-40:%{!m68302:%{!m68332:%{!mcpu32:-D__mc68020__ -
D__mc68020 }}}}}}}}}}}"
+ 
+ #define ASM_SPEC \
+ "%{m68851}%{mno-68851}%{m68881}%{mno-68881}%{msoft-float:-mno-68881 }\
+ %{m68000}%{mc68000}%{m68010}%{m68020}%{mc68020}%{m68030}%{m68040}%{m68020-40:-mc68040}%{m68302}%{m68332}%{mcpu32:-mcpu32}%{!m68000:%{!mc68000:%{!m68010:%{!mc68020:%{!m68020:%{!m68030:%{!m68040:%{!m68020-40:%{!m68302:%{!m68332:%{!mcpu32:-mc68020}}}}}}}}}
}}"
+ 
+ #define CC1_SPEC \
+  "%{m68000:%{!m68881:-msoft-float }}%{m68302:-m68000}%{m68332:-m68020 -mnobitfield %{!m68881:-msoft-float}}%{mcpu32:-m68020 -mnobitfield %{!m68881:-msoft-float}}%{!m68000:%{!mc68000:%{!m68010:%{!mc68020:%{!m68020:%{!m68030:%{!m68040:%{!m68020-40:%{!m683
02:%{!m68332:%{!mcpu32:-m68020}}}}}}}}}}}"
  
  #include "m68k/m68k-none.h"
  #include "m68k/m68kemb.h"
  #include "m68k/coff.h"
+ 
+ #undef SUBTARGET_SWITCHES
+ #define SUBTARGET_SWITCHES    	{ "cpu32", 0},
  
  /* end of m68k-coff.h */
------------------------------------------------------------------------------


Mark S. Phillips        ESN 742 2461
msp@nortel.co.uk        Tel. +44 1279 402461

On Thu, 5 Jun 1997, Rolf Fiedler wrote:

> hi there,
> 
> while trying to build a binutils/gcc/gdb crossdevelopment platform
> for an embedded CF5204 system I learned that there is no 
> proper coldfire support in the gcc sources.
> 
> the coldfire has a instruction set that is a reduced 68000 set with
> a couple of 68020 enhancements (VBR, etc..) plus cache control
> and MAC (multiply-accumelate) instructions.
> 
> Now, the binutils support coldfire, i.e. I can ask gas to detect
> unsupported instructions and print nice error messages.
> 
> the problem is that I can't get gcc compiled in a way that
> gcc only emits instructions supported by coldfires.
> 
> the next problem is that the libgcc1.asm for m68k has instructions
> missing from coldfires all over it. Well, I can fix that one easily.
> 
>  The worst thing is that I can not get gcc to invoke gas with the
> proper -m5200, so gas has no chance to detect the unsupported 
> instructions (and I feel everything went ok :-(
> 
> I haven't done any compiler back-end work for gcc yet, so I have
> no clue what to touch in config/m68k/.
> 
> For debugging I want to use gdb, and there is a BDM 
> (background debugging mode) patch for gdb and a kernel module
> for my linux box's parallel port interface cable.
> This has been developed for CPU32's with BDM - has anybody tried
> it with coldfire?
> 
> Now the questions:
> has anybody been doing work on the subject?
> Are there any patches?
> Am I just misunderstanding the whole problem?
> 
> thanks for your attention,
> rolf
> 
> +-----------+----------------------------------------------------------+
> |  ||||||   |  Rolf Fiedler                                            |
> |  6 6  \   |  Electronic Design Engineer                              |
> |  /_  ) |  |  Ferrari electronic GmbH                                 |
> |   >   /   |  phone: +49 3328 4559 0  E-Mail: Rolf.Fiedler@Ferrari.DE |
> |   |  |    |  fax  : +49 3328 4559 60                                 |
> +-----------+----------------------------------------------------------+
> 
>