Makefile:979: recipe for target 'build-GENERIC_SPIRAM/bootloader.elf' failed

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
xingkunpeng
Posts: 13
Joined: Mon Dec 21, 2020 3:41 am

Makefile:979: recipe for target 'build-GENERIC_SPIRAM/bootloader.elf' failed

Post by xingkunpeng » Tue Apr 13, 2021 5:03 am

I'm compiling the firmware of esp32. I encountered the following problems and asked for assistance;

xkp@xkp-VirtualBox:~/esp32/micropython/ports/esp32$ make
MicroPython v1.13-30-g1d344f446-dirty
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
Building with ESP IDF v4
LINK build-GENERIC_SPIRAM/bootloader.elf
/home/xkp/esp32/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/../../../../xtensa-esp32-elf/bin/ld: cannot find -lrtc
collect2: error: ld returned 1 exit status
Makefile:979: recipe for target 'build-GENERIC_SPIRAM/bootloader.elf' failed
make: *** [build-GENERIC_SPIRAM/bootloader.elf] Error 1

xkp@xkp-VirtualBox:~/esp32/micropython/ports/esp32$ make V=1
MicroPython v1.13-30-g1d344f446-dirty
Building with ESP IDF v4
LINK build-GENERIC_SPIRAM/bootloader.elf
xtensa-esp32-elf-gcc -nostdlib -L/home/xkp/esp32/esp-idf/lib -L/home/xkp/esp32/esp-idf/ld -u call_user_start_cpu0 -Wl,--gc-sections -static -Wl,-EL -Wl,-Map=build-GENERIC_SPIRAM/bootloader.map -Wl,--cref -T /home/xkp/esp32/esp-idf/components/bootloader/subproject/main/esp32.bootloader.ld -T /home/xkp/esp32/esp-idf/components/bootloader/subproject/main/esp32.bootloader.rom.ld -T /home/xkp/esp32/esp-idf/components/esp_rom/esp32/ld/esp32.rom.ld -T /home/xkp/esp32/esp-idf/components/esp_rom/esp32/ld/esp32.rom.newlib-funcs.ld -T /home/xkp/esp32/esp-idf/components/esp32/ld/esp32.peripherals.ld -o build-GENERIC_SPIRAM/bootloader.elf -Wl,--start-group -Lbuild-GENERIC_SPIRAM/bootloader -lbootloader_support -llog -lspi_flash -lsoc -lmain -L/home/xkp/esp32/esp-idf/components/esp_wifi/lib_esp32 -lrtc -L/home/xkp/esp32/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/esp32-psram/ -lgcc -Wl,--end-group
/home/xkp/esp32/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/../../../../xtensa-esp32-elf/bin/ld: cannot find -lrtc
collect2: error: ld returned 1 exit status
Makefile:979: recipe for target 'build-GENERIC_SPIRAM/bootloader.elf' failed
make: *** [build-GENERIC_SPIRAM/bootloader.elf] Error 1

Hope to get your help, thank you very much

xingkunpeng
Posts: 13
Joined: Mon Dec 21, 2020 3:41 am

Re: Makefile:979: recipe for target 'build-GENERIC_SPIRAM/bootloader.elf' failed

Post by xingkunpeng » Tue Apr 13, 2021 7:07 am

One more thing:
From the beginning of the compilation log, the feeling is a little bit worse, because makefile has reached the end:

xkp@xkp-VirtualBox:~/esp32/micropython/ports/esp32$ make
MicroPython v1.13-30-g1d344f446-dirty
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
Building with ESP IDF v4
GEN build-GENERIC_SPIRAM/sdkconfig.h
mkdir -p build-GENERIC_SPIRAM/bootloader//home/xkp/esp32/esp-idf/components/bootloader/subproject/main/
mkdir -p build-GENERIC_SPIRAM/bootloader//home/xkp/esp32/esp-idf/components/bootloader_support/src/
mkdir -p build-GENERIC_SPIRAM/bootloader//home/xkp/esp32/esp-idf/components/bootloader_support/src/esp32/
mkdir -p build-GENERIC_SPIRAM/bootloader//home/xkp/esp32/esp-idf/components/log/
mkdir -p build-GENERIC_SPIRAM/bootloader//home/xkp/esp32/esp-idf/components/soc/esp32/
mkdir -p build-GENERIC_SPIRAM/bootloader//home/xkp/esp32/esp-idf/components/soc/src/
mkdir -p build-GENERIC_SPIRAM/bootloader//home/xkp/esp32/esp-idf/components/spi_flash/
CC /home/xkp/esp32/esp-idf/components/bootloader_support/src/bootloader_clock.c
CC /home/xkp/esp32/esp-idf/components/bootloader_support/src/bootloader_common.c
CC /home/xkp/esp32/esp-idf/components/bootloader_support/src/bootloader_flash.c
CC /home/xkp/esp32/esp-idf/components/bootloader_support/src/bootloader_flash_config.c
CC /home/xkp/esp32/esp-idf/components/bootloader_support/src/bootloader_init.c
CC /home/xkp/esp32/esp-idf/components/bootloader_support/src/bootloader_random.c
CC /home/xkp/esp32/esp-idf/components/bootloader_support/src/bootloader_utility.c
CC /home/xkp/esp32/esp-idf/components/bootloader_support/src/flash_qio_mode.c
CC /home/xkp/esp32/esp-idf/components/bootloader_support/src/esp_image_format.c
CC /home/xkp/esp32/esp-idf/components/bootloader_support/src/flash_encrypt.c
CC /home/xkp/esp32/esp-idf/components/bootloader_support/src/flash_partitions.c
CC /home/xkp/esp32/esp-idf/components/bootloader_support/src/esp32/bootloader_sha.c
CC /home/xkp/esp32/esp-idf/components/bootloader_support/src/esp32/secure_boot.c
AR build-GENERIC_SPIRAM/bootloader/libbootloader_support.a
CC /home/xkp/esp32/esp-idf/components/log/log.c
AR build-GENERIC_SPIRAM/bootloader/liblog.a
CC /home/xkp/esp32/esp-idf/components/spi_flash/spi_flash_rom_patch.c
AR build-GENERIC_SPIRAM/bootloader/libspi_flash.a
CC /home/xkp/esp32/esp-idf/components/soc/esp32/cpu_util.c
CC /home/xkp/esp32/esp-idf/components/soc/esp32/gpio_periph.c
CC /home/xkp/esp32/esp-idf/components/soc/esp32/rtc_clk.c
CC /home/xkp/esp32/esp-idf/components/soc/esp32/rtc_clk_init.c
CC /home/xkp/esp32/esp-idf/components/soc/esp32/rtc_init.c
CC /home/xkp/esp32/esp-idf/components/soc/esp32/rtc_periph.c
CC /home/xkp/esp32/esp-idf/components/soc/esp32/rtc_pm.c
CC /home/xkp/esp32/esp-idf/components/soc/esp32/rtc_sleep.c
CC /home/xkp/esp32/esp-idf/components/soc/esp32/rtc_time.c
CC /home/xkp/esp32/esp-idf/components/soc/esp32/rtc_wdt.c
CC /home/xkp/esp32/esp-idf/components/soc/esp32/sdio_slave_periph.c
CC /home/xkp/esp32/esp-idf/components/soc/esp32/sdmmc_periph.c
CC /home/xkp/esp32/esp-idf/components/soc/esp32/soc_memory_layout.c
CC /home/xkp/esp32/esp-idf/components/soc/esp32/spi_periph.c
CC /home/xkp/esp32/esp-idf/components/soc/src/memory_layout_utils.c
AR build-GENERIC_SPIRAM/bootloader/libsoc.a
CC /home/xkp/esp32/esp-idf/components/bootloader/subproject/main/bootloader_start.c
AR build-GENERIC_SPIRAM/bootloader/libmain.a
LINK build-GENERIC_SPIRAM/bootloader.elf
/home/xkp/esp32/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/../../../../xtensa-esp32-elf/bin/ld: cannot find -lrtc
collect2: error: ld returned 1 exit status
Makefile:979: recipe for target 'build-GENERIC_SPIRAM/bootloader.elf' failed
make: *** [build-GENERIC_SPIRAM/bootloader.elf] Error 1

marcidy
Posts: 133
Joined: Sat Dec 12, 2020 11:07 pm

Re: Makefile:979: recipe for target 'build-GENERIC_SPIRAM/bootloader.elf' failed

Post by marcidy » Tue Apr 13, 2021 5:25 pm

You're having problems linking into the esp-idf.

Are you using the correct version of the idf? There are specific commits to use when compiling micropython v1.13.
Are you sourcing "esp-idf/export.sh" before compiling? You have to do this every time.

You might want to do it all again from scratch. When following the instructions exactly, it will work, so the most likely case here was a missed step in the instructions.

Make sure you clone recursively to pick up the submodules. librtc is provided by a different repository than the idf, and i would guess you didn't do the submodules step.

If you want to try a targetted fix, in the esp-idf directory, do:

Code: Select all

$ git submodule init
$ git submodule update --recursive
Then to make clean and try again.

IF this doesn't work, i would delete everything and start from scratch, making sure to execute the commands as they are listed in the instructions. A 'git clone' will not just work, as it is not enough to retrieve all the objects you need. You need to clone --recursive or manage the submodules yourself.

xingkunpeng
Posts: 13
Joined: Mon Dec 21, 2020 3:41 am

Re: Makefile:979: recipe for target 'build-GENERIC_SPIRAM/bootloader.elf' failed

Post by xingkunpeng » Wed Apr 14, 2021 2:41 am

marcidy wrote:
Tue Apr 13, 2021 5:25 pm
You're having problems linking into the esp-idf.

Are you using the correct version of the idf? There are specific commits to use when compiling micropython v1.13.
Are you sourcing "esp-idf/export.sh" before compiling? You have to do this every time.

You might want to do it all again from scratch. When following the instructions exactly, it will work, so the most likely case here was a missed step in the instructions.

Make sure you clone recursively to pick up the submodules. librtc is provided by a different repository than the idf, and i would guess you didn't do the submodules step.

If you want to try a targetted fix, in the esp-idf directory, do:

Code: Select all

$ git submodule init
$ git submodule update --recursive
Then to make clean and try again.

IF this doesn't work, i would delete everything and start from scratch, making sure to execute the commands as they are listed in the instructions. A 'git clone' will not just work, as it is not enough to retrieve all the objects you need. You need to clone --recursive or manage the submodules yourself.




OK, thank you very much for your reply. Now is OK!
How did I solve it?

I'll just download clone again from GitHub and the warehouse. It was originally from the warehouse clone that I transferred from gitee, and the sub module was imported by myself. Maybe the sub module that I imported from gitee is incomplete.

Post Reply