espressif / esp-idf

Espressif IoT Development Framework. Official development framework for Espressif SoCs.
Apache License 2.0
12.93k stars 7.1k forks source link

GNU Make bootloader build failed (IDFGH-5409) #7155

Closed ataweg closed 3 years ago

ataweg commented 3 years ago

since commit 0ea20caa712f4a701fd2e0dba6633807fbd538de [log]: Normal log works on Linux now

Using a make based toolchain the bootloader build failed (see below): This happened because ...\components\log\component.mk was not updated with the log_linux.c introduced. For now I used this workaround:

ifndef IS_BOOTLOADER_BUILD
COMPONENT_OBJEXCLUDE := log_noos.o log_linux.o
else
COMPONENT_OBJEXCLUDE := log_freertos.o log_linux.o
endif

COMPONENT_ADD_LDFRAGMENTS += linker.lf

Please check and find a better solution.


Toolchain path: /c/Espressif/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc
Toolchain version: esp-2020r3
Compiler version: 8.4.0
Python requirements from C:/Espressif/esp-idf-master\requirements.txt are satisfied.
LD /F/working/Build/Projects/InternetOfThings/Devices/Wifi-WeatherStation/Firmware/Wifi-WeatherStation/build/bootloader/bootloader.elf
c:/espressif/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: F:/working/Build/Projects/InternetOfThings/Devices/Wifi-WeatherStation/Firmware/Wifi-WeatherStation/build/bootloader/log\liblog.a(log_noos.o): in function `esp_log_impl_lock':
C:/Espressif/esp-idf-master/components/log/log_noos.c:14: multiple definition of `esp_log_impl_lock'; F:/working/Build/Projects/InternetOfThings/Devices/Wifi-WeatherStation/Firmware/Wifi-WeatherStation/build/bootloader/log\liblog.a(log_linux.o):C:/Espressif/esp-idf-master/components/log/log_linux.c:24: first defined here
c:/espressif/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: F:/working/Build/Projects/InternetOfThings/Devices/Wifi-WeatherStation/Firmware/Wifi-WeatherStation/build/bootloader/log\liblog.a(log_noos.o): in function `esp_log_impl_unlock':
C:/Espressif/esp-idf-master/components/log/log_noos.c:26: multiple definition of `esp_log_impl_unlock'; F:/working/Build/Projects/InternetOfThings/Devices/Wifi-WeatherStation/Firmware/Wifi-WeatherStation/build/bootloader/log\liblog.a(log_linux.o):C:/Espressif/esp-idf-master/components/log/log_linux.c:35: first defined here
c:/espressif/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: F:/working/Build/Projects/InternetOfThings/Devices/Wifi-WeatherStation/Firmware/Wifi-WeatherStation/build/bootloader/log\liblog.a(log_noos.o): in function `esp_log_early_timestamp':
C:/Espressif/esp-idf-master/components/log/log_noos.c:33: multiple definition of `esp_log_timestamp'; F:/working/Build/Projects/InternetOfThings/Devices/Wifi-WeatherStation/Firmware/Wifi-WeatherStation/build/bootloader/log\liblog.a(log_linux.o):C:/Espressif/esp-idf-master/components/log/log_linux.c:40: first defined here
c:/espressif/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: F:/working/Build/Projects/InternetOfThings/Devices/Wifi-WeatherStation/Firmware/Wifi-WeatherStation/build/bootloader/log\liblog.a(log_linux.o):(.literal.esp_log_timestamp+0x10): undefined reference to `clock_gettime'
c:/espressif/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: F:/working/Build/Projects/InternetOfThings/Devices/Wifi-WeatherStation/Firmware/Wifi-WeatherStation/build/bootloader/log\liblog.a(log_linux.o): in function `esp_log_timestamp':
C:/Espressif/esp-idf-master/components/log/log_linux.c:42: undefined reference to `clock_gettime'
collect2.exe: error: ld returned 1 exit status
make[1]: *** [/c/Espressif/esp-idf-master/make/project.mk:571: /F/working/Build/Projects/InternetOfThings/Devices/Wifi-WeatherStation/Firmware/Wifi-WeatherStation/build/bootloader/bootloader.elf] Error 1
make[1]: Target '/F/working/Build/Projects/InternetOfThings/Devices/Wifi-WeatherStation/Firmware/Wifi-WeatherStation/build/bootloader/bootloader.bin' not remade because of errors.
make: *** [/c/Espressif/esp-idf-master/components/bootloader/Makefile.projbuild:43: /F/working/Build/Projects/InternetOfThings/Devices/Wifi-WeatherStation/Firmware/Wifi-WeatherStation/build/bootloader/bootloader.bin] Error 2

Project is not inside a git repository, or git repository has no commits
will not use 'git describe' to determine PROJECT_VER.
App "Wifi-WeatherStation" version: 1
/c/Espressif/esp-idf-master/make/component_wrapper.mk:291: warning: overriding recipe for target '.'
/c/Espressif/esp-idf-master/make/component_wrapper.mk:291: warning: ignoring old recipe for target '.'
make: Target 'all' not remade because of errors.```
projectgus commented 3 years ago

Hi @ataweg,

Thanks for noticing this. The fix you have is the correct fix. We'll apply it internally and also check how our automated CI system didn't pick up this build regression.

Angus