Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

arm-none-eabi-ld: cannot find -lc

Tags:

c

gcc

embedded

mpu

I'm trying to code for XMC1100 based development board. I'm trying this tutorial : http://eleceng.dit.ie/frank/arm/BareMetalXMC2Go/index.html

I have downloaded the blinky.tar.gz file and unzipped. When I try "make" I'm getting this error : arm-none-eabi-ld: cannot find -lc

Here is the output of "make"

arm-none-eabi-gcc -c -mcpu=cortex-m0 -mthumb -g init.c -o init.o
arm-none-eabi-gcc -c -mcpu=cortex-m0 -mthumb -g main.c -o main.o
arm-none-eabi-ld init.o main.o  -L /usr/lib/gcc/arm-none-eabi/4.8.2/armv6-m -T linker_script.ld -lc --cref -Map main.map -nostartfiles -o main.elf
arm-none-eabi-ld: cannot find -lc
make: *** [main.elf] Error 1

I'm using Linux Mint 17 Qiana

What I am missing?

Here is my makefile :

LIBSPEC=-L /usr/lib/gcc/arm-none-eabi/4.8.2/armv6-m

# Specify the compiler to use
CC=arm-none-eabi-gcc
# Specify the assembler to use
AS=arm-none-eabi-as
# Specity the linker to use
LD=arm-none-eabi-ld

CCFLAGS=-mcpu=cortex-m0 -mthumb -g

# List the object files involved in this project
OBJS=   init.o \
        main.o 

# The default 'target' (output) is main.elf and it depends on the object files being there.
# These object files are linked together to create main.elf
main.elf : $(OBJS)
    $(LD) $(OBJS) $(LIBSPEC) -T linker_script.ld -lc --cref -Map main.map -nostartfiles -o main.elf
    arm-none-eabi-objcopy -O binary main.elf main.bin
    objcopy -O ihex main.elf main.hex
    @echo "done"

# The object file main.o depends on main.c.  main.c is compiled to make main.o
main.o: main.c
    $(CC) -c $(CCFLAGS) main.c -o main.o


init.o: init.c
    $(CC) -c $(CCFLAGS) init.c -o init.o

# if someone types in 'make clean' then remove all object files and executables
# associated wit this project
clean: 
    rm $(OBJS) 
    rm main.elf
    rm main.bin 
like image 521
fobus Avatar asked Feb 16 '15 01:02

fobus


People also ask

How do you compile with ARM-none-Eabi-GCC?

You should have the arm-none-eabi-gcc.exe for Windows Compile. Also, you have the linux environment like MinGW and use installed terminal(xterm). then, you have to copy the . so files into MinGW /lib or /usr/lib folder under C:/MinGW .

What means none Eabi?

arm-none-eabi is the toolchain we use in this class. This toolchain targets the ARM architecture, has no vendor, does not target an operating system (i.e. targets a “bare metal” system), and complies with the ARM EABI.


1 Answers

I met the same problem and sudo apt-get install libnewlib-arm-none-eabi helped me.

like image 175
chaosink Avatar answered Sep 30 '22 00:09

chaosink