GCC 4.1.1 m68k-rtems generating invalid code for -m5307 proce ssor ?

Mick Davis mickd at goanna.iinet.net.au
Tue Jun 26 12:45:03 UTC 2007


Comparing to our config file, you may also need some lines like:

CPU_ASFLAGS = -m5307
ASFLAGS = -m5307

I also had to make changes to rtems to account for the __mcf5200__ 
compiler definition being replaced by __mcf5307__ .  I'm not its the 
correct method for the distribution, but grep shows these changes for 
our source;

File /rtems-4.7/c/src/lib/libcpu/m68k/shared/cache/cache_.h line 16 becomes;

#elif ( defined(__mcf5200__) || defined(__mcf5307__) )

File /rtems-4.7/cpukit/libnetworking/netinet/in_cksum_m68k.h line 40 
becomes;

#if (defined (__mcf5200__) || defined(__mcf5307__))

File /rtems-4.7/cpukit/score/cpu/m68k/rtems/score/m68k.h, from line 214, 
becomes;

#elif defined(__mcf5307__)
/* Motorola ColdFire V3 core */
#define CPU_MODEL_NAME         "m5307"
#define M68K_HAS_VBR             1
#define M68K_HAS_BFFFO           0
#define M68K_HAS_SEPARATE_STACKS 0
#define M68K_HAS_PREINDEXING     0
#define M68K_HAS_EXTB_L          1
#define M68K_HAS_MISALIGNED      1
#define M68K_HAS_FPU             0
#define M68K_HAS_FPSP_PACKAGE    0
#define M68K_COLDFIRE_ARCH       1
#define M68K_HAS_ISA_APLUS       0


Kirspel, Kevin wrote:
> Here is the config file.
> 
> #
> #  Config file for the mcf5235 BSP
> #
> #  $Id: mcf5329.cfg,v 2007/01/09 kirspelk Exp $
> #
> 
> include $(RTEMS_ROOT)/make/custom/default.cfg
> 
> RTEMS_CPU=m68k
> RTEMS_CPU_MODEL=mcf5329
> 
> # This is the actual bsp directory used during the build process.
> RTEMS_BSP_FAMILY=mcf5329EVB
> # This is the actual m68k processor for this BSP.
> # When gcc-4.3 is released the toolchain will support the mcf5329 processor
> #CPU_M68K_PROCESSOR = -mcpu=5329
> # until then we will use the 5307.
> CPU_M68K_PROCESSOR = -m5307
> 
> #  This contains the compiler options necessary to select the CPU model
> #  and (hopefully) optimize for it.
> CPU_CFLAGS = $(CPU_M68K_PROCESSOR)
> 
> # optimize flag: typically -O2
> #CFLAGS_OPTIMIZE_V= -O4 -fomit-frame-pointer
> CFLAGS_OPTIMIZE_V= -O0 -ggdb3 -fomit-frame-pointer
> 
> # The following are definitions of make-exe which will work using ld as
> # is currently required.  It is expected that as of gcc 2.8, the end user
> # will be able to override parts of the compilers specs and link using gcc.
> 
> define make-exe
>   $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) \
> 	    -o $(basename $@).nxe $(LINK_OBJS) $(LINK_LIBS)
> 	$(OBJCOPY) -O binary --strip-all $(basename $@).nxe $@
> 	$(SIZE) $(basename $@).nxe
> endef
> define make-cxx-exe
>   $(LINK.cc) $(AM_CFLAGS) $(AM_LDFLAGS) \
> 	    -o $(basename $@).nxe $(LINK_OBJS) $(LINK_LIBS)
> 	$(OBJCOPY) -O binary --strip-all $(basename $@).nxe $@
> 	$(SIZE) $(basename $@).nxe
> endef
> 
> # Miscellaneous additions go here
> 
> -----Original Message-----
> From: Ian Caddy [mailto:ianc at goanna.iinet.net.au] 
> Sent: Monday, June 25, 2007 6:41 PM
> To: Chris Johns
> Cc: Kirspel, Kevin; 'rtems-users at rtems.org'
> Subject: Re: GCC 4.1.1 m68k-rtems generating invalid code for -m5307
> processor ?
> 
> Hi Chris,
> 
> 
> Chris Johns wrote:
>> Ian Caddy wrote:
>>> Hi Kevin,
>>>
>>> We also use the 5307 for our system, and are currently using gcc 4.1.1 
>>> and we don't see your problem.
>>>
> 
> <snip>
> 
>>> You indicated that you built your tools.  Have you tried the standard 
>>> toolsets from the RTEMS website?
>> The rpms on the RTEMS build machine show:
>>
>> [chrisjohns at england build]$ ls /opt/rtems-4.7/m68k-rtems4.7/lib/
>> crt0.o  ldscripts  libc.a  libg.a  libm.a  m5200  m68000  m68030  m68040 
>> m68060  mcpu32  msoft-float
>> [chrisjohns at england build]$ ls /opt/rtems-4.8/m68k-rtems4.8/lib/
>> crt0.o  ldscripts  libc.a  libg.a  libm.a  m5200  m68000  m68030  m68040 
>> m68060  mcpu32  msoft-float
>>
>> No V3 specific builds in the released tool sets.
>>
> 
> Oops, bit slow off the mark as I just got back from overseas.  We also 
> roll our own tools for use under msys, and it was a while ago and forgot 
> that the standard toolchain is not built with m5307 support!
> 
> I agree that it looks like a 68020 instruction, so we need to check the 
> build commands.
> 
> Kevin, you indicated in your first email that you created a new BSP. 
> Would you mind sharing your config file from the rtems-4.7/make/custom 
> directory so we can check your build options?
> 
> regards,
> 
> Ian Caddy
> 



More information about the users mailing list