Author Topic: GNU ARM GCC  (Read 5569 times)

Offline Devil_Advocate

  • Single posting newcomer
  • *
  • Posts: 5
GNU ARM GCC
« on: July 17, 2006, 09:33:31 am »
I want to use GNU ARM GCC compiler and I need to use some flags. How can I replace NAME by a custom value ? for example I want to replace -mcpu=NAME by -mcpu=arm920t.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: GNU ARM GCC
« Reply #1 on: July 17, 2006, 09:46:57 am »
By prepending NAME with a dollar sign and defining its value in the project options.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Devil_Advocate

  • Single posting newcomer
  • *
  • Posts: 5
Re: GNU ARM GCC
« Reply #2 on: July 17, 2006, 09:55:37 am »
I go to Settings->Compiler and debugger->Custom variables and add a new variable NAME with the arm920t value but it does'nt change anything

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: GNU ARM GCC
« Reply #3 on: July 17, 2006, 10:10:25 am »
That's possible. In some versions, the per-compiler variable settings are not honoured. It is why I told you to set the variable at project level (which you did not do).
Since you weren't telling what version you use, it is kind of hard to tell more. If you use a reasonably recent build, you could use a global compiler variable, which would offer more flexibility, too.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Devil_Advocate

  • Single posting newcomer
  • *
  • Posts: 5
Re: GNU ARM GCC
« Reply #4 on: July 17, 2006, 10:16:39 am »
I'm using the Jul 12 2006 nightly build.
I also tried to fix the value at the project level but nothing changed.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: GNU ARM GCC
« Reply #5 on: July 17, 2006, 10:34:26 am »
In the 12 July build, project-level variables certainly work (I use those every day), however, the ones you set compiler-wide are not honoured.
This is not a big problem in your case, though, as the 12 July build supports GCV. Go to Settings -> Global Variables and define your variable there. In fact, this is even better because you can have different sets, so for example switching to another compiler version is very easy.

Remember that you have to reference that type of variables by $#NAME or $(#NAME), not $NAME. See the WiKi ("global compiler variables") for more info on that subject.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: GNU ARM GCC
« Reply #6 on: July 17, 2006, 11:00:05 am »
With tonight's release, you should be able to use per-compiler variables again, too.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Devil_Advocate

  • Single posting newcomer
  • *
  • Posts: 5
Re: GNU ARM GCC
« Reply #7 on: July 18, 2006, 08:44:45 am »
I tried with the 17 July nightly build but I didn't manage to replace NAME by a custom value. Can you send me screen-shot please?

Offline Devil_Advocate

  • Single posting newcomer
  • *
  • Posts: 5
Re: GNU ARM GCC
« Reply #8 on: July 21, 2006, 09:06:03 am »
Nobody can explain me the exact procedure?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9580
Re: GNU ARM GCC
« Reply #9 on: July 21, 2006, 09:14:08 am »
You need to use $NAME as compiler option. Then define a custom variable "NAME" with e.g. "arm920t" as content (without quotation marks). I tried it -> it works.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9580
Re: GNU ARM GCC
« Reply #10 on: July 21, 2006, 09:22:43 am »
Look here:


...and here:


...and finally here:


With regards, Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ