Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't build new project on m1 mac [different from known problem] #196

Open
aklitzke opened this issue Mar 11, 2024 · 2 comments
Open

Can't build new project on m1 mac [different from known problem] #196

aklitzke opened this issue Mar 11, 2024 · 2 comments

Comments

@aklitzke
Copy link

Bug description

plain sample project build fails with compiler / linker error like /Users/andrewklitzke/esp/esp-idf/components/newlib/reent_init.c:29:6: error: 'struct _reent' has no member named '__sdidinit'

  • Would you like to work on a fix? n

To Reproduce

Steps to reproduce the behavior:

  1. be using m1 mac
  2. fresh install esp-idf v5.1
  3. cargo generate esp-rs/esp-idf-template cargo, esp32, no advanced template
  4. CRATE_CC_NO_DEFAULTS=1 cargo build

Expected behavior

successful build

Environment

  • OS: MacOS Monterey 12.6.8
  • espup v0.11.0
  • xtensa-esp-elf-gcc version 13.2.0
  • cargo 1.75.0

Error

[1/543] Building C object esp-idf/newlib/CMakeFiles/__idf_newlib.dir/reent_init.c.obj
  FAILED: esp-idf/newlib/CMakeFiles/__idf_newlib.dir/reent_init.c.obj
  /Users/andrewklitzke/.rustup/toolchains/esp/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/xtensa-esp32-elf-gcc -DESP_PLATFORM -DIDF_VER=\"v5.1.3-204-ge3e112e612\" -DSOC_MMU_PAGE_SIZE=CONFIG_MMU_PAGE_SIZE -D_GNU_SOURCE -D_POSIX_READER_WRITER_LOCKS -I/Users/andrewklitzke/esp/is-cat-fed/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-75975dbced1903a2/out/build/config -I/Users/andrewklitzke/esp/esp-idf/components/newlib/platform_include -I/Users/andrewklitzke/esp/esp-idf/components/newlib/priv_include -I/Users/andrewklitzke/esp/esp-idf/components/freertos/FreeRTOS-Kernel/include -I/Users/andrewklitzke/esp/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include -I/Users/andrewklitzke/esp/esp-idf/components/freertos/esp_additions/include/freertos -I/Users/andrewklitzke/esp/esp-idf/components/freertos/esp_additions/include -I/Users/andrewklitzke/esp/esp-idf/components/freertos/esp_additions/arch/xtensa/include -I/Users/andrewklitzke/esp/esp-idf/components/esp_hw_support/include -I/Users/andrewklitzke/esp/esp-idf/components/esp_hw_support/include/soc -I/Users/andrewklitzke/esp/esp-idf/components/esp_hw_support/include/soc/esp32 -I/Users/andrewklitzke/esp/esp-idf/components/esp_hw_support/port/esp32/. -I/Users/andrewklitzke/esp/esp-idf/components/heap/include -I/Users/andrewklitzke/esp/esp-idf/components/log/include -I/Users/andrewklitzke/esp/esp-idf/components/soc/include -I/Users/andrewklitzke/esp/esp-idf/components/soc/esp32 -I/Users/andrewklitzke/esp/esp-idf/components/soc/esp32/include -I/Users/andrewklitzke/esp/esp-idf/components/hal/esp32/include -I/Users/andrewklitzke/esp/esp-idf/components/hal/include -I/Users/andrewklitzke/esp/esp-idf/components/hal/platform_port/include -I/Users/andrewklitzke/esp/esp-idf/components/esp_rom/include -I/Users/andrewklitzke/esp/esp-idf/components/esp_rom/include/esp32 -I/Users/andrewklitzke/esp/esp-idf/components/esp_rom/esp32 -I/Users/andrewklitzke/esp/esp-idf/components/esp_common/include -I/Users/andrewklitzke/esp/esp-idf/components/esp_system/include -I/Users/andrewklitzke/esp/esp-idf/components/esp_system/port/soc -I/Users/andrewklitzke/esp/esp-idf/components/esp_system/port/include/private -I/Users/andrewklitzke/esp/esp-idf/components/xtensa/include -I/Users/andrewklitzke/esp/esp-idf/components/xtensa/esp32/include -I/Users/andrewklitzke/esp/esp-idf/components/lwip/include -I/Users/andrewklitzke/esp/esp-idf/components/lwip/include/apps -I/Users/andrewklitzke/esp/esp-idf/components/lwip/include/apps/sntp -I/Users/andrewklitzke/esp/esp-idf/components/lwip/lwip/src/include -I/Users/andrewklitzke/esp/esp-idf/components/lwip/port/include -I/Users/andrewklitzke/esp/esp-idf/components/lwip/port/freertos/include -I/Users/andrewklitzke/esp/esp-idf/components/lwip/port/esp32xx/include -I/Users/andrewklitzke/esp/esp-idf/components/lwip/port/esp32xx/include/arch -I/Users/andrewklitzke/esp/esp-idf/components/spi_flash/include -mlongcalls -Wno-frame-address  -fdiagnostics-color=always -ffunction-sections -fdata-sections -Wall -Werror=all -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=unused-but-set-variable -Wno-error=deprecated-declarations -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-enum-conversion -gdwarf-4 -ggdb -Os -freorder-blocks -fmacro-prefix-map=/Users/andrewklitzke/esp/is-cat-fed/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-75975dbced1903a2/out=. -fmacro-prefix-map=/Users/andrewklitzke/esp/esp-idf=/IDF -fstrict-volatile-bitfields -fno-jump-tables -fno-tree-switch-conversion -DconfigENABLE_FREERTOS_DEBUG_OCDAWARE=1 -std=gnu17 -Wno-old-style-declaration -MD -MT esp-idf/newlib/CMakeFiles/__idf_newlib.dir/reent_init.c.obj -MF esp-idf/newlib/CMakeFiles/__idf_newlib.dir/reent_init.c.obj.d -o esp-idf/newlib/CMakeFiles/__idf_newlib.dir/reent_init.c.obj -c /Users/andrewklitzke/esp/esp-idf/components/newlib/reent_init.c
  /Users/andrewklitzke/esp/esp-idf/components/newlib/reent_init.c: In function 'esp_reent_init':
  /Users/andrewklitzke/esp/esp-idf/components/newlib/reent_init.c:29:6: error: 'struct _reent' has no member named '__sdidinit'
     29 |     r->__sdidinit = 1;
        |      ^~
  /Users/andrewklitzke/esp/esp-idf/components/newlib/reent_init.c:30:6: error: 'struct _reent' has no member named '__sglue'
     30 |     r->__sglue._next = NULL;
        |      ^~
  /Users/andrewklitzke/esp/esp-idf/components/newlib/reent_init.c:31:6: error: 'struct _reent' has no member named '__sglue'
     31 |     r->__sglue._niobs = 0;
        |      ^~
  /Users/andrewklitzke/esp/esp-idf/components/newlib/reent_init.c:32:6: error: 'struct _reent' has no member named '__sglue'
     32 |     r->__sglue._iobs = NULL;
        |      ^~
  /Users/andrewklitzke/esp/esp-idf/components/newlib/reent_init.c: In function 'esp_reent_cleanup':
  /Users/andrewklitzke/esp/esp-idf/components/newlib/reent_init.c:60:40: error: 'struct _reent' has no member named '__sglue'
     60 |     struct _glue* prev = &_GLOBAL_REENT->__sglue;
        |                                        ^~
  /Users/andrewklitzke/esp/esp-idf/components/newlib/reent_init.c:61:43: error: 'struct _reent' has no member named '__sglue'
     61 |     for (struct _glue* cur = _GLOBAL_REENT->__sglue._next; cur != NULL;) {
        |                                           ^~

Additional Context

CAN build idf's non-rust 'hello world' template

env:

SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.tLAyJ1gsvf/Listeners
LC_TERMINAL_VERSION=3.4.16
COLORFGBG=7;0
ITERM_PROFILE=Default
XPC_FLAGS=0x0
LANG=en_US.UTF-8
PWD=/Users/andrewklitzke/esp/is-cat-fed
SHELL=/bin/zsh
__CFBundleIdentifier=com.googlecode.iterm2
SECURITYSESSIONID=186b0
TERM_PROGRAM_VERSION=3.4.16
TERM_PROGRAM=iTerm.app
PATH=/Users/andrewklitzke/esp/esp-idf/components/espcoredump:/Users/andrewklitzke/esp/esp-idf/components/partition_table:/Users/andrewklitzke/esp/esp-idf/components/app_update:/Users/andrewklitzke/.espressif/tools/xtensa-esp-elf-gdb/12.1_20231023/xtensa-esp-elf-gdb/bin:/Users/andrewklitzke/.espressif/tools/riscv32-esp-elf-gdb/12.1_20231023/riscv32-esp-elf-gdb/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp32s2-elf/esp-12.2.0_20230208/xtensa-esp32s2-elf/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin:/Users/andrewklitzke/.espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin:/Users/andrewklitzke/.espressif/tools/esp32ulp-elf/2.35_20220830/esp32ulp-elf/bin:/Users/andrewklitzke/.espressif/tools/openocd-esp32/v0.12.0-esp32-20230921/openocd-esp32/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp-elf-gdb/12.1_20231023/xtensa-esp-elf-gdb/bin:/Users/andrewklitzke/.espressif/tools/riscv32-esp-elf-gdb/12.1_20231023/riscv32-esp-elf-gdb/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp32s2-elf/esp-12.2.0_20230208/xtensa-esp32s2-elf/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin:/Users/andrewklitzke/.espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin:/Users/andrewklitzke/.espressif/tools/esp32ulp-elf/2.35_20220830/esp32ulp-elf/bin:/Users/andrewklitzke/.espressif/tools/openocd-esp32/v0.12.0-esp32-20230921/openocd-esp32/bin:/Users/andrewklitzke/esp/esp-idf/components/espcoredump:/Users/andrewklitzke/esp/esp-idf/components/partition_table:/Users/andrewklitzke/esp/esp-idf/components/app_update:/Users/andrewklitzke/.espressif/tools/xtensa-esp-elf-gdb/12.1_20231023/xtensa-esp-elf-gdb/bin:/Users/andrewklitzke/.espressif/tools/riscv32-esp-elf-gdb/12.1_20231023/riscv32-esp-elf-gdb/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp32s2-elf/esp-12.2.0_20230208/xtensa-esp32s2-elf/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin:/Users/andrewklitzke/.espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin:/Users/andrewklitzke/.espressif/tools/esp32ulp-elf/2.35_20220830/esp32ulp-elf/bin:/Users/andrewklitzke/.espressif/tools/openocd-esp32/v0.12.0-esp32-20230921/openocd-esp32/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp-elf-gdb/12.1_20231023/xtensa-esp-elf-gdb/bin:/Users/andrewklitzke/.espressif/tools/riscv32-esp-elf-gdb/12.1_20231023/riscv32-esp-elf-gdb/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp32s2-elf/esp-12.2.0_20230208/xtensa-esp32s2-elf/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin:/Users/andrewklitzke/.espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin:/Users/andrewklitzke/.espressif/tools/esp32ulp-elf/2.35_20220830/esp32ulp-elf/bin:/Users/andrewklitzke/.espressif/tools/openocd-esp32/v0.12.0-esp32-20230921/openocd-esp32/bin:/Users/andrewklitzke/.rustup/toolchains/esp/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin:/Users/andrewklitzke/esp/esp-idf/components/espcoredump:/Users/andrewklitzke/esp/esp-idf/components/partition_table:/Users/andrewklitzke/esp/esp-idf/components/app_update:/Users/andrewklitzke/.espressif/tools/xtensa-esp-elf-gdb/12.1_20231023/xtensa-esp-elf-gdb/bin:/Users/andrewklitzke/.espressif/tools/riscv32-esp-elf-gdb/12.1_20231023/riscv32-esp-elf-gdb/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp32s2-elf/esp-12.2.0_20230208/xtensa-esp32s2-elf/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin:/Users/andrewklitzke/.espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin:/Users/andrewklitzke/.espressif/tools/esp32ulp-elf/2.35_20220830/esp32ulp-elf/bin:/Users/andrewklitzke/.espressif/tools/openocd-esp32/v0.12.0-esp32-20230921/openocd-esp32/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp-elf-gdb/12.1_20231023/xtensa-esp-elf-gdb/bin:/Users/andrewklitzke/.espressif/tools/riscv32-esp-elf-gdb/12.1_20231023/riscv32-esp-elf-gdb/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp32s2-elf/esp-12.2.0_20230208/xtensa-esp32s2-elf/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin:/Users/andrewklitzke/.espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin:/Users/andrewklitzke/.espressif/tools/esp32ulp-elf/2.35_20220830/esp32ulp-elf/bin:/Users/andrewklitzke/.espressif/tools/openocd-esp32/v0.12.0-esp32-20230921/openocd-esp32/bin:/Users/andrewklitzke/esp/esp-idf/components/espcoredump:/Users/andrewklitzke/esp/esp-idf/components/partition_table:/Users/andrewklitzke/esp/esp-idf/components/app_update:/Users/andrewklitzke/.espressif/tools/xtensa-esp-elf-gdb/12.1_20231023/xtensa-esp-elf-gdb/bin:/Users/andrewklitzke/.espressif/tools/riscv32-esp-elf-gdb/12.1_20231023/riscv32-esp-elf-gdb/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp32s2-elf/esp-12.2.0_20230208/xtensa-esp32s2-elf/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin:/Users/andrewklitzke/.espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin:/Users/andrewklitzke/.espressif/tools/esp32ulp-elf/2.35_20220830/esp32ulp-elf/bin:/Users/andrewklitzke/.espressif/tools/openocd-esp32/v0.12.0-esp32-20230921/openocd-esp32/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp-elf-gdb/12.1_20231023/xtensa-esp-elf-gdb/bin:/Users/andrewklitzke/.espressif/tools/riscv32-esp-elf-gdb/12.1_20231023/riscv32-esp-elf-gdb/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp32s2-elf/esp-12.2.0_20230208/xtensa-esp32s2-elf/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin:/Users/andrewklitzke/.espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin:/Users/andrewklitzke/.espressif/tools/esp32ulp-elf/2.35_20220830/esp32ulp-elf/bin:/Users/andrewklitzke/.espressif/tools/openocd-esp32/v0.12.0-esp32-20230921/openocd-esp32/bin:/Users/andrewklitzke/.rustup/toolchains/esp/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin:/Users/andrewklitzke/esp/esp-idf/components/espcoredump:/Users/andrewklitzke/esp/esp-idf/components/partition_table:/Users/andrewklitzke/esp/esp-idf/components/app_update:/Users/andrewklitzke/.espressif/tools/xtensa-esp-elf-gdb/12.1_20231023/xtensa-esp-elf-gdb/bin:/Users/andrewklitzke/.espressif/tools/riscv32-esp-elf-gdb/12.1_20231023/riscv32-esp-elf-gdb/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp32s2-elf/esp-12.2.0_20230208/xtensa-esp32s2-elf/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin:/Users/andrewklitzke/.espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin:/Users/andrewklitzke/.espressif/tools/esp32ulp-elf/2.35_20220830/esp32ulp-elf/bin:/Users/andrewklitzke/.espressif/tools/openocd-esp32/v0.12.0-esp32-20230921/openocd-esp32/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp-elf-gdb/12.1_20231023/xtensa-esp-elf-gdb/bin:/Users/andrewklitzke/.espressif/tools/riscv32-esp-elf-gdb/12.1_20231023/riscv32-esp-elf-gdb/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp32s2-elf/esp-12.2.0_20230208/xtensa-esp32s2-elf/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin:/Users/andrewklitzke/.espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin:/Users/andrewklitzke/.espressif/tools/esp32ulp-elf/2.35_20220830/esp32ulp-elf/bin:/Users/andrewklitzke/.espressif/tools/openocd-esp32/v0.12.0-esp32-20230921/openocd-esp32/bin:/Users/andrewklitzke/esp/esp-idf/components/espcoredump:/Users/andrewklitzke/esp/esp-idf/components/partition_table:/Users/andrewklitzke/esp/esp-idf/components/app_update:/Users/andrewklitzke/.espressif/tools/xtensa-esp-elf-gdb/12.1_20231023/xtensa-esp-elf-gdb/bin:/Users/andrewklitzke/.espressif/tools/riscv32-esp-elf-gdb/12.1_20231023/riscv32-esp-elf-gdb/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp32s2-elf/esp-12.2.0_20230208/xtensa-esp32s2-elf/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin:/Users/andrewklitzke/.espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin:/Users/andrewklitzke/.espressif/tools/esp32ulp-elf/2.35_20220830/esp32ulp-elf/bin:/Users/andrewklitzke/.espressif/tools/openocd-esp32/v0.12.0-esp32-20230921/openocd-esp32/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp-elf-gdb/12.1_20231023/xtensa-esp-elf-gdb/bin:/Users/andrewklitzke/.espressif/tools/riscv32-esp-elf-gdb/12.1_20231023/riscv32-esp-elf-gdb/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp32s2-elf/esp-12.2.0_20230208/xtensa-esp32s2-elf/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin:/Users/andrewklitzke/.espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin:/Users/andrewklitzke/.espressif/tools/esp32ulp-elf/2.35_20220830/esp32ulp-elf/bin:/Users/andrewklitzke/.espressif/tools/openocd-esp32/v0.12.0-esp32-20230921/openocd-esp32/bin:/Users/andrewklitzke/.rustup/toolchains/esp/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin:/Users/andrewklitzke/esp/esp-idf/components/espcoredump:/Users/andrewklitzke/esp/esp-idf/components/partition_table:/Users/andrewklitzke/esp/esp-idf/components/app_update:/Users/andrewklitzke/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp32s2-elf/esp-12.2.0_20230208/xtensa-esp32s2-elf/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin:/Users/andrewklitzke/.rustup/toolchains/esp/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin:/Users/andrewklitzke/esp/esp-idf/components/espcoredump:/Users/andrewklitzke/esp/esp-idf/components/partition_table:/Users/andrewklitzke/esp/esp-idf/components/app_update:/Users/andrewklitzke/esp/esp-idf/components/espcoredump:/Users/andrewklitzke/esp/esp-idf/components/partition_table:/Users/andrewklitzke/esp/esp-idf/components/app_update:/Users/andrewklitzke/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp32s2-elf/esp-12.2.0_20230208/xtensa-esp32s2-elf/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin:/Users/andrewklitzke/.rustup/toolchains/esp/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin:/Users/andrewklitzke/.rustup/toolchains/esp/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin:/Users/andrewklitzke/esp/esp-idf/components/espcoredump:/Users/andrewklitzke/esp/esp-idf/components/partition_table:/Users/andrewklitzke/esp/esp-idf/components/app_update:/Users/andrewklitzke/.espressif/tools/xtensa-esp-elf-gdb/12.1_20221002/xtensa-esp-elf-gdb/bin:/Users/andrewklitzke/.espressif/tools/riscv32-esp-elf-gdb/12.1_20221002/riscv32-esp-elf-gdb/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp32s2-elf/esp-12.2.0_20230208/xtensa-esp32s2-elf/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin:/Users/andrewklitzke/.espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin:/Users/andrewklitzke/.espressif/tools/esp32ulp-elf/2.35_20220830/esp32ulp-elf/bin:/Users/andrewklitzke/.espressif/tools/openocd-esp32/v0.12.0-esp32-20230419/openocd-esp32/bin:/Users/andrewklitzke/.espressif/python_env/idf5.1_py3.9_env/bin:/Users/andrewklitzke/esp/esp-idf/tools:/Users/andrewklitzke/.rustup/toolchains/esp/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin:/Users/andrewklitzke/.gvm/bin:/Users/andrewklitzke/Downloads/google-cloud-sdk/bin:/opt/homebrew/Caskroom/miniconda/base/bin:/opt/homebrew/Caskroom/miniconda/base/condabin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/Users/andrewklitzke/.cargo/bin
LC_TERMINAL=iTerm2
COLORTERM=truecolor
COMMAND_MODE=unix2003
TERM=xterm-256color
HOME=/Users/andrewklitzke
TMPDIR=/var/folders/s2/kx0cfh5n54v25c8xprdtmng00000gn/T/
USER=andrewklitzke
XPC_SERVICE_NAME=0
LOGNAME=andrewklitzke
LaunchInstanceID=57992774-0C5D-499F-96F8-05251691719C
__CF_USER_TEXT_ENCODING=0x0:0:0
ITERM_SESSION_ID=w0t0p0:8B0CE9CB-9F55-4B44-88D8-C42418FD17BA
SHLVL=1
OLDPWD=/Users/andrewklitzke/esp
HOMEBREW_PREFIX=/opt/homebrew
HOMEBREW_CELLAR=/opt/homebrew/Cellar
HOMEBREW_REPOSITORY=/opt/homebrew
MANPATH=/opt/homebrew/share/man::
INFOPATH=/opt/homebrew/share/info:
ZSH=/Users/andrewklitzke/.oh-my-zsh
PAGER=less
LESS=-R
LSCOLORS=Gxfxcxdxbxegedabagacad
LS_COLORS=di=1;36:ln=35:so=32:pi=33:ex=31:bd=34;46:cd=34;43:su=30;41:sg=30;46:tw=30;42:ow=30;43
CONDA_EXE=/opt/homebrew/Caskroom/miniconda/base/bin/conda
_CE_M=
_CE_CONDA=
CONDA_PYTHON_EXE=/opt/homebrew/Caskroom/miniconda/base/bin/python
CONDA_SHLVL=1
CONDA_PREFIX=/opt/homebrew/Caskroom/miniconda/base
CONDA_DEFAULT_ENV=base
CONDA_PROMPT_MODIFIER=(base)
GVM_ROOT=/Users/andrewklitzke/.gvm
GVM_VERSION=1.0.22
GVM_PATH_BACKUP=/Users/andrewklitzke/.gvm/bin:/Users/andrewklitzke/Downloads/google-cloud-sdk/bin:/opt/homebrew/Caskroom/miniconda/base/bin:/opt/homebrew/Caskroom/miniconda/base/condabin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/Users/andrewklitzke/.cargo/bin
LIBCLANG_PATH=/Users/andrewklitzke/.rustup/toolchains/esp/xtensa-esp32-elf-clang/esp-16.0.4-20231113/esp-clang/lib
IDF_PATH=/Users/andrewklitzke/esp/esp-idf
OPENOCD_SCRIPTS=/Users/andrewklitzke/.espressif/tools/openocd-esp32/v0.12.0-esp32-20230921/openocd-esp32/share/openocd/scripts
ESP_ROM_ELF_DIR=/Users/andrewklitzke/.espressif/tools/esp-rom-elfs/20230320/
IDF_PYTHON_ENV_PATH=/Users/andrewklitzke/.espressif/python_env/idf5.1_py3.9_env
ESP_IDF_VERSION=5.1
IDF_DEACTIVATE_FILE_PATH=/var/folders/s2/kx0cfh5n54v25c8xprdtmng00000gn/T/tmpakdsrod6idf_91827
IDF_TOOLS_EXPORT_CMD=/Users/andrewklitzke/esp/esp-idf/export.sh
IDF_TOOLS_INSTALL_CMD=/Users/andrewklitzke/esp/esp-idf/install.sh
_=/usr/bin/env
@KirillSmirnov
Copy link

The very same issue arises on ubuntu 24.04 with recent esp-idf:
ESP-IDF v5.1.5-282-g77a3025ac1-dirty
toolchain: xtensa-esp-elf/esp-14.2.0_20240906

...
/home/ubuntu/.rustup/toolchains/esp/xtensa-esp-elf/esp-14.2.0_20240906/xtensa-esp-elf/bin/xtensa-esp32-elf-gcc -DESP_PLATFORM -DIDF_VER=\"v5.1.5-282-g77a3025ac1\" -DSOC_MMU_PAGE_SIZE=CONFIG_MMU_PAGE_SIZE -D_GNU_SOURCE -D_POSIX_READER_WRITER_LOCKS -I/home/ubuntu/project/examples/c-examples/ex/build/config -I/home/ubuntu/esp-idf/components/newlib/platform_include -I/home/ubuntu/esp-idf/components/newlib/priv_include -I/home/ubuntu/esp-idf/components/freertos/FreeRTOS-Kernel/include -I/home/ubuntu/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include -I/home/ubuntu/esp-idf/components/freertos/esp_additions/include/freertos -I/home/ubuntu/esp-idf/components/freertos/esp_additions/include -I/home/ubuntu/esp-idf/components/freertos/esp_additions/arch/xtensa/include -I/home/ubuntu/esp-idf/components/esp_hw_support/include -I/home/ubuntu/esp-idf/components/esp_hw_support/include/soc -I/home/ubuntu/esp-idf/components/esp_hw_support/include/soc/esp32 -I/home/ubuntu/esp-idf/components/esp_hw_support/port/esp32/. -I/home/ubuntu/esp-idf/components/heap/include -I/home/ubuntu/esp-idf/components/log/include -I/home/ubuntu/esp-idf/components/soc/include -I/home/ubuntu/esp-idf/components/soc/esp32 -I/home/ubuntu/esp-idf/components/soc/esp32/include -I/home/ubuntu/esp-idf/components/hal/esp32/include -I/home/ubuntu/esp-idf/components/hal/include -I/home/ubuntu/esp-idf/components/hal/platform_port/include -I/home/ubuntu/esp-idf/components/esp_rom/include -I/home/ubuntu/esp-idf/components/esp_rom/include/esp32 -I/home/ubuntu/esp-idf/components/esp_rom/esp32 -I/home/ubuntu/esp-idf/components/esp_common/include -I/home/ubuntu/esp-idf/components/esp_system/include -I/home/ubuntu/esp-idf/components/esp_system/port/soc -I/home/ubuntu/esp-idf/components/esp_system/port/include/private -I/home/ubuntu/esp-idf/components/xtensa/include -I/home/ubuntu/esp-idf/components/xtensa/esp32/include -I/home/ubuntu/esp-idf/components/lwip/include -I/home/ubuntu/esp-idf/components/lwip/include/apps -I/home/ubuntu/esp-idf/components/lwip/include/apps/sntp -I/home/ubuntu/esp-idf/components/lwip/lwip/src/include -I/home/ubuntu/esp-idf/components/lwip/port/include -I/home/ubuntu/esp-idf/components/lwip/port/freertos/include -I/home/ubuntu/esp-idf/components/lwip/port/esp32xx/include -I/home/ubuntu/esp-idf/components/lwip/port/esp32xx/include/arch -I/home/ubuntu/esp-idf/components/spi_flash/include -mlongcalls -Wno-frame-address  -fdiagnostics-color=always -ffunction-sections -fdata-sections -Wall -Werror=all -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=unused-but-set-variable -Wno-error=deprecated-declarations -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-enum-conversion -gdwarf-4 -ggdb -Og -fmacro-prefix-map=/home/ubuntu/project/examples/c-examples/ex=. -fmacro-prefix-map=/home/ubuntu/esp-idf=/IDF -fstrict-volatile-bitfields -fno-jump-tables -fno-tree-switch-conversion -DconfigENABLE_FREERTOS_DEBUG_OCDAWARE=1 -std=gnu17 -Wno-old-style-declaration -MD -MT esp-idf/newlib/CMakeFiles/__idf_newlib.dir/reent_init.c.obj -MF CMakeFiles/__idf_newlib.dir/reent_init.c.obj.d -o CMakeFiles/__idf_newlib.dir/reent_init.c.obj -c /home/ubuntu/esp-idf/components/newlib/reent_init.c

/home/ubuntu/esp-idf/components/newlib/reent_init.c:29:6: error: 'struct _reent' has no member named '__sdidinit'
   29 |     r->__sdidinit = 1;
      |      ^~
/home/ubuntu/esp-idf/components/newlib/reent_init.c:30:6: error: 'struct _reent' has no member named '__sglue'
   30 |     r->__sglue._next = NULL;
      |      ^~
/home/ubuntu/esp-idf/components/newlib/reent_init.c:31:6: error: 'struct _reent' has no member named '__sglue'
   31 |     r->__sglue._niobs = 0;
      |      ^~
/home/ubuntu/esp-idf/components/newlib/reent_init.c:32:6: error: 'struct _reent' has no member named '__sglue'
   32 |     r->__sglue._iobs = NULL;
      |      ^~
/home/ubuntu/esp-idf/components/newlib/reent_init.c: In function 'esp_reent_cleanup':
/home/ubuntu/esp-idf/components/newlib/reent_init.c:60:40: error: 'struct _reent' has no member named '__sglue'
   60 |     struct _glue* prev = &_GLOBAL_REENT->__sglue;
      |                                        ^~
/home/ubuntu/esp-idf/components/newlib/reent_init.c:61:43: error: 'struct _reent' has no member named '__sglue'
   61 |     for (struct _glue* cur = _GLOBAL_REENT->__sglue._next; cur != NULL;) {
      |                                           ^~
make[2]: *** [esp-idf/newlib/CMakeFiles/__idf_newlib.dir/build.make:174: esp-idf/newlib/CMakeFiles/__idf_newlib.dir/reent_init.c.obj] Error 1

@ivmarkov
Copy link
Collaborator

ivmarkov commented Dec 6, 2024

The very same issue arises on ubuntu 24.04 with recent esp-idf: ESP-IDF v5.1.5-282-g77a3025ac1-dirty toolchain: xtensa-esp-elf/esp-14.2.0_20240906

...
/home/ubuntu/.rustup/toolchains/esp/xtensa-esp-elf/esp-14.2.0_20240906/xtensa-esp-elf/bin/xtensa-esp32-elf-gcc -DESP_PLATFORM -DIDF_VER=\"v5.1.5-282-g77a3025ac1\" -DSOC_MMU_PAGE_SIZE=CONFIG_MMU_PAGE_SIZE -D_GNU_SOURCE -D_POSIX_READER_WRITER_LOCKS -I/home/ubuntu/project/examples/c-examples/ex/build/config -I/home/ubuntu/esp-idf/components/newlib/platform_include -I/home/ubuntu/esp-idf/components/newlib/priv_include -I/home/ubuntu/esp-idf/components/freertos/FreeRTOS-Kernel/include -I/home/ubuntu/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include -I/home/ubuntu/esp-idf/components/freertos/esp_additions/include/freertos -I/home/ubuntu/esp-idf/components/freertos/esp_additions/include -I/home/ubuntu/esp-idf/components/freertos/esp_additions/arch/xtensa/include -I/home/ubuntu/esp-idf/components/esp_hw_support/include -I/home/ubuntu/esp-idf/components/esp_hw_support/include/soc -I/home/ubuntu/esp-idf/components/esp_hw_support/include/soc/esp32 -I/home/ubuntu/esp-idf/components/esp_hw_support/port/esp32/. -I/home/ubuntu/esp-idf/components/heap/include -I/home/ubuntu/esp-idf/components/log/include -I/home/ubuntu/esp-idf/components/soc/include -I/home/ubuntu/esp-idf/components/soc/esp32 -I/home/ubuntu/esp-idf/components/soc/esp32/include -I/home/ubuntu/esp-idf/components/hal/esp32/include -I/home/ubuntu/esp-idf/components/hal/include -I/home/ubuntu/esp-idf/components/hal/platform_port/include -I/home/ubuntu/esp-idf/components/esp_rom/include -I/home/ubuntu/esp-idf/components/esp_rom/include/esp32 -I/home/ubuntu/esp-idf/components/esp_rom/esp32 -I/home/ubuntu/esp-idf/components/esp_common/include -I/home/ubuntu/esp-idf/components/esp_system/include -I/home/ubuntu/esp-idf/components/esp_system/port/soc -I/home/ubuntu/esp-idf/components/esp_system/port/include/private -I/home/ubuntu/esp-idf/components/xtensa/include -I/home/ubuntu/esp-idf/components/xtensa/esp32/include -I/home/ubuntu/esp-idf/components/lwip/include -I/home/ubuntu/esp-idf/components/lwip/include/apps -I/home/ubuntu/esp-idf/components/lwip/include/apps/sntp -I/home/ubuntu/esp-idf/components/lwip/lwip/src/include -I/home/ubuntu/esp-idf/components/lwip/port/include -I/home/ubuntu/esp-idf/components/lwip/port/freertos/include -I/home/ubuntu/esp-idf/components/lwip/port/esp32xx/include -I/home/ubuntu/esp-idf/components/lwip/port/esp32xx/include/arch -I/home/ubuntu/esp-idf/components/spi_flash/include -mlongcalls -Wno-frame-address  -fdiagnostics-color=always -ffunction-sections -fdata-sections -Wall -Werror=all -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=unused-but-set-variable -Wno-error=deprecated-declarations -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-enum-conversion -gdwarf-4 -ggdb -Og -fmacro-prefix-map=/home/ubuntu/project/examples/c-examples/ex=. -fmacro-prefix-map=/home/ubuntu/esp-idf=/IDF -fstrict-volatile-bitfields -fno-jump-tables -fno-tree-switch-conversion -DconfigENABLE_FREERTOS_DEBUG_OCDAWARE=1 -std=gnu17 -Wno-old-style-declaration -MD -MT esp-idf/newlib/CMakeFiles/__idf_newlib.dir/reent_init.c.obj -MF CMakeFiles/__idf_newlib.dir/reent_init.c.obj.d -o CMakeFiles/__idf_newlib.dir/reent_init.c.obj -c /home/ubuntu/esp-idf/components/newlib/reent_init.c

/home/ubuntu/esp-idf/components/newlib/reent_init.c:29:6: error: 'struct _reent' has no member named '__sdidinit'
   29 |     r->__sdidinit = 1;
      |      ^~
/home/ubuntu/esp-idf/components/newlib/reent_init.c:30:6: error: 'struct _reent' has no member named '__sglue'
   30 |     r->__sglue._next = NULL;
      |      ^~
/home/ubuntu/esp-idf/components/newlib/reent_init.c:31:6: error: 'struct _reent' has no member named '__sglue'
   31 |     r->__sglue._niobs = 0;
      |      ^~
/home/ubuntu/esp-idf/components/newlib/reent_init.c:32:6: error: 'struct _reent' has no member named '__sglue'
   32 |     r->__sglue._iobs = NULL;
      |      ^~
/home/ubuntu/esp-idf/components/newlib/reent_init.c: In function 'esp_reent_cleanup':
/home/ubuntu/esp-idf/components/newlib/reent_init.c:60:40: error: 'struct _reent' has no member named '__sglue'
   60 |     struct _glue* prev = &_GLOBAL_REENT->__sglue;
      |                                        ^~
/home/ubuntu/esp-idf/components/newlib/reent_init.c:61:43: error: 'struct _reent' has no member named '__sglue'
   61 |     for (struct _glue* cur = _GLOBAL_REENT->__sglue._next; cur != NULL;) {
      |                                           ^~
make[2]: *** [esp-idf/newlib/CMakeFiles/__idf_newlib.dir/build.make:174: esp-idf/newlib/CMakeFiles/__idf_newlib.dir/reent_init.c.obj] Error 1

Please follow carefully the installation steps described in the README, and don't do extra stuff which is not documented there and which increases the chances to make a mistake. In particular:

  • Do NOT install / activate ESP IDF yourself. At least not until you have a buildable firmware following the standard procedure first. (The build will auto-download and auto-install everything ESP-IDF-related for you in a private folder. You can - later - customize the private folder location etc. etc.)
  • Do NOT pollute your environment with extra variables. For now. Avoid IDF_PATH. Do not even run . ~/export_esp.sh from espup as it is not necessary at all on Ubuntu. The build will find everything it needs automatically.
  • Install everything else requested on that page.

Problematic things in your log:

  • You are using your own (activated?) ESP IDF (/home/ubuntu/esp-idf/). This is possible, but advanced. Folks routinely make mistakes with it, by forgetting to recurse submodules when cloning, or leaving it at an unsupported version (master)
  • You are (weird how you managed?) using the espup-supplied GCC xtensa toolchain ( /home/ubuntu/.rustup/toolchains/esp/xtensa-esp-elf/esp-14.2.0_20240906/xtensa-esp-elf/bin/xtensa-esp32-elf-gcc) and not the one corresponding to the exact ESP IDF which is in use. Every ESP IDF version comes with its own, exact GCC toolchain version that needs to be used. The build - unless you pollute it with extra environment variables - takes care of this as well, by first automatically cloning the ESP IDF git repo in the private folder, switching to the version (git tag) you requested with the template and then automatically downloading and unpacking all toolchains required for this exact ESP IDF version (without you needing to call the ESP IDF install.sh script or suchlike)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

4 participants