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.
steved
Posts: 823
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 12 times
Been thanked: 135 times

Compiler version select in makefile

Postby steved » Wed Aug 14, 2019 1:44 pm

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: 823
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 12 times
Been thanked: 135 times

Re: Compiler version select in makefile

Postby steved » Wed Jul 29, 2020 11:34 am

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: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: Compiler version select in makefile

Postby Giovanni » Wed Jul 29, 2020 1:34 pm

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: 823
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 12 times
Been thanked: 135 times

Re: Compiler version select in makefile

Postby steved » Wed Jul 29, 2020 3:43 pm

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.


Return to “Small Change Requests”

Who is online

Users browsing this forum: No registered users and 5 guests