Switching ARM GNU gcc Toolchain in Eclipse


CodeWarrior for MCU10.3 comes with the ARM GNU 4.6.2 installed:

gcc 4_6_2 in MCU10.3 layout

gcc 4_6_2 in MCU10.3 layout

What about switching to a different (newer) gcc?

The ARM GCC GNU toolchain used is the one which is provided and maintained by ARM Inc. in the Launchpad. MCU10.3 has been released early December 2012, and just at the end of December ARM has released a new 4.7 version of gcc. So it would make sense at least to try the new 4.7.

For this I have copied the MCU10.3 installation layout and added the 4.7 toolchain. In order to avoid conflicts, I have removed the 4.6 toolchain, so I have this structure:

gcc 4_7_0 in MCU10.3 layout

gcc 4_7_0 in MCU10.3 layout

Note: at the time of this writing, there is already a 4.7.2 available.

The good news: my existing projects worked fine. The confusing part was that existing projects created with 4.6.0 created these pathentry warnings:

Description    Resource    Path    Location    Type
Invalid project path: Include path not found (C:\Freescale\CW MCU v10.3_gcc4_7_0\Cross_Tools\arm-none-eabi-gcc-4_7_0\lib\gcc\arm-none-eabi\4.6.2\include-fixed).    Freedom_Blue        pathentry    Path Entry Problem
Invalid project path: Include path not found (C:\Freescale\CW MCU v10.3_gcc4_7_0\Cross_Tools\arm-none-eabi-gcc-4_7_0\lib\gcc\arm-none-eabi\4.6.2\include).    Freedom_Blue        pathentry    Path Entry Problem
Warnings because of different gcc

Warnings because of different gcc

Looks like somehow the Eclipse build system got 4.6.2 and 4.7.0 mixed up? I checked the project and path settings, but I have not seen place to fix the warnings. Clean and rebuild did not help. And Google was not my friend this time :-(. What now?

Well, after long hours of searching and trying things, I have found finally a solution which works. The trick is to go into the Project > Properties > C/C++ Build > Discovery Options. Here both the Compiler and Assembler are set up for ‘Discovery‘: That way the toolchain can find its libraries and search paths. Obviously that did not work our well for me.

Clearing Discovery Information

Clearing Discovery Information

So the solution is to select one tool (ARM Ltd Windows GCC C Compiler and ARM Ltd Windows GCC Assembler) and to Clear the discovered entries (Clear button). This will trigger an informal dialog:

Discovery Entries cleared

Discovery Entries cleared

With that, my problem is solved.

❓ The Eclipse GNU build tools are storing that kind of information in the workspace .metadata folder. In my above case I used the same workspace with the changed GNU build tools. The problem could be avoided if I use separate workspaces for each Eclipse layout variant.

Happy ARMing 🙂

6 thoughts on “Switching ARM GNU gcc Toolchain in Eclipse

  1. It doesn’t work for me :-(. I’ve the following issue:
    Description Resource Path Location Type
    mingw32-make: *** [Project_Settings/Startup_Code/__arm_end_c.obj] Error 1 gcc-4.7.2 C/C++ Problem
    mingw32-make: *** [Project_Settings/Startup_Code/__arm_start_c.obj] Error 1 gcc-4.7.2 C/C++ Problem
    mingw32-make: *** [Project_Settings/Startup_Code/kinetis_sysinit_c.obj] Error 1 gcc-4.7.2 C/C++ Problem
    mingw32-make: *** [Sources/main_cpp.obj] Error 1 gcc-4.7.2 C/C++ Problem
    mingw32-make: *** Waiting for unfinished jobs…. gcc-4.7.2 C/C++ Problem
    Cannot run program “C:\Freescale\CW MCU v10.3_gcc4_7_2\Cross_Tools\arm-none-eabi-gcc-4_6_2\bin\arm-none-eabi-g++”: Launching failed gcc-4.7.2 [Discovery Options] page in project properties C/C++ Problem
    Cannot run program “C:\Freescale\CW MCU v10.3_gcc4_7_2\Cross_Tools\arm-none-eabi-gcc-4_6_2\bin\arm-none-eabi-gcc”: Launching failed gcc-4.7.2 [Discovery Options] page in project properties C/C++ Problem
    Error launching external scanner info generator (C:/Freescale/CW MCU v10.3_gcc4_7_2/Cross_Tools/arm-none-eabi-gcc-4_6_2/bin/arm-none-eabi-g++ -E -P -v -dD C:/Users/Elvis/workspace/gcc-4.7.2/.metadata/.plugins/org.eclipse.cdt.make.core/specs.cpp) gcc-4.7.2 [Discovery Options] page in project properties C/C++ Problem
    Error launching external scanner info generator (C:/Freescale/CW MCU v10.3_gcc4_7_2/Cross_Tools/arm-none-eabi-gcc-4_6_2/bin/arm-none-eabi-gcc -E -P -v -dD C:/Users/Elvis/workspace/gcc-4.7.2/.metadata/.plugins/org.eclipse.cdt.make.core/specs.c) gcc-4.7.2 [Discovery Options] page in project properties C/C++ Problem

    Like

      • The problem is this: “C:\Freescale\CW MCU v10.3_gcc4_7_2\Cross_Tools\arm-none-eabi-gcc-4_6_2\bin\arm-none-eabi-g++”
        Eclipse has an enviorment variable ${ARMSourceryDir} that i cannot find how to change…

        Like

What do you think?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s