Compilation with AMR toolchain for Raspberry PI

Asked by dems

Hello,

I try to compile a demo application of FreeRTOS on arm-non-eabi tool chain.

I install arm-none-eabi tool chain throught the command "sudo apt install gcc-arm-non-eabi.

When I run the make, I have "arm-none-eabi-ld: cannot find -lc"

The make file is the following :

#
# Makefile for FreeRTOS demo on Raspberry Pi
#
BASE=$(shell pwd)/
BUILD_DIR=$(shell pwd)/build/

MODULE_NAME="RaspberryPi BSP"

TARGETS=kernel.img kernel.list kernel.syms kernel.elf
LINKER_SCRIPT=raspberrypi.ld

-include .dbuild/dbuild.mk

all: kernel.list kernel.img kernel.syms
 @$(SIZE) kernel.elf

kernel.img: kernel.elf
 $(Q)$(PRETTY) IMAGE $(MODULE_NAME) $@
 $(Q)$(OBJCOPY) kernel.elf -O binary $@

kernel.list: kernel.elf
 $(Q)$(PRETTY) LIST $(MODULE_NAME) $@
 $(Q)$(OBJDUMP) -D -S kernel.elf > $@

kernel.syms: kernel.elf
 $(Q)$(PRETTY) SYMS $(MODULE_NAME) $@
 $(Q)$(OBJDUMP) -t kernel.elf > $@

kernel.elf: LDFLAGS += -L "/home/erty/Documents/gcc-arm-none-eabi-5_4-2016q3/lib/gcc/arm-none-eabi/5.4.1" -lgcc
kernel.elf: LDFLAGS += -L "/home/erty/Documents/gcc-arm-none-eabi-5_4-2016q3/lib/" -lc
kernel.elf: $(OBJECTS)
 $(Q)$(LD) $(OBJECTS) -Map kernel.map -o $@ -T $(LINKER_SCRIPT) $(LDFLAGS)

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu gcc-arm-none-eabi Edit question
Assignee:
No assignee Edit question
Solved by:
Manfred Hampl
Solved:
Last query:
Last reply:
Revision history for this message
Thomas Preud'homme (thomas-preudhomme) said :
#1

Hi Dems,

gcc-arm-none-eabi is the toolchain provided by Debian and Ubuntu. If you encounter any bug with this you should report it to the appropriate Ubuntu [1] or Debian [2] bug tracker depending on what OS you are using. The package for this toolchain is named gcc-arm-embedded and is provided in a PPA (ie. it is provided outside of the official Ubuntu repositories)

[1] https://bugs.debian.org/cgi-bin/pkgreport.cgi?archive=0;ordering=normal;repeatmerged=0;src=gcc-arm-none-eabi but use the tool reportbug from the eponymous package
[2] https://bugs.launchpad.net/ubuntu/+source/gcc-arm-none-eabi

Best regards,

Thomas

Revision history for this message
dems (dems77) said :
#2

I am using Ubuntu.

Revision history for this message
Thomas Preud'homme (thomas-preudhomme) said :
#3

Hi Dems,

Then you should report that problem to the official Ubuntu package bug tracker, ie: https://bugs.launchpad.net/ubuntu/+source/gcc-arm-none-eabi

If we want to use the toolchain provided by ARM, follow the instructions on https://launchpad.net/~team-gcc-arm-embedded/+archive/ubuntu/ppa

Note, our package is named gcc-arm-embedded.

Best regards,

Thomas

Revision history for this message
Best Manfred Hampl (m-hampl) said :
#4

1. Moving this question document into the Ubuntu/gcc-arm-none-eabi area

2. You miss probably the libc.a library file that is part of the libc6-dev package
Try sudo apt-get install libc6-dev

Revision history for this message
dems (dems77) said :
#5

I tried to install libc6-dev but this issue not solved

Revision history for this message
dems (dems77) said :
#6

Thanks all,

It was the libc.a folder name.

Revision history for this message
dems (dems77) said :
#7

Thanks Manfred Hampl, that solved my question.