Linker: cannot find libc.a

Gast #2709590
Lesenswert?

Hey,

ich versuche gerade meine ersten Schritten mit einem ARM Controller.
Eigentlich will erstmal nur eine LED zum Blinken bringen.
Ich habe mir dazu das Board STM32-H107 von Olimex besorgt.

und die main.c von hier
http://www.mikrocontroller.net/articles/STM32_LEDBlinken_AtollicTrueStudio
übernommen.

das compilieren mit:
1
arm-none-eabi-gcc -I./ -c -fno-common -O0 -g -mcpu=cortex-m3 -mthumb main.c
2
arm-none-eabi-gcc -I./ -c -fno-common -O0 -g -mcpu=cortex-m3 -mthumb core_cm3.c
3
arm-none-eabi-gcc -I./ -c -fno-common -O0 -g -mcpu=cortex-m3 -mthumb system_stm32f10x.c
4
arm-none-eabi-gcc -I./ -c -fno-common -O0 -g -mcpu=cortex-m3 -mthumb stm32f10x_rcc.c
5
arm-none-eabi-gcc -I./ -c -fno-common -O0 -g -mcpu=cortex-m3 -mthumb stm32f10x_gpio.c
6
und 
7
arm-none-eabi-as -mcpu=cortex-m3 startup_stm32f10x_cl.s -o startup_stm32f10x_cl.o
scheint auch zu klappen
nur beim linken:
1
arm-none-eabi-ld -T stm32_flash.ld main.o startup_stm32f10x_cl.o core_cm3.o system_stm32f10x.o stm32f10x_rcc.o stm32f10x_gpio.o -o main.elf
erhalte ich die Fehlermeldung:
1
arm-none-eabi-ld: cannot find libc.a

eine libc.a liegt aber im Verzeichnis: 
~/Sourcery_CodeBench_Lite_for_ARM_EABI/arm-none-eabi/lib/libc.a und
~/Sourcery_CodeBench_Lite_for_ARM_EABI/arm-none-eabi/lib/thumb2/libc.a

wie kann ich dem Linker mitteilen das er eine davon verwenden soll ?

Viele Grüsse
Micha
Gast #2709830
Lesenswert?

Hey,

wie meinst du das "durch das gcc-Frontend aufruft" ?

ich hatte jetzt bisher immer
1
-L/home/user/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_EABI/arm-none-eabi/lib/thumb2/
2
-L/home/user/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_EABI/lib/gcc/arm-none-eabi/4.6.1/thumb2/

mitgeben müssen weil arm-none-eabi-ld die Option -Wl nicht kennt.
1
arm-none-eabi-ld: unrecognized option '-Wl'

oder meinst im arm-none-eabi-gcc mit der Option -Xlinker
#2783776
Lesenswert?

Hi Jungs ich habe auch ein Linker Problem
und zwar versuche ich eine library hinzuzulinken.
Im Makefile:
1
LD_LIBS += -mthumb -Wl additionals/ST_SimpleMAC/STM32W108/simplemac/library/simplemac-library.a

Weiter unten wird dann gelinkt:
1
$(MAIN_ELF): $(MAIN_OBJS)
2
  @ echo ""
3
  @ echo "}"
4
  @ echo "{ Stage: Linking all object files ******************************************************************************************************************"
5
  @ echo ""
6
  @ echo "  MAIN_OBJS=$(MAIN_OBJS)"
7
  @ echo ""
8
  $(LD) $(LDFLAGS) $(LD_LIBS) $(MAIN_OBJS) -o $(MAIN_ELF)

Bekomme folgenden Fehler beim Linken:
1
{ Stage: Linking all object files ******************************************************************************************************************
2

3
arm-none-eabi-gcc  -Wl,-Map=main.map -nostartfiles -mcpu=cortex-m3 -mthumb -Tadditionals/ST_SimpleMAC/STM32W108/hal/micro/cortexm3/stm32w108/gnu-stm32w108xB.ld -Tadditionals/ST_SimpleMAC/STM32W108/hal/micro/cortexm3/stm32w108/gnu-stm32w108.ld -mthumb -Wl,additionals/ST_SimpleMAC/STM32W108/simplemac/library/simplemac-library.a crt_stm32w108.o context-switch.o spmr.o adc.o temperature_sensor.o system-timer.o board.o uart.o mfg-token.o sleep.o clocks.o micro-common.o led.o micro.o nvm.o flash.o mems.o button.o micro-common-internal.o stm32w_gpio.o ttc_gpio.o stm32w_spi.o ttc_spi.o Knoten_STM32W.o STM32W_Testbench.o main.o extensions.o ttc_basic.o -o main.elf
4
Knoten_STM32W.o: In function `Modem_Init':
5
Knoten_STM32W.c:(.text+0x154): undefined reference to `ST_RadioInit'
6
collect2: ld returned 1 exit status
7
make: *** [main.elf] Fehler 1


Könnt ihr mir vielleicht weiter helfen?
Warum wird die Library nicht hinzugefügt?

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren