Exactly where does the -mcpu= argument get used in the configuration process?

Gedare Bloom gedare at rtems.org
Thu Mar 17 17:20:33 UTC 2016

The powerpc has a tangled mess of defines that are cpu model-based.
There are multiple possible places to investigate.

First is the build system, where configure.ac files can define
conditionals for Makefile.am to use when selecting what source files
to compile. These conditionals usually infer from the BSP name and not
the cpu model, so you *should* be getting the qoriq config.ac
features, but it would be worth checking the configure.ac at
cpukit/score/cpu/powerpc, c/src/libcpu/powerpc, or

Second is to check the CPP conditionals that are getting used in the
powerpc headers, namely cpukit/score/cpu/powerpc/rtems/score/*.h and
c/src/lib/libcpu/powerpc/rtems/powerpc/*.h, and

Third, you should look for any places where the e6500 or E6500 appear
to investigate for places the qoriq has received special attention.
One thing I noticed with a brief look is that __PPC_CPU_E6500__ is
used a few times for conditional compilation.

That's about all I have. I haven't done enough work with the ppc
targets to give you any further insight.

On Thu, Mar 17, 2016 at 11:10 AM, Travis Wheatley
<travis.wheatley at emergentspace.com> wrote:
> I am currently porting the existing qoriq_t2080rdb to a t1040rdb board. The obvious first step has been to modify the make/custom/qoriq_t2080rdb.cfg to turn off altivec and change the -mcpu flag.
> The original CPU_FLAGS line looked like this:
> CPU_CFLAGS = -mcpu=e6500 -m32 -msdata=sysv -fno-common \
>         -D__ppc_generic
> I have modified it thusly:
> CPU_CFLAGS = -mcpu=e5500 -m32 -msoft-float -mno-altivec -msdata=sysv -fno-common \
>         -D__ppc_generic
> However, it appears that changing the -mcpu argument causes a compile time error that is related to cache sizes. I am wondering exactly where the -mcpu flag gets used in the configure process that would subsequently cause the values of CPU_CACHE_LINE_BYTES, CPU_DATA_CACHE_ALIGNMENT, and CPU_INSTRUCTION_CACHE_ALIGNMENT to change.
> Following are the compile time errors I am receiving when using -mcpu=e5500 flag:
> --- Begin included text ---
> ../../../../../../../rtems-git/c/src/lib/libcpu/powerpc/../shared/src/cache_manager.c:46:2: error: #error "CPU_DATA_CACHE_ALIGNMENT is greater than CPU_CACHE_LINE_BYTES"
>   ^~~~~
> ../../../../../../../rtems-git/c/src/lib/libcpu/powerpc/../shared/src/cache_manager.c:50:2: error: #error "CPU_INSTRUCTION_CACHE_ALIGNMENT is greater than CPU_CACHE_LINE_BYTES"
>   ^~~~~
> make[5]: *** [../shared/src/shared_cache_rel-cache_manager.o] Error 1
> make[5]: Leaving directory `/home/firefly/development/rtems/build-powerpc/powerpc-rtems4.12/c/qoriq_t2080rdb/lib/libcpu/powerpc'
> make[4]: *** [install-recursive] Error 1
> _______________________________________________
> users mailing list
> users at rtems.org
> http://lists.rtems.org/mailman/listinfo/users

More information about the users mailing list