[RTEMS Project] #2386: [bsps/mvme3100] Incorrect / sub-optimal CFLAGS

RTEMS trac trac at rtems.org
Thu Aug 6 02:47:13 UTC 2015


#2386: [bsps/mvme3100] Incorrect / sub-optimal CFLAGS
--------------------------+--------------------
 Reporter:  nick.withers  |      Owner:
     Type:  defect        |     Status:  new
 Priority:  normal        |  Milestone:  4.11.1
Component:  bsps          |    Version:  4.11
 Severity:  normal        |   Keywords:
--------------------------+--------------------
 According to Sebastian Huber in #2369, ''A BSP for the e500 should use the
 "-mcpu=8540 -meabi -msdata=sysv -fno-common" options'', and not the
 current ''-mcpu=powerpc -msoft-float -D!__ppc_generic'' CFLAGS (see
 ''c/src/lib/libbsp/powerpc/mvme3100/make/custom/mvme3100.cfg'').

 That doesn't appear to work, however: Loading e.g., ''samples/hello.ralf''
 causes the board to reset some time soon after ''bsp_start()'' and before
 ''Init()''. Trying to get GDB to talk to the board with ''hello.exe''
 loaded doesn't work:
 {{{
 Reading symbols from powerpc-
 rtems4.11/c/mvme3100/testsuites/samples/hello/hello.exe...done.
 (gdb) target remote bdi:2159
 Remote debugging using bdi:2159
 Remote 'g' packet reply is too long:
 431bde83011100080000000013de4352061d4cda000090000000000000001d7c0000ebff010c000000003c0000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000001091a48000000010000001a00000002e102500000000140005b89ac00002710fab22b9200000000431bde83000000000111000800000000000000000000000013de435200000000061d4cda000000000000900000000000000000000000000000001d7c000000000000ebff00000000010c00000000000000003c000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001091a480000000000000001000000000000001a000000000000000200000000e1025000000000000000014000000000005b89ac000000000000271000000000fab22b9201021be8000090004000002801021be001039a2820000000deadbeef
 (gdb)
 }}}

 ...but as far as I know that may just be because the BDI's not set up
 correctly.

 I'm currently running with these changes, which appears to work fine
 (though does it end up being any different than the previous "generic
 powerpc" CFLAGS?):
 {{{
 diff --git a/c/src/lib/libbsp/powerpc/mvme3100/make/custom/mvme3100.cfg
 b/c/src/lib/libbsp/powerpc/mvme3100/make/custom/mvme3100.cfg
 index ddd6d23..d34b41b 100644
 --- a/c/src/lib/libbsp/powerpc/mvme3100/make/custom/mvme3100.cfg
 +++ b/c/src/lib/libbsp/powerpc/mvme3100/make/custom/mvme3100.cfg
 @@ -10,7 +10,7 @@ RTEMS_CPU_MODEL=e500

  #  This contains the compiler options necessary to select the CPU model
  #  and (hopefully) optimize for it.
 -CPU_CFLAGS = -mcpu=powerpc -msoft-float -D__ppc_generic
 +CPU_CFLAGS = -mcpu=8540 -meabi -msdata=sysv -msoft-float -mno-spe -fno-
 common

  # optimize flag: typically -O2
  CFLAGS_OPTIMIZE_V = -O2 -g
 diff --git a/c/src/lib/libcpu/powerpc/rtems/powerpc/powerpc.h
 b/c/src/lib/libcpu/powerpc/rtems/powerpc/powerpc.h
 index 8934585..0c3a6ff 100644
 --- a/c/src/lib/libcpu/powerpc/rtems/powerpc/powerpc.h
 +++ b/c/src/lib/libcpu/powerpc/rtems/powerpc/powerpc.h
 @@ -276,6 +276,10 @@ extern "C" {
  #define PPC_INTERRUPT_MAX       125
  #define PPC_USE_MULTIPLE       1

 +#elif defined(ppc8540)
 +
 +#define PPC_HAS_RFCI           1 // E500CORERM.pdf:1-9
 +
  #elif defined(__ppc_generic)

  #else
 }}}

 Presumably ''-msoft-float -mno-spe'' isn't great for applications that
 want to use single-precision floating-point?

 Also, I need to spend more time on
 ''c/src/lib/libcpu/powerpc/rtems/powerpc/powerpc.h'' with the literature.

--
Ticket URL: <http://devel.rtems.org/ticket/2386>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list