Author Topic: -mpu=NAME (and others)  (Read 12363 times)

Offline qaptcha

  • Single posting newcomer
  • *
  • Posts: 4
-mpu=NAME (and others)
« on: September 26, 2008, 02:08:11 pm »
I'm using C::B for an ARM920T.  How can I fill in NAME for -mcpu and -march in the compiler flags section?  I have used the 'Other options' section until now.

Thanks.

mariocup

  • Guest
Re: -mpu=NAME (and others)
« Reply #1 on: September 26, 2008, 03:34:50 pm »
Hi qaptcha,

if you want to add an option in the mcpu list, then you will have to change the source code of codeblocks (compiler plugin). It is planned to make a more flexible solution for the users but this will take some time.

Bye,

Mario

Offline Lazybones

  • Multiple posting newcomer
  • *
  • Posts: 14
Re: -mpu=NAME (and others)
« Reply #2 on: September 26, 2008, 04:04:39 pm »
Hi!

If you do not want to compile C::B yourself, you may use the "other options" for any option, that is not (yet) available in the compiler options tab (as you mentioned). This is necessary for all options that need an additional parameter, like -mcpu=XXX. AFAIK there is no other input option in C::B to enable an option with a parameter.

I think this feature is quite useful, especially in embedded development, because all embedded compilers (based on gcc and closed-source ones) have these kind of options!

Cheers
 Sven

Offline qaptcha

  • Single posting newcomer
  • *
  • Posts: 4
Re: -mpu=NAME (and others)
« Reply #3 on: September 26, 2008, 05:18:58 pm »
if you want to add an option in the mcpu list, then you will have to change the source code of codeblocks (compiler plugin). It is planned to make a more flexible solution for the users but this will take some time.

How do you mean?  I don't know where I can choose something for the mcpu list.
The problem I have is as follows: I can select the "-mcpu=NAME" option, but when I compile, this is exactly what is called to the compiler (so NAME is not replaced).
This is of course not very helpful, but perhaps there is some menu where I can select the cpu type?

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: -mpu=NAME (and others)
« Reply #4 on: September 26, 2008, 11:44:06 pm »
As mentioned before by Lazybones, you can send any compiler option you want if you use the "Compiler settings -> Other options" tab in your projects "Build options".
Don't forget to  uncheck "-mcpu=NAME" in the "Compiler options" tab.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5490
Re: -mpu=NAME (and others)
« Reply #5 on: September 27, 2008, 10:12:08 am »
why do we provide then "-mcpu=NAME", since the user does have to fill it in manually, it hardly makes any sense.

Offline Lazybones

  • Multiple posting newcomer
  • *
  • Posts: 14
Re: -mpu=NAME (and others)
« Reply #6 on: September 29, 2008, 02:32:56 pm »
Hi killerbot,

I don't think it makes sense to include -mcpu=NAME to the predefined options list (such as -mabi=NAME and some other options with parameters).

If there is a predefined number of parameters, that may be set for these kinds of options, it may be useful to include these combinations to the predefined options list (such as the -march=XXX options for GCC).
But especially in embedded programming, the parameter may either be unknown (so that it is impossible to add a complete option-parameter-combination to CodeBlocks) or there are too many combinations.

So I would like to request the feature, that it is possible to add an parameter to a predefined option in the compiler options list.

Unfortunately, I have neither the programming skills nor the time to implement such a feature (I am using Code::Blocks at work with a compiler for Freescale HC(S)08). But having the mentioned feature would be quite useful for me!

Cheers
 Sven
« Last Edit: September 29, 2008, 02:41:15 pm by Lazybones »