Compiler version select in makefile

Use this forum for requesting small changes in ChibiOS. Large changes should be discussed in the development forum. This forum is NOT for support.
Post Reply
steved
Posts: 834
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 12 times
Been thanked: 138 times

Compiler version select in makefile

Post by steved »

Rather than selecting the compiler version to run at startup of the ChibiStudio IDE, would it be possible to select the version in the makefile?

This would ensure that a project was always compiled with the "correct" compiler, rather than having to start up the appropriate IDE. It would help software maintainability, by ensuring that moving to a later compiler is a conscious decision (much as happens with Chibi versions).

And it would help to avoid problems with the current M0 optimisations.

Superficially it appears this is just a matter of modifying the TRGT variable in arm-non-eabi.mk (although I doubt its that simple!)
steved
Posts: 834
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 12 times
Been thanked: 138 times

Re: Compiler version select in makefile

Post by steved »

If compiler selection is too problematical, would it be possible to support a compiler version check, in much the same way as done for the M0 problem? (I know I could add it myself, but an integrated solution is likely to be much better!). User specifies a required compiler version in one of the configuration files (mcuconf.h?), and Chibi errors if the current compiler version doesn't match.

While not as automated as selecting compiler version through the makefile, it would at least pick up incorrect usage.
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Compiler version select in makefile

Post by Giovanni »

Hi,

The only incompatibility I am aware of is the M0 one and that one is handled already. What are you suggesting exactly?

Giovanni
steved
Posts: 834
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 12 times
Been thanked: 138 times

Re: Compiler version select in makefile

Post by steved »

Its a general "quality" issue, really; nothing to do with specific incompatibilities.

I am accumulating a fair number of different projects, whose latest releases use different compiler versions. I want to be sure that the same compiler version is used for any changes, unless I make a specific decision to update to a new compiler. (There has been some support for the principle from at least one persion, maybe more, in this forum). So there are two real possibilities to achieve this; either have a project-specific means of selecting the compiler (rather than a different startup procedure for Eclipse), or have a check within the project.
Post Reply