Author Topic: Selecting CPU architecture for cross compile in CB  (Read 8987 times)

Offline obiCB

  • Single posting newcomer
  • *
  • Posts: 3
Selecting CPU architecture for cross compile in CB
« on: June 16, 2011, 06:06:44 pm »
Hi

I am using CB to compile for ARM7 architecture (Windows host).  

In CB I have set the following:
In "Project->build options",  selected the GNU ARM GCC compiler, and in the "Compiler Flags" folder I have selected the compiler option "-march=NAME [-march=NAME]".

The question is how can I set NAME=arm7tdmis?

For the moment the compiler complains "error: bad value (NAME) for -march switch". I tried adding NAME in the folder "Custom variables" but no luck
Using CB Build Mar 29 2011

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Selecting CPU architecture for cross compile in CB
« Reply #1 on: June 16, 2011, 06:51:31 pm »
You can set it in "Build options -> Compiler -> Other options"
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: Selecting CPU architecture for cross compile in CB
« Reply #2 on: June 16, 2011, 10:51:58 pm »
I guess u have to define them in 'project\build options\custom variables' like
Code
NAME=arm7tdmis
then use in the compiler flags like
Code
-march=$NAME

Offline obiCB

  • Single posting newcomer
  • *
  • Posts: 3
Re: Selecting CPU architecture for cross compile in CB
« Reply #3 on: June 17, 2011, 10:11:43 am »
Thanks

That helped. What I exactly had to do was:

- In Project build options->Compiler settings->Categories, do NOT select "-march=NAME [-march=NAME] (somewhat confusing)
- In Project build options->Compiler settings->Other options enter the line "-mcpu=arm7tdmi"

If I had started the project the correct way (selected a ARM project, AND the correct processor template) This had been automatically set up for me.