I am working with a small sample project that targets Cortex-M4 using the gcc arm-none-eabi toolchain. The makefile invokes arm-none-eabi-ld directly to link the executable:
LD=arm-none-eabi-ld.exe $(LD) main.o retarget.o exceptions.o test_main.o common.o init_main.o -T link.ld --print-memory-usage -o $(TARGET)
$ arm-none-eabi-gcc -v CMakeFiles/wdt_interrupt_gnu.dir/main.c.obj CMakeFiles/wdt_interrupt_gnu.dir/retarget.c.obj CMakeFiles/wdt_interrupt_gnu.dir/exceptions.c.obj CMakeFiles/wdt_interrupt_gnu.dir/test_main.c.obj CMakeFiles/wdt_interrupt_gnu.dir/common.c.obj CMakeFiles/wdt_interrupt_gnu.dir/init_main.c.obj -T ../link_cmake.ld -o cm4.axf <snip> /home/asic/lib/ARM/gcc-arm-none-eabi-10.3-2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld: /home/asic/lib/ARM/gcc-arm-none-eabi-10.3-2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/lib/libc.a(lib_a-exit.o): in function `exit': exit.c:(.text.exit+0x2c): undefined reference to `_exit' collect2: error: ld returned 1 exit status
Do I need to pass arm-none-eabi-ld explicitly as a parameter to arm-none-eabi-gcc?
The command might be missing a specs file.