LD cannot find crt1-sim.o _vectors.o -lsim -lhandlers-sim -lhal

ammaree
Posts: 33
Joined: Tue Dec 27, 2016 2:10 am

LD cannot find crt1-sim.o _vectors.o -lsim -lhandlers-sim -lhal

Postby ammaree » Mon Feb 20, 2017 4:36 pm

Hi ESP32 devs...

Some background:
I am trying to port an application form TI-CC3200 to ESP32. Ass part of the process I had to convert a number of modules to accommodate the ESPO-IDF FreeRTOS changes as some ESP32 peripherals
After lots of effort I have it compiling but now the linker is failing with the following error message:

c:/msys32/opt/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: cannot find crt1-sim.o: No such file or directory
c:/msys32/opt/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: cannot find _vectors.o: No such file or directory
c:/msys32/opt/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: cannot find -lsim
c:/msys32/opt/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: cannot find -lhandlers-sim
c:/msys32/opt/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: cannot find -lhal
collect2.exe: error: ld returned 1 exit status

I have also included the makefile below.

All help and pointers appreciated.

Andre

PS: tried to attach the build file "build.log" but get error about an invalid extension.

------------------------------------------------ Makefile -------------------------------------------------------
#
# This is a project Makefile. It is assumed the directory this Makefile resides in is a
# project subdirectory.
#

PROJECT_NAME := application

SRCDIRS := /c/Dropbox/devs/ws/z-support/common \
/c/Dropbox/devs/ws/z-support/esp32t \
/c/Dropbox/devs/ws/esp32/esp-1 \
/c/Dropbox/devs/ws/z-support/FreeRTOS/FRextras

CFLAGS := -I /c/Dropbox/devs/ws/z-support/common \
-I /c/Dropbox/devs/ws/z-support/esp32t \
-I /c/Dropbox/devs/ws/z-support/FreeRTOS/FRextras \
-I /c/Dropbox/devs/ws/z-sdk/esp-idf/components/freertos/include/freertos

LDFLAGS := -L /c/Dropbox/devs/ws/z-support/common \
-L /c/Dropbox/devs/ws/z-support/esp32t

include $(IDF_PATH)/make/project.mk

ESP_Sprite
Posts: 8926
Joined: Thu Nov 26, 2015 4:08 am

Re: LD cannot find crt1-sim.o _vectors.o -lsim -lhandlers-sim -lhal

Postby ESP_Sprite » Tue Feb 21, 2017 2:24 am

By setting LDFLAGS, you overrule the esp-idf defaults. Can you try setting EXTRA_LDFLAGS instead, see if that gives the result you need?

ammaree
Posts: 33
Joined: Tue Dec 27, 2016 2:10 am

Re: LD cannot find crt1-sim.o _vectors.o -lsim -lhandlers-sim -lhal

Postby ammaree » Tue Feb 21, 2017 7:42 pm

Thanks for the help, much appreciated.

It fixed 90% of the problem, only had to add a 3rd EXTRA_LDFLAGS entry to get it to find the main appl, after that it linked..

Thanks

Andre

GeoffField
Posts: 2
Joined: Tue Dec 04, 2018 12:16 am

Re: LD cannot find crt1-sim.o _vectors.o -lsim -lhandlers-sim -lhal

Postby GeoffField » Tue Dec 04, 2018 12:18 am

Hi Andre,

I'm currently trying to do exactly the same task.
I realise it's over a year since you did the change, but could you please post the content of your LDFLAGS?

Regards,

Geoff

ESP_Sprite
Posts: 8926
Joined: Thu Nov 26, 2015 4:08 am

Re: LD cannot find crt1-sim.o _vectors.o -lsim -lhandlers-sim -lhal

Postby ESP_Sprite » Tue Dec 04, 2018 4:24 am

As said before: don't mess around with LDFLAGS (unless you're 101% sure of what you do), modify EXTRA_LDFLAGS instead.

Who is online

Users browsing this forum: No registered users and 211 guests