GNU CDT plugin on Eclipse to build for Cortex M3

Asked by Ludovic Tancerel

Hello,
I have recently installed Eclipse and trying to make GNU ARM toolchain working on it.
I got the Eclipse ARM plugin from
GNU ARM Eclipse plug-in repository - http://gnuarmeclipse.sourceforge.net/updates

I installed the latest version of gcc from your site : gcc-arm-none-eabi-4_7-2013q3
all of this is running on a MAC OS X Version 10.9

I am building a basic test project to verify the toolchain,
In my project, I have replaced
arm-elf-gcc
with
/Users/Ludo/Documents/gcc-arm-none-eabi-4_7-2013q3/bin/arm-none-eabi-gcc
I am able to build, but unfortunately, I am not able to link.
Here are console commands, and error :

11:49:22 **** Build of configuration Debug for project test3 ****
make all
Building file: ../main.c
Invoking: ARM OS X GCC C Compiler (GNUARM)
/Users/Ludo/Documents/gcc-arm-none-eabi-4_7-2013q3/bin/arm-none-eabi-gcc -O0 -ffunction-sections -fdata-sections -Wall -Wa,-adhlns="main.o.lst" -c -fmessage-length=0 -MMD -MP -MF"main.d" -MT"main.d" -mcpu=cortex-m3 -mthumb -g3 -o "main.o" "../main.c"
Finished building: ../main.c

Building target: test3.elf
Invoking: ARM OS X GCC C Linker (GNUARM)
/Users/Ludo/Documents/gcc-arm-none-eabi-4_7-2013q3/bin/arm-none-eabi-gcc -Xlinker --gc-sections -Wl,-Map,"test3.map" -mcpu=cortex-m3 -mthumb -g3 -o "test3.elf" ./main.o
/Users/Ludo/Documents/gcc-arm-none-eabi-4_7-2013q3/bin/../lib/gcc/arm-none-eabi/4.7.4/../../../../arm-none-eabi/lib/armv7-m/libg.a(lib_a-exit.o): In function `exit':
exit.c:(.text.exit+0x16): undefined reference to `_exit'
collect2: error: ld returned 1 exit status
make: *** [test3.elf] Error 1

11:49:23 Build Finished (took 682ms)

I wonder if the problems comes from the plugin I installed, and whether I should have a plugin that directly sets arm-none-eabi-gcc compiler.
Or this comes from another problem.
In any case the error message is weird.

Question information

Language:
English Edit question
Status:
Solved
For:
GNU Arm Embedded Toolchain Edit question
Assignee:
No assignee Edit question
Solved by:
Ludovic Tancerel
Solved:
Last query:
Last reply:
Revision history for this message
Thomas Grieger (t-grieger) said :
#1

Hi,

you should have a look at the answers to the questions #230869 and #234852.
They sound very much like your described problem.

Best regards,
Thomas

Revision history for this message
Ludovic Tancerel (ludovic-tancerel) said :
#2

Thank you Thomas for your answer,
I have looked at the questions, but the answer is not the one expected.

I did some experiments, and based on GNU ARM eclipse guidelines
http://gnuarmeclipse.livius.net/blog/test-project/
I could get an example test compiling and linking.

I then further understood what was missing in my project configuration to get link working properly.
This sounds quite obvious, but my lack of knowledge of Eclipse made me miss that,
you need some ld files and startup.s being defined in the project.
I could get some from the example and could get my test project compile and link properly.

It would be nice that the project creation would propose basic ld and startup.s files to start with. Note sure why this is not the case.
Anyway, I am able to proceed and from problem is solved.

Thank you very much for your help