as Gentoo user I build everything from sources, but I have problem with building toolchain for esp8266. I came up with this script:
#!/bin/sh
# note: eselect python2 before, because of gcc
# prepare board
mkdir -p ~/Arduino/hardware/esp8266com
cd ~/Arduino/hardware/esp8266com
git clone --recursive --depth 1 https://github.com/esp8266/Arduino.git esp8266
# use system python3
mkdir esp8266/tools/python3
ln -s /usr/bin/python3 esp8266/tools/python3/python3
# build toolchain
cd ~/Arduino
git clone --recursive --depth 1 https://github.com/pfalcon/esp-open-sdk.git
cd esp-open-sdk
sed -i "193s/.*/ |\$EGREP '^GNU bash, version (3\\.[1-9]|4|5)')/" crosstool-NG/configure.ac # add bash5 support
echo CT_DEBUG_gdb=n >> crosstool-config-overrides # don't build gdb
make STANDALONE=n
# "install" esp-open-sdk
ln -sf ~/Arduino/esp-open-sdk/xtensa-lx106-elf ~/Arduino/hardware/esp8266com/esp8266/tools/xtensa-lx106-elf
It builded successfully, but I get errors during building project:
(…)
/home/urhen/Arduino/hardware/esp8266com/esp8266/tools/python3/python3 /home/urhen/Arduino/hardware/esp8266com/esp8266/tools/makecorever.py --build_path /tmp/arduino_build_179995 --platform_path /home/urhen/Arduino/hardware/esp8266com/esp8266 --version unix-2.7.0-dev
fatal: No names found, cannot describe anything.
(…)
Linking everything together...
/home/urhen/Arduino/hardware/esp8266com/esp8266/tools/xtensa-lx106-elf/bin/xtensa-lx106-elf-gcc -CC -E -P -DVTABLES_IN_FLASH /home/urhen/Arduino/hardware/esp8266com/esp8266/tools/sdk/ld/eagle.app.v6.common.ld.h -o /tmp/arduino_build_179995/local.eagle.app.v6.common.ld
/home/urhen/Arduino/hardware/esp8266com/esp8266/tools/xtensa-lx106-elf/bin/xtensa-lx106-elf-gcc -fno-exceptions -Wl,-Map -Wl,/tmp/arduino_build_179995/sketch_apr19a.ino.map -g -Wall -Wextra -Os -nostdlib -Wl,--no-check-sections -u app_entry -u _printf_float -u _scanf_float -Wl,-static -L/home/urhen/Arduino/hardware/esp8266com/esp8266/tools/sdk/lib -L/home/urhen/Arduino/hardware/esp8266com/esp8266/tools/sdk/lib/NONOSDK22x_190703 -L/home/urhen/Arduino/hardware/esp8266com/esp8266/tools/sdk/ld -L/home/urhen/Arduino/hardware/esp8266com/esp8266/tools/sdk/libc/xtensa-lx106-elf/lib -Teagle.flash.4m2m.ld -Wl,--gc-sections -Wl,-wrap,system_restart_local -Wl,-wrap,spi_flash_read -o /tmp/arduino_build_179995/sketch_apr19a.ino.elf -Wl,--start-group /tmp/arduino_build_179995/sketch/sketch_apr19a.ino.cpp.o /tmp/arduino_build_179995/core/core.a -lhal -lphy -lpp -lnet80211 -llwip2-536-feat -lwpa -lcrypto -lmain -lwps -lbearssl -laxtls -lespnow -lsmartconfig -lairkiss -lwpa2 -lstdc++ -lm -lc -lgcc -Wl,--end-group -L/tmp/arduino_build_179995
/tmp/arduino_build_179995/core/core.a(core_esp8266_main.cpp.o):(.text.app_entry+0x0): undefined reference to `app_entry_custom()'
/tmp/arduino_build_179995/core/core.a(core_esp8266_main.cpp.o): In function `app_entry':
/home/urhen/Arduino/hardware/esp8266com/esp8266/cores/esp8266/core_esp8266_main.cpp:318: undefined reference to `app_entry_custom()'
collect2: error: ld returned 1 exit status
exit status 1
Error compiling for board LOLIN(WEMOS) D1 R2 & mini.
What am I missing?