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

esp-idf-sys build started fail on arm mac os #287

Open
mbv opened this issue Feb 21, 2024 · 20 comments
Open

esp-idf-sys build started fail on arm mac os #287

mbv opened this issue Feb 21, 2024 · 20 comments

Comments

@mbv
Copy link

mbv commented Feb 21, 2024

esp-idf-sys build started fail on arm mac os

esp-idf-sys v0.34.0
target esp32

Log
        Fresh core v0.0.0 (/Users/mbv/.rustup/toolchains/esp/lib/rustlib/src/rust/library/core)
       Fresh unicode-ident v1.0.12
       Fresh memchr v2.7.1
       Fresh rustc-std-workspace-core v1.99.0 (/Users/mbv/.rustup/toolchains/esp/lib/rustlib/src/rust/library/rustc-std-workspace-core)
       Fresh aho-corasick v1.1.2
       Fresh regex-syntax v0.8.2
       Fresh compiler_builtins v0.1.103
       Fresh libc v0.2.150
       Fresh proc-macro2 v1.0.78
       Fresh regex-automata v0.4.5
       Fresh bitflags v1.3.2
       Fresh alloc v0.0.0 (/Users/mbv/.rustup/toolchains/esp/lib/rustlib/src/rust/library/alloc)
       Fresh adler v1.0.2
       Fresh memchr v2.5.0
       Fresh quote v1.0.35
       Fresh rustc-demangle v0.1.23
       Fresh glob v0.3.1
       Fresh errno v0.3.8
       Fresh crossbeam-utils v0.8.19
       Fresh rustc-std-workspace-alloc v1.99.0 (/Users/mbv/.rustup/toolchains/esp/lib/rustlib/src/rust/library/rustc-std-workspace-alloc)
       Fresh unwind v0.0.0 (/Users/mbv/.rustup/toolchains/esp/lib/rustlib/src/rust/library/unwind)
       Fresh panic_abort v0.0.0 (/Users/mbv/.rustup/toolchains/esp/lib/rustlib/src/rust/library/panic_abort)
       Fresh syn v2.0.50
       Fresh bitflags v2.4.2
       Fresh syn v1.0.109
       Fresh gimli v0.28.0
       Fresh miniz_oxide v0.7.1
       Fresh hashbrown v0.14.3
       Fresh std_detect v0.1.5 (/Users/mbv/.rustup/toolchains/esp/lib/rustlib/src/rust/library/stdarch/crates/std_detect)
       Fresh object v0.32.1
       Fresh panic_unwind v0.0.0 (/Users/mbv/.rustup/toolchains/esp/lib/rustlib/src/rust/library/panic_unwind)
       Fresh serde_derive v1.0.197
       Fresh rustix v0.38.31
       Fresh addr2line v0.21.0
       Fresh crossbeam-epoch v0.9.18
       Fresh bstr v1.9.0
       Fresh same-file v1.0.6
       Fresh minimal-lexical v0.2.1
       Fresh rustversion v1.0.14
       Fresh thiserror-impl v1.0.57
       Fresh std v0.0.0 (/Users/mbv/.rustup/toolchains/esp/lib/rustlib/src/rust/library/std)
       Fresh globset v0.4.14
       Fresh crossbeam-deque v0.8.5
       Fresh walkdir v2.4.0
       Fresh nom v7.1.3
       Fresh nix v0.26.4
       Fresh cvt v0.1.2
       Fresh libloading v0.8.1
       Fresh proc_macro v0.0.0 (/Users/mbv/.rustup/toolchains/esp/lib/rustlib/src/rust/library/proc_macro)
       Fresh home v0.5.9
       Fresh ryu v1.0.17
       Fresh heck v0.4.1
       Fresh lazy_static v1.4.0
       Fresh itoa v1.0.10
       Fresh either v1.10.0
       Fresh thiserror v1.0.57
       Fresh which v4.4.2
       Fresh serde_json v1.0.114
       Fresh strum_macros v0.24.3
       Fresh clang-sys v1.7.0
       Fresh fs_at v0.1.10
       Fresh cexpr v0.6.0
       Fresh ignore v0.4.22
       Fresh regex v1.10.3
       Fresh lazycell v1.3.0
       Fresh cc v1.0.86
       Fresh shlex v1.3.0
       Fresh peeking_take_while v0.1.2
       Fresh normpath v1.2.0
       Fresh fastrand v2.0.1
       Fresh rustc-hash v1.1.0
       Fresh anyhow v1.0.80
       Fresh strum v0.24.1
       Fresh globwalk v0.8.1
       Fresh remove_dir_all v0.8.2
       Fresh cmake v0.1.50
       Fresh bindgen v0.63.0
       Fresh tempfile v3.10.0
       Fresh filetime v0.2.23
       Fresh cargo-platform v0.1.7
       Fresh envy v0.4.2
       Fresh fnv v1.0.7
       Fresh embuild v0.31.4
       Fresh ident_case v1.0.1
       Fresh autocfg v1.1.0
       Fresh byteorder v1.5.0
       Fresh nb v1.1.0
       Fresh core-foundation-sys v0.8.6
       Fresh semver v1.0.22
       Fresh camino v1.1.6
       Fresh darling_core v0.20.6
       Fresh iana-time-zone v0.1.60
       Fresh hash32 v0.3.1
       Fresh stable_deref_trait v1.2.0
       Fresh cargo_metadata v0.18.1
       Fresh darling_macro v0.20.6
       Fresh embedded-io v0.6.1
       Fresh unicode-xid v0.2.4
       Fresh heapless v0.8.0
       Fresh pin-project-lite v0.2.13
       Fresh futures-task v0.3.30
       Fresh num-traits v0.2.18
       Fresh darling v0.20.6
       Fresh embedded-io-async v0.6.1
       Fresh const_format_proc_macros v0.2.32
       Fresh embedded-hal v1.0.0
       Fresh futures-core v0.3.30
       Fresh pin-utils v0.1.0
   Compiling esp-idf-sys v0.34.0
       Fresh chrono v0.4.34
       Fresh enumset_derive v0.8.1
       Fresh once_cell v1.19.0
       Fresh version_check v0.9.4
       Fresh libc v0.2.153
       Fresh const_format v0.2.32
     Running `CARGO=/Users/mbv/.rustup/toolchains/esp/bin/cargo CARGO_CFG_ESPIDF_TIME64='' CARGO_CFG_OVERFLOW_CHECKS='' CARGO_CFG_PANIC=abort CARGO_CFG_RELOCATION_MODEL=static CARGO_CFG_TARGET_ABI='' CARGO_CFG_TARGET_ARCH=xtensa CARGO_CFG_TARGET_ENDIAN=little CARGO_CFG_TARGET_ENV=newlib CARGO_CFG_TARGET_FAMILY=unix CARGO_CFG_TARGET_HAS_ATOMIC=16,32,8,ptr CARGO_CFG_TARGET_HAS_ATOMIC_EQUAL_ALIGNMENT=16,32,8,ptr CARGO_CFG_TARGET_HAS_ATOMIC_LOAD_STORE=16,32,8,ptr CARGO_CFG_TARGET_OS=espidf CARGO_CFG_TARGET_POINTER_WIDTH=32 CARGO_CFG_TARGET_VENDOR=espressif CARGO_CFG_UNIX='' CARGO_ENCODED_RUSTFLAGS='--cfgespidf_time64' CARGO_FEATURE_BINSTART=1 CARGO_FEATURE_NATIVE=1 CARGO_FEATURE_STD=1 CARGO_MANIFEST_DIR=/Users/mbv/.cargo/registry/src/index.crates.io-6f17d22bba15001f/esp-idf-sys-0.34.0 CARGO_MANIFEST_LINKS=esp_idf CARGO_PKG_AUTHORS='Alexey Arbuzov <aarbuzov@termt.com>:sapir <yasapir@gmail.com>:Ivan Markov <ivan.markov@gmail.com>:Dominik Gschwind <dominik.gschwind99@gmail.com>' CARGO_PKG_DESCRIPTION='Bindings for ESP-IDF (Espressif'\''s IoT Development Framework)' CARGO_PKG_HOMEPAGE='' CARGO_PKG_LICENSE='MIT OR Apache-2.0' CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=esp-idf-sys CARGO_PKG_README=README.md CARGO_PKG_REPOSITORY='https://github.com/esp-rs/esp-idf-sys' CARGO_PKG_RUST_VERSION=1.66 CARGO_PKG_VERSION=0.34.0 CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=34 CARGO_PKG_VERSION_PATCH=0 CARGO_PKG_VERSION_PRE='' DEBUG=true DEP_COMPILER_RT_COMPILER_RT=/Users/mbv/.cargo/registry/src/index.crates.io-6f17d22bba15001f/compiler_builtins-0.1.103/compiler-rt DYLD_FALLBACK_LIBRARY_PATH='/Users/mbv/test-build-app/target/debug/deps:/Users/mbv/test-build-app/target/debug:/Users/mbv/.rustup/toolchains/esp/lib:/Users/mbv/lib:/usr/local/lib:/usr/lib' ESP_IDF_VERSION=v5.1.2 HOST=aarch64-apple-darwin MCU=esp32 NUM_JOBS=10 OPT_LEVEL=z OUT_DIR=/Users/mbv/test-build-app/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-cdeb9cbd12aa4ef9/out PROFILE=debug RUSTC=/Users/mbv/.rustup/toolchains/esp/bin/rustc RUSTC_LINKER=ldproxy RUSTDOC=/Users/mbv/.rustup/toolchains/esp/bin/rustdoc TARGET=xtensa-esp32-espidf /Users/mbv/test-build-app/target/debug/build/esp-idf-sys-ef9aa1591ed6faa4/build-script-build`
       Fresh build-time v0.1.3
       Fresh enumset v1.1.3
       Fresh futures-util v0.3.30
       Fresh nb v0.1.3
       Fresh cfg-if v1.0.0
       Fresh critical-section v1.1.2
       Fresh void v1.0.2
       Fresh num_enum_derive v0.7.2
       Fresh litrs v0.4.1
       Fresh serde v1.0.197
       Fresh embedded-hal-async v1.0.0
       Fresh embedded-hal-nb v1.0.0
       Fresh embassy-sync v0.5.0
       Fresh embedded-hal v0.2.7
       Fresh document-features v0.2.8
       Fresh num_enum v0.7.2
       Fresh embedded-can v0.4.1
       Fresh log v0.4.20
       Fresh atomic-waker v1.1.2
       Fresh no-std-net v0.5.0
       Fresh uncased v0.9.10
       Fresh embedded-svc v0.27.0
       Fresh embassy-time-driver v0.1.0
       Fresh embassy-futures v0.1.1
[esp-idf-sys 0.34.0] cargo:rerun-if-env-changed=ESP_IDF_TOOLS_INSTALL_DIR
[esp-idf-sys 0.34.0] cargo:rerun-if-env-changed=ESP_IDF_SDKCONFIG
[esp-idf-sys 0.34.0] cargo:rerun-if-env-changed=ESP_IDF_SDKCONFIG_DEFAULTS
[esp-idf-sys 0.34.0] cargo:rerun-if-env-changed=MCU
[esp-idf-sys 0.34.0] cargo:rerun-if-env-changed=ESP_IDF_SYS_ROOT_CRATE
[esp-idf-sys 0.34.0] cargo:rerun-if-env-changed=ESP_IDF_VERSION
[esp-idf-sys 0.34.0] cargo:rerun-if-env-changed=ESP_IDF_REPOSITORY
[esp-idf-sys 0.34.0] cargo:rerun-if-env-changed=ESP_IDF_CMAKE_GENERATOR
[esp-idf-sys 0.34.0] cargo:rerun-if-env-changed=IDF_PATH
[esp-idf-sys 0.34.0] cargo:rerun-if-env-changed=EXTRA-COMPONENTS
[esp-idf-sys 0.34.0] cargo:rerun-if-env-changed=ESP_IDF_COMPONENTS
[esp-idf-sys 0.34.0] cargo:rerun-if-env-changed=ESP_IDF_COMPONENT_MANAGER
[esp-idf-sys 0.34.0] Build configuration: BuildConfig {
[esp-idf-sys 0.34.0]     esp_idf_tools_install_dir: None,
[esp-idf-sys 0.34.0]     esp_idf_sdkconfig: None,
[esp-idf-sys 0.34.0]     esp_idf_sdkconfig_defaults: None,
[esp-idf-sys 0.34.0]     mcu: Some(
[esp-idf-sys 0.34.0]         "esp32",
[esp-idf-sys 0.34.0]     ),
[esp-idf-sys 0.34.0]     native: NativeConfig {
[esp-idf-sys 0.34.0]         esp_idf_version: Some(
[esp-idf-sys 0.34.0]             Tag(
[esp-idf-sys 0.34.0]                 "v5.1.2",
[esp-idf-sys 0.34.0]             ),
[esp-idf-sys 0.34.0]         ),
[esp-idf-sys 0.34.0]         esp_idf_repository: None,
[esp-idf-sys 0.34.0]         esp_idf_cmake_generator: None,
[esp-idf-sys 0.34.0]         idf_path: None,
[esp-idf-sys 0.34.0]         extra_components: [],
[esp-idf-sys 0.34.0]         esp_idf_components: None,
[esp-idf-sys 0.34.0]         esp_idf_component_manager: None,
[esp-idf-sys 0.34.0]     },
[esp-idf-sys 0.34.0]     esp_idf_sys_root_crate: None,
[esp-idf-sys 0.34.0] }
[esp-idf-sys 0.34.0] Using managed esp-idf repository: RemoteSdk { repo_url: None, git_ref: Tag("v5.1.2") }
[esp-idf-sys 0.34.0] IDF_PYTHON_ENV_PATH=/Users/mbv/test-build-app/.embuild/espressif/python_env/idf5.1_py3.11_env
[esp-idf-sys 0.34.0] ESP_IDF_VERSION=5.1
[esp-idf-sys 0.34.0] PATH=/Users/mbv/test-build-app/.embuild/espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin:/Users/mbv/test-build-app/.embuild/espressif/tools/esp32ulp-elf/2.35_20220830/esp32ulp-elf/bin:/Users/mbv/test-build-app/.embuild/espressif/tools/cmake/3.24.0/CMake.app/Contents/bin:/Users/mbv/test-build-app/.embuild/espressif/tools/ninja/1.10.2/:/Users/mbv/test-build-app/.embuild/espressif/python_env/idf5.1_py3.11_env/bin:/Users/mbv/test-build-app/.embuild/espressif/esp-idf/v5.1.2/tools:$PATH
[esp-idf-sys 0.34.0] IDF_DEACTIVATE_FILE_PATH=/var/folders/39/b03f2bzn459884t0zhqnj91m0000gn/T/tmpk2ijz55bidf_38495
[esp-idf-sys 0.34.0] Using esp-idf v5.1.2 at '/Users/mbv/test-build-app/.embuild/espressif/esp-idf/v5.1.2'
[esp-idf-sys 0.34.0] Current system platform: macos-arm64
[esp-idf-sys 0.34.0] Skipping xtensa-esp32-elf@esp-12.2.0_20230208 (already installed)
[esp-idf-sys 0.34.0] Skipping cmake@3.24.0 (already installed)
[esp-idf-sys 0.34.0] Skipping ninja@1.10.2 (already installed)
[esp-idf-sys 0.34.0] Skipping esp32ulp-elf@2.35_20220830 (already installed)
[esp-idf-sys 0.34.0] IDF_PYTHON_ENV_PATH=/Users/mbv/test-build-app/.embuild/espressif/python_env/idf5.1_py3.11_env
[esp-idf-sys 0.34.0] ESP_IDF_VERSION=5.1
[esp-idf-sys 0.34.0] PATH=/Users/mbv/test-build-app/.embuild/espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin:/Users/mbv/test-build-app/.embuild/espressif/tools/esp32ulp-elf/2.35_20220830/esp32ulp-elf/bin:/Users/mbv/test-build-app/.embuild/espressif/tools/cmake/3.24.0/CMake.app/Contents/bin:/Users/mbv/test-build-app/.embuild/espressif/tools/ninja/1.10.2/:/Users/mbv/test-build-app/.embuild/espressif/python_env/idf5.1_py3.11_env/bin:/Users/mbv/test-build-app/.embuild/espressif/esp-idf/v5.1.2/tools:$PATH
[esp-idf-sys 0.34.0] IDF_DEACTIVATE_FILE_PATH=/var/folders/39/b03f2bzn459884t0zhqnj91m0000gn/T/tmpju5nljghidf_38495
[esp-idf-sys 0.34.0] cargo:rerun-if-changed=/Users/mbv/test-build-app/sdkconfig.defaults
[esp-idf-sys 0.34.0] running: "cc" "--version"
[esp-idf-sys 0.34.0] exit status: 0
[esp-idf-sys 0.34.0] running: "c++" "--version"
[esp-idf-sys 0.34.0] exit status: 0
[esp-idf-sys 0.34.0] CMAKE_PREFIX_PATH_xtensa-esp32-espidf = None
[esp-idf-sys 0.34.0] CMAKE_PREFIX_PATH_xtensa_esp32_espidf = None
[esp-idf-sys 0.34.0] TARGET_CMAKE_PREFIX_PATH = None
[esp-idf-sys 0.34.0] CMAKE_PREFIX_PATH = None
[esp-idf-sys 0.34.0] CMAKE_xtensa-esp32-espidf = None
[esp-idf-sys 0.34.0] CMAKE_xtensa_esp32_espidf = None
[esp-idf-sys 0.34.0] TARGET_CMAKE = None
[esp-idf-sys 0.34.0] CMAKE = None
[esp-idf-sys 0.34.0] running: cd "/Users/mbv/test-build-app/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-cdeb9cbd12aa4ef9/out/build" && CMAKE_PREFIX_PATH="" EXTRA_COMPONENT_DIRS="" IDF_COMPONENT_MANAGER="1" IDF_PATH="/Users/mbv/test-build-app/.embuild/espressif/esp-idf/v5.1.2" IDF_TARGET="esp32" IDF_TOOLS_PATH="/Users/mbv/test-build-app/.embuild/espressif" PATH="/Users/mbv/test-build-app/.embuild/espressif/tools/esp32ulp-elf/2.35_20220830/esp32ulp-elf/bin:/Users/mbv/test-build-app/.embuild/espressif/tools/cmake/3.24.0/CMake.app/Contents/bin:/Users/mbv/test-build-app/.embuild/espressif/esp-idf/v5.1.2/tools:/Users/mbv/test-build-app/.embuild/espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin:/Users/mbv/test-build-app/.embuild/espressif/tools/ninja/1.10.2/:/Users/mbv/test-build-app/.embuild/espressif/python_env/idf5.1_py3.11_env/bin:/Users/mbv/.rustup/toolchains/esp/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin:/Users/mbv/.cargo/bin:/Users/mbv/.nvm/versions/node/v21.5.0/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/usr/local/share/dotnet:~/.dotnet/tools:/Users/mbv/.cargo/bin:/Users/mbv/.orbstack/bin" PROJECT_DIR="/Users/mbv/test-build-app" SDKCONFIG_DEFAULTS="/Users/mbv/test-build-app/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-cdeb9cbd12aa4ef9/out/gen-sdkconfig.defaults;/Users/mbv/test-build-app/sdkconfig.defaults" "cmake" "/Users/mbv/test-build-app/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-cdeb9cbd12aa4ef9/out" "-G" "Ninja" "-DCMAKE_TOOLCHAIN_FILE=/Users/mbv/test-build-app/.embuild/espressif/esp-idf/v5.1.2/tools/cmake/toolchain-esp32.cmake" "-DCMAKE_BUILD_TYPE=" "-DPYTHON=/Users/mbv/test-build-app/.embuild/espressif/python_env/idf5.1_py3.11_env/bin/python" "-DCMAKE_INSTALL_PREFIX=/Users/mbv/test-build-app/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-cdeb9cbd12aa4ef9/out" "-DCMAKE_C_FLAGS= -mlongcalls -Wno-frame-address -ffunction-sections -fdata-sections --target=xtensa-esp32-espidf" "-DCMAKE_CXX_FLAGS= -mlongcalls -Wno-frame-address -ffunction-sections -fdata-sections --target=xtensa-esp32-espidf" "-DCMAKE_ASM_FLAGS= -mlongcalls -ffunction-sections -fdata-sections --target=xtensa-esp32-espidf"
[esp-idf-sys 0.34.0] -- The C compiler identification is GNU 12.2.0
[esp-idf-sys 0.34.0] -- The CXX compiler identification is GNU 12.2.0
[esp-idf-sys 0.34.0] -- The ASM compiler identification is GNU
[esp-idf-sys 0.34.0] -- Found assembler: /Users/mbv/test-build-app/.embuild/espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc
[esp-idf-sys 0.34.0] -- Detecting C compiler ABI info
[esp-idf-sys 0.34.0] -- Detecting C compiler ABI info - failed
[esp-idf-sys 0.34.0] -- Check for working C compiler: /Users/mbv/test-build-app/.embuild/espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc
[esp-idf-sys 0.34.0] -- Check for working C compiler: /Users/mbv/test-build-app/.embuild/espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc - broken
[esp-idf-sys 0.34.0] CMake Error at /Users/mbv/test-build-app/.embuild/espressif/tools/cmake/3.24.0/CMake.app/Contents/share/cmake-3.24/Modules/CMakeTestCCompiler.cmake:69 (message):
[esp-idf-sys 0.34.0]   The C compiler
[esp-idf-sys 0.34.0] 
[esp-idf-sys 0.34.0]     "/Users/mbv/test-build-app/.embuild/espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc"
[esp-idf-sys 0.34.0] 
[esp-idf-sys 0.34.0]   is not able to compile a simple test program.
[esp-idf-sys 0.34.0] 
[esp-idf-sys 0.34.0]   It fails with the following output:
[esp-idf-sys 0.34.0] 
[esp-idf-sys 0.34.0]     Change Dir: /Users/mbv/test-build-app/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-cdeb9cbd12aa4ef9/out/build/CMakeFiles/CMakeTmp
[esp-idf-sys 0.34.0]     
[esp-idf-sys 0.34.0]     Run Build Command(s):/Users/mbv/test-build-app/.embuild/espressif/tools/ninja/1.10.2/ninja cmTC_4bab5 && [1/2] Building C object CMakeFiles/cmTC_4bab5.dir/testCCompiler.c.obj
[esp-idf-sys 0.34.0]     FAILED: CMakeFiles/cmTC_4bab5.dir/testCCompiler.c.obj 
[esp-idf-sys 0.34.0]     /Users/mbv/test-build-app/.embuild/espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc   -mlongcalls -Wno-frame-address  -ffunction-sections -fdata-sections --target=xtensa-esp32-espidf -o CMakeFiles/cmTC_4bab5.dir/testCCompiler.c.obj -c /Users/mbv/test-build-app/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-cdeb9cbd12aa4ef9/out/build/CMakeFiles/CMakeTmp/testCCompiler.c
[esp-idf-sys 0.34.0]     xtensa-esp32-elf-gcc: error: unrecognized command-line option '--target=xtensa-esp32-espidf'
[esp-idf-sys 0.34.0]     ninja: build stopped: subcommand failed.
[esp-idf-sys 0.34.0]     
[esp-idf-sys 0.34.0]     
[esp-idf-sys 0.34.0] 
[esp-idf-sys 0.34.0]   
[esp-idf-sys 0.34.0] 
[esp-idf-sys 0.34.0]   CMake will not be able to correctly generate this project.
[esp-idf-sys 0.34.0] Call Stack (most recent call first):
[esp-idf-sys 0.34.0]   /Users/mbv/test-build-app/.embuild/espressif/esp-idf/v5.1.2/tools/cmake/project.cmake:448 (__project)
[esp-idf-sys 0.34.0]   CMakeLists.txt:28 (project)
[esp-idf-sys 0.34.0] 
[esp-idf-sys 0.34.0] 
[esp-idf-sys 0.34.0] -- Configuring incomplete, errors occurred!
[esp-idf-sys 0.34.0] See also "/Users/mbv/test-build-app/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-cdeb9cbd12aa4ef9/out/build/CMakeFiles/CMakeOutput.log".
[esp-idf-sys 0.34.0] See also "/Users/mbv/test-build-app/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-cdeb9cbd12aa4ef9/out/build/CMakeFiles/CMakeError.log".
[esp-idf-sys 0.34.0] thread 'main' panicked at /Users/mbv/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cmake-0.1.50/src/lib.rs:1098:5:
[esp-idf-sys 0.34.0] 
[esp-idf-sys 0.34.0] command did not execute successfully, got: exit status: 1
[esp-idf-sys 0.34.0] 
[esp-idf-sys 0.34.0] build script failed, must exit now
[esp-idf-sys 0.34.0] note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: failed to run custom build command for `esp-idf-sys v0.34.0`

Caused by:
  process didn't exit successfully: `CARGO=/Users/mbv/.rustup/toolchains/esp/bin/cargo CARGO_CFG_ESPIDF_TIME64='' CARGO_CFG_OVERFLOW_CHECKS='' CARGO_CFG_PANIC=abort CARGO_CFG_RELOCATION_MODEL=static CARGO_CFG_TARGET_ABI='' CARGO_CFG_TARGET_ARCH=xtensa CARGO_CFG_TARGET_ENDIAN=little CARGO_CFG_TARGET_ENV=newlib CARGO_CFG_TARGET_FAMILY=unix CARGO_CFG_TARGET_HAS_ATOMIC=16,32,8,ptr CARGO_CFG_TARGET_HAS_ATOMIC_EQUAL_ALIGNMENT=16,32,8,ptr CARGO_CFG_TARGET_HAS_ATOMIC_LOAD_STORE=16,32,8,ptr CARGO_CFG_TARGET_OS=espidf CARGO_CFG_TARGET_POINTER_WIDTH=32 CARGO_CFG_TARGET_VENDOR=espressif CARGO_CFG_UNIX='' CARGO_ENCODED_RUSTFLAGS='--cfgespidf_time64' CARGO_FEATURE_BINSTART=1 CARGO_FEATURE_NATIVE=1 CARGO_FEATURE_STD=1 CARGO_MANIFEST_DIR=/Users/mbv/.cargo/registry/src/index.crates.io-6f17d22bba15001f/esp-idf-sys-0.34.0 CARGO_MANIFEST_LINKS=esp_idf CARGO_PKG_AUTHORS='Alexey Arbuzov <aarbuzov@termt.com>:sapir <yasapir@gmail.com>:Ivan Markov <ivan.markov@gmail.com>:Dominik Gschwind <dominik.gschwind99@gmail.com>' CARGO_PKG_DESCRIPTION='Bindings for ESP-IDF (Espressif'\''s IoT Development Framework)' CARGO_PKG_HOMEPAGE='' CARGO_PKG_LICENSE='MIT OR Apache-2.0' CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=esp-idf-sys CARGO_PKG_README=README.md CARGO_PKG_REPOSITORY='https://github.com/esp-rs/esp-idf-sys' CARGO_PKG_RUST_VERSION=1.66 CARGO_PKG_VERSION=0.34.0 CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=34 CARGO_PKG_VERSION_PATCH=0 CARGO_PKG_VERSION_PRE='' DEBUG=true DEP_COMPILER_RT_COMPILER_RT=/Users/mbv/.cargo/registry/src/index.crates.io-6f17d22bba15001f/compiler_builtins-0.1.103/compiler-rt DYLD_FALLBACK_LIBRARY_PATH='/Users/mbv/test-build-app/target/debug/deps:/Users/mbv/test-build-app/target/debug:/Users/mbv/.rustup/toolchains/esp/lib:/Users/mbv/lib:/usr/local/lib:/usr/lib' ESP_IDF_VERSION=v5.1.2 HOST=aarch64-apple-darwin MCU=esp32 NUM_JOBS=10 OPT_LEVEL=z OUT_DIR=/Users/mbv/test-build-app/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-cdeb9cbd12aa4ef9/out PROFILE=debug RUSTC=/Users/mbv/.rustup/toolchains/esp/bin/rustc RUSTC_LINKER=ldproxy RUSTDOC=/Users/mbv/.rustup/toolchains/esp/bin/rustdoc TARGET=xtensa-esp32-espidf /Users/mbv/test-build-app/target/debug/build/esp-idf-sys-ef9aa1591ed6faa4/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=ESP_IDF_TOOLS_INSTALL_DIR
  cargo:rerun-if-env-changed=ESP_IDF_SDKCONFIG
  cargo:rerun-if-env-changed=ESP_IDF_SDKCONFIG_DEFAULTS
  cargo:rerun-if-env-changed=MCU
  cargo:rerun-if-env-changed=ESP_IDF_SYS_ROOT_CRATE
  cargo:rerun-if-env-changed=ESP_IDF_VERSION
  cargo:rerun-if-env-changed=ESP_IDF_REPOSITORY
  cargo:rerun-if-env-changed=ESP_IDF_CMAKE_GENERATOR
  cargo:rerun-if-env-changed=IDF_PATH
  cargo:rerun-if-env-changed=EXTRA-COMPONENTS
  cargo:rerun-if-env-changed=ESP_IDF_COMPONENTS
  cargo:rerun-if-env-changed=ESP_IDF_COMPONENT_MANAGER
  IDF_PYTHON_ENV_PATH=/Users/mbv/test-build-app/.embuild/espressif/python_env/idf5.1_py3.11_env
  ESP_IDF_VERSION=5.1
  PATH=/Users/mbv/test-build-app/.embuild/espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin:/Users/mbv/test-build-app/.embuild/espressif/tools/esp32ulp-elf/2.35_20220830/esp32ulp-elf/bin:/Users/mbv/test-build-app/.embuild/espressif/tools/cmake/3.24.0/CMake.app/Contents/bin:/Users/mbv/test-build-app/.embuild/espressif/tools/ninja/1.10.2/:/Users/mbv/test-build-app/.embuild/espressif/python_env/idf5.1_py3.11_env/bin:/Users/mbv/test-build-app/.embuild/espressif/esp-idf/v5.1.2/tools:$PATH
  IDF_DEACTIVATE_FILE_PATH=/var/folders/39/b03f2bzn459884t0zhqnj91m0000gn/T/tmpk2ijz55bidf_38495
  Current system platform: macos-arm64
  Skipping xtensa-esp32-elf@esp-12.2.0_20230208 (already installed)
  Skipping cmake@3.24.0 (already installed)
  Skipping ninja@1.10.2 (already installed)
  Skipping esp32ulp-elf@2.35_20220830 (already installed)
  IDF_PYTHON_ENV_PATH=/Users/mbv/test-build-app/.embuild/espressif/python_env/idf5.1_py3.11_env
  ESP_IDF_VERSION=5.1
  PATH=/Users/mbv/test-build-app/.embuild/espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin:/Users/mbv/test-build-app/.embuild/espressif/tools/esp32ulp-elf/2.35_20220830/esp32ulp-elf/bin:/Users/mbv/test-build-app/.embuild/espressif/tools/cmake/3.24.0/CMake.app/Contents/bin:/Users/mbv/test-build-app/.embuild/espressif/tools/ninja/1.10.2/:/Users/mbv/test-build-app/.embuild/espressif/python_env/idf5.1_py3.11_env/bin:/Users/mbv/test-build-app/.embuild/espressif/esp-idf/v5.1.2/tools:$PATH
  IDF_DEACTIVATE_FILE_PATH=/var/folders/39/b03f2bzn459884t0zhqnj91m0000gn/T/tmpju5nljghidf_38495
  cargo:rerun-if-changed=/Users/mbv/test-build-app/sdkconfig.defaults
  running: "cc" "--version"
  exit status: 0
  running: "c++" "--version"
  exit status: 0
  CMAKE_PREFIX_PATH_xtensa-esp32-espidf = None
  CMAKE_PREFIX_PATH_xtensa_esp32_espidf = None
  TARGET_CMAKE_PREFIX_PATH = None
  CMAKE_PREFIX_PATH = None
  CMAKE_xtensa-esp32-espidf = None
  CMAKE_xtensa_esp32_espidf = None
  TARGET_CMAKE = None
  CMAKE = None
  running: cd "/Users/mbv/test-build-app/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-cdeb9cbd12aa4ef9/out/build" && CMAKE_PREFIX_PATH="" EXTRA_COMPONENT_DIRS="" IDF_COMPONENT_MANAGER="1" IDF_PATH="/Users/mbv/test-build-app/.embuild/espressif/esp-idf/v5.1.2" IDF_TARGET="esp32" IDF_TOOLS_PATH="/Users/mbv/test-build-app/.embuild/espressif" PATH="/Users/mbv/test-build-app/.embuild/espressif/tools/esp32ulp-elf/2.35_20220830/esp32ulp-elf/bin:/Users/mbv/test-build-app/.embuild/espressif/tools/cmake/3.24.0/CMake.app/Contents/bin:/Users/mbv/test-build-app/.embuild/espressif/esp-idf/v5.1.2/tools:/Users/mbv/test-build-app/.embuild/espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin:/Users/mbv/test-build-app/.embuild/espressif/tools/ninja/1.10.2/:/Users/mbv/test-build-app/.embuild/espressif/python_env/idf5.1_py3.11_env/bin:/Users/mbv/.rustup/toolchains/esp/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin:/Users/mbv/.cargo/bin:/Users/mbv/.nvm/versions/node/v21.5.0/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/usr/local/share/dotnet:~/.dotnet/tools:/Users/mbv/.cargo/bin:/Users/mbv/.orbstack/bin" PROJECT_DIR="/Users/mbv/test-build-app" SDKCONFIG_DEFAULTS="/Users/mbv/test-build-app/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-cdeb9cbd12aa4ef9/out/gen-sdkconfig.defaults;/Users/mbv/test-build-app/sdkconfig.defaults" "cmake" "/Users/mbv/test-build-app/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-cdeb9cbd12aa4ef9/out" "-G" "Ninja" "-DCMAKE_TOOLCHAIN_FILE=/Users/mbv/test-build-app/.embuild/espressif/esp-idf/v5.1.2/tools/cmake/toolchain-esp32.cmake" "-DCMAKE_BUILD_TYPE=" "-DPYTHON=/Users/mbv/test-build-app/.embuild/espressif/python_env/idf5.1_py3.11_env/bin/python" "-DCMAKE_INSTALL_PREFIX=/Users/mbv/test-build-app/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-cdeb9cbd12aa4ef9/out" "-DCMAKE_C_FLAGS= -mlongcalls -Wno-frame-address -ffunction-sections -fdata-sections --target=xtensa-esp32-espidf" "-DCMAKE_CXX_FLAGS= -mlongcalls -Wno-frame-address -ffunction-sections -fdata-sections --target=xtensa-esp32-espidf" "-DCMAKE_ASM_FLAGS= -mlongcalls -ffunction-sections -fdata-sections --target=xtensa-esp32-espidf"
  -- The C compiler identification is GNU 12.2.0
  -- The CXX compiler identification is GNU 12.2.0
  -- The ASM compiler identification is GNU
  -- Found assembler: /Users/mbv/test-build-app/.embuild/espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - failed
  -- Check for working C compiler: /Users/mbv/test-build-app/.embuild/espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc
  -- Check for working C compiler: /Users/mbv/test-build-app/.embuild/espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc - broken
  -- Configuring incomplete, errors occurred!
  See also "/Users/mbv/test-build-app/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-cdeb9cbd12aa4ef9/out/build/CMakeFiles/CMakeOutput.log".
  See also "/Users/mbv/test-build-app/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-cdeb9cbd12aa4ef9/out/build/CMakeFiles/CMakeError.log".

  --- stderr
  Build configuration: BuildConfig {
      esp_idf_tools_install_dir: None,
      esp_idf_sdkconfig: None,
      esp_idf_sdkconfig_defaults: None,
      mcu: Some(
          "esp32",
      ),
      native: NativeConfig {
          esp_idf_version: Some(
              Tag(
                  "v5.1.2",
              ),
          ),
          esp_idf_repository: None,
          esp_idf_cmake_generator: None,
          idf_path: None,
          extra_components: [],
          esp_idf_components: None,
          esp_idf_component_manager: None,
      },
      esp_idf_sys_root_crate: None,
  }
  Using managed esp-idf repository: RemoteSdk { repo_url: None, git_ref: Tag("v5.1.2") }
  Using esp-idf v5.1.2 at '/Users/mbv/test-build-app/.embuild/espressif/esp-idf/v5.1.2'
  CMake Error at /Users/mbv/test-build-app/.embuild/espressif/tools/cmake/3.24.0/CMake.app/Contents/share/cmake-3.24/Modules/CMakeTestCCompiler.cmake:69 (message):
    The C compiler

      "/Users/mbv/test-build-app/.embuild/espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc"

    is not able to compile a simple test program.

    It fails with the following output:

      Change Dir: /Users/mbv/test-build-app/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-cdeb9cbd12aa4ef9/out/build/CMakeFiles/CMakeTmp
      
      Run Build Command(s):/Users/mbv/test-build-app/.embuild/espressif/tools/ninja/1.10.2/ninja cmTC_4bab5 && [1/2] Building C object CMakeFiles/cmTC_4bab5.dir/testCCompiler.c.obj
      FAILED: CMakeFiles/cmTC_4bab5.dir/testCCompiler.c.obj 
      /Users/mbv/test-build-app/.embuild/espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc   -mlongcalls -Wno-frame-address  -ffunction-sections -fdata-sections --target=xtensa-esp32-espidf -o CMakeFiles/cmTC_4bab5.dir/testCCompiler.c.obj -c /Users/mbv/test-build-app/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-cdeb9cbd12aa4ef9/out/build/CMakeFiles/CMakeTmp/testCCompiler.c
      xtensa-esp32-elf-gcc: error: unrecognized command-line option '--target=xtensa-esp32-espidf'
      ninja: build stopped: subcommand failed.
      
      

    

    CMake will not be able to correctly generate this project.
  Call Stack (most recent call first):
    /Users/mbv/test-build-app/.embuild/espressif/esp-idf/v5.1.2/tools/cmake/project.cmake:448 (__project)
    CMakeLists.txt:28 (project)


  thread 'main' panicked at /Users/mbv/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cmake-0.1.50/src/lib.rs:1098:5:

  command did not execute successfully, got: exit status: 1

  build script failed, must exit now
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


@ruff3d
Copy link

ruff3d commented Feb 21, 2024

same here

@NE4Y
Copy link

NE4Y commented Feb 23, 2024

I have the same problem.

@Vollbrecht
Copy link
Collaborator

2 weeks ago the cc crate got some updates, and since then there were made multiple releases that fixed problems on macos, but it may as well still be broken. To test the hypothesis could one of you test it with the following.

add this in your Cargo.toml

[patch.crates-io]
cc = { git = "https://github.com/rust-lang/cc-rs", tag = "1.0.83" }

than run cargo update to fetch the git dependencys, and then run cargo tree -f "{p} {f}" | grep cc -B 6 to check if the cc dependency is acutally the 1.0.83 version.

@Vollbrecht
Copy link
Collaborator

if cc is still the culprit with any version from 1.0.84 to freshly released 1.0.87 we need to raise a issue on the cc crate here

@mbv
Copy link
Author

mbv commented Feb 25, 2024

@Vollbrecht Thank you, 1.0.83 works, but all subsequent versions are broken, the last one I checked was 1.0.88.

@freew01f
Copy link

thank u very much

2 weeks ago the cc crate got some updates, and since then there were made multiple releases that fixed problems on macos, but it may as well still be broken. To test the hypothesis could one of you test it with the following.

add this in your Cargo.toml

[patch.crates-io]
cc = { git = "https://github.com/rust-lang/cc-rs", tag = "1.0.83" }

than run cargo update to fetch the git dependencys, and then run cargo tree -f "{p} {f}" | grep cc -B 6 to check if the cc dependency is acutally the 1.0.83 version.

thkans

@dtimm
Copy link
Contributor

dtimm commented Feb 26, 2024

Building with CRATE_CC_NO_DEFAULTS=1 gets past this issue for me. This stops the script from adding the --target=xtensa-esp32-espidf flag that upsets xtensa-esp-elf-gcc.

@kristofferpeterhansel
Copy link

add this in your Cargo.toml

[patch.crates-io]
cc = { git = "https://github.com/rust-lang/cc-rs", tag = "1.0.83" }

Just cc = "=1.0.83" also works to force a specific version

@meditant
Copy link

meditant commented Mar 5, 2024

[patch.crates-io]
cc = { git = "https://github.com/rust-lang/cc-rs", tag = "1.0.83" }

Not work for me.

But export CRATE_CC_NO_DEFAULTS=1

Work i can build

[patch.crates-io]
cc = { git = "https://github.com/rust-lang/cc-rs", tag = "1.0.83" } :
cargo clean
cargo build
warning: Patch cc v1.0.83 (https://github.com/rust-lang/cc-rs?tag=1.0.83#bfc3ba41) was not used in the crate graph.
Check that the patched package version and available features are compatible
with the dependency requirements. If the patch has a different version from
what is locked in the Cargo.lock file, run cargo update to use the new
version. This may also occur with an optional dependency that is not enabled.
Compiling compiler_builtins v0.1.103
Compiling core v0.0.0 (/Users/fr/.rustup/toolchains/esp/lib/rustlib/src/rust/library/core)
Compiling libc v0.2.150
Compiling memchr v2.5.0
Compiling proc-macro2 v1.0.78
Compiling unicode-ident v1.0.12
Compiling std v0.0.0 (/Users/fr/.rustup/toolchains/esp/lib/rustlib/src/rust/library/std)
Compiling libc v0.2.153
Compiling memchr v2.7.1
Compiling cfg-if v1.0.0
Compiling serde v1.0.197
Compiling regex-syntax v0.8.2
Compiling crossbeam-utils v0.8.19
Compiling glob v0.3.1
Compiling syn v1.0.109
Compiling rustix v0.38.31
Compiling bitflags v1.3.2
Compiling bitflags v2.4.2
Compiling log v0.4.21
Compiling rustversion v1.0.14
Compiling same-file v1.0.6
Compiling serde_json v1.0.114
Compiling thiserror v1.0.57
Compiling minimal-lexical v0.2.1
Compiling walkdir v2.5.0
Compiling libloading v0.8.2
Compiling cvt v0.1.2
Compiling either v1.10.0
Compiling lazy_static v1.4.0
Compiling bindgen v0.63.0
Compiling anyhow v1.0.80
Compiling itoa v1.0.10
Compiling ryu v1.0.17
Compiling home v0.5.9
Compiling heck v0.4.1
Compiling fastrand v2.0.1
Compiling peeking_take_while v0.1.2
Compiling shlex v1.3.0
Compiling normpath v1.2.0
Compiling rustc-hash v1.1.0
Compiling lazycell v1.3.0
Compiling cc v1.0.89
Compiling camino v1.1.6
Compiling semver v1.0.22
Compiling fnv v1.0.7
Compiling autocfg v1.1.0
Compiling ident_case v1.0.1
Compiling clang-sys v1.7.0
Compiling embedded-io-async v0.6.1
Compiling heapless v0.8.0
Compiling core-foundation-sys v0.8.6
Compiling embassy-time-driver v0.1.0
Compiling unicode-xid v0.2.4
Compiling once_cell v1.19.0
Compiling aho-corasick v1.1.2
Compiling bstr v1.9.1
Compiling nom v7.1.3
Compiling quote v1.0.35
Compiling iana-time-zone v0.1.60
Compiling crossbeam-epoch v0.9.18
Compiling version_check v0.9.4
Compiling embassy-sync v0.5.0
Compiling embedded-hal-async v1.0.0
Compiling num-traits v0.2.18
Compiling litrs v0.4.1
Compiling syn v2.0.52
Compiling crossbeam-deque v0.8.5
Compiling cmake v0.1.50
Compiling uncased v0.9.10
Compiling const_format_proc_macros v0.2.32
Compiling document-features v0.2.8
Compiling errno v0.3.8
Compiling nix v0.26.4
Compiling filetime v0.2.23
Compiling fs_at v0.1.10
Compiling chrono v0.4.34
Compiling remove_dir_all v0.8.2
Compiling which v4.4.2
Compiling tempfile v3.10.1
Compiling regex-automata v0.4.6
Compiling cexpr v0.6.0
Compiling darling_core v0.20.8
Compiling globset v0.4.14
Compiling regex v1.10.3
Compiling ignore v0.4.22
Compiling globwalk v0.8.1
Compiling strum_macros v0.24.3
Compiling serde_derive v1.0.197
Compiling thiserror-impl v1.0.57
Compiling build-time v0.1.3
Compiling num_enum_derive v0.7.2
Compiling darling_macro v0.20.8
Compiling strum v0.24.1
Compiling darling v0.20.8
Compiling enumset_derive v0.8.1
Compiling rustc-std-workspace-core v1.99.0 (/Users/fr/.rustup/toolchains/esp/lib/rustlib/src/rust/library/rustc-std-workspace-core)
Compiling alloc v0.0.0 (/Users/fr/.rustup/toolchains/esp/lib/rustlib/src/rust/library/alloc)
Compiling adler v1.0.2
Compiling rustc-demangle v0.1.23
Compiling unwind v0.0.0 (/Users/fr/.rustup/toolchains/esp/lib/rustlib/src/rust/library/unwind)
Compiling cargo-platform v0.1.7
Compiling envy v0.4.2
Compiling embuild v0.31.4
Compiling cargo_metadata v0.18.1
Compiling rustc-std-workspace-alloc v1.99.0 (/Users/fr/.rustup/toolchains/esp/lib/rustlib/src/rust/library/rustc-std-workspace-alloc)
Compiling panic_abort v0.0.0 (/Users/fr/.rustup/toolchains/esp/lib/rustlib/src/rust/library/panic_abort)
Compiling panic_unwind v0.0.0 (/Users/fr/.rustup/toolchains/esp/lib/rustlib/src/rust/library/panic_unwind)
Compiling gimli v0.28.0
Compiling miniz_oxide v0.7.1
Compiling std_detect v0.1.5 (/Users/fr/.rustup/toolchains/esp/lib/rustlib/src/rust/library/stdarch/crates/std_detect)
Compiling object v0.32.1
Compiling hashbrown v0.14.3
Compiling esp-idf-sys v0.34.1
Compiling esp-idf-hal v0.43.1
Compiling esp-idf-svc v0.48.1
Compiling test2 v0.1.0 (/Volumes/Documents/Devel/Rust/test2)
Compiling addr2line v0.21.0
Compiling proc_macro v0.0.0 (/Users/fr/.rustup/toolchains/esp/lib/rustlib/src/rust/library/proc_macro)
Compiling byteorder v1.5.0
Compiling nb v1.1.0
Compiling embedded-io v0.6.1
Compiling stable_deref_trait v1.2.0
Compiling futures-core v0.3.30
Compiling embedded-hal v1.0.0
Compiling futures-task v0.3.30
Compiling pin-project-lite v0.2.13
Compiling pin-utils v0.1.0
Compiling void v1.0.2
Compiling enumset v1.1.3
Compiling nb v0.1.3
Compiling critical-section v1.1.2
Compiling const_format v0.2.32
Compiling futures-util v0.3.30
Compiling embedded-hal v0.2.7
Compiling embedded-can v0.4.1
Compiling embedded-hal-nb v1.0.0
Compiling num_enum v0.7.2
Compiling atomic-waker v1.1.2
Compiling no-std-net v0.5.0
Compiling embassy-futures v0.1.1
Compiling hash32 v0.3.1
The following warnings were emitted during compilation:

warning: esp-idf-sys@0.34.1: (esp-idf-sys) Removed env vars that might affect the ESP IDF C build: CPPFLAGS=-I/opt/homebrew/opt/llvm/include;LDFLAGS=-L/opt/homebrew/opt/llvm/lib -Wl,-rpath,/opt/homebrew/opt/llvm/lib/c++

error: failed to run custom build command for esp-idf-sys v0.34.1

Caused by:
process didn't exit successfully: /Volumes/Documents/Devel/Rust/test2/target/debug/build/esp-idf-sys-5ad39a82e35dc1cd/build-script-build (exit status: 101)
--- stdout
cargo:warning=(esp-idf-sys) Removed env vars that might affect the ESP IDF C build: CPPFLAGS=-I/opt/homebrew/opt/llvm/include;LDFLAGS=-L/opt/homebrew/opt/llvm/lib -Wl,-rpath,/opt/homebrew/opt/llvm/lib/c++
cargo:rerun-if-env-changed=ESP_IDF_TOOLS_INSTALL_DIR
cargo:rerun-if-env-changed=ESP_IDF_SDKCONFIG
cargo:rerun-if-env-changed=ESP_IDF_SDKCONFIG_DEFAULTS
cargo:rerun-if-env-changed=MCU
cargo:rerun-if-env-changed=ESP_IDF_SYS_ROOT_CRATE
cargo:rerun-if-env-changed=ESP_IDF_VERSION
cargo:rerun-if-env-changed=ESP_IDF_REPOSITORY
cargo:rerun-if-env-changed=ESP_IDF_CMAKE_GENERATOR
cargo:rerun-if-env-changed=IDF_PATH
cargo:rerun-if-env-changed=EXTRA-COMPONENTS
cargo:rerun-if-env-changed=ESP_IDF_COMPONENTS
cargo:rerun-if-env-changed=ESP_IDF_COMPONENT_MANAGER
IDF_PYTHON_ENV_PATH=/Volumes/Documents/Devel/Rust/test2/.embuild/espressif/python_env/idf5.1_py3.10_env
ESP_IDF_VERSION=5.1
PATH=/Volumes/Documents/Devel/Rust/test2/.embuild/espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin:/Volumes/Documents/Devel/Rust/test2/.embuild/espressif/tools/esp32ulp-elf/2.35_20220830/esp32ulp-elf/bin:/Volumes/Documents/Devel/Rust/test2/.embuild/espressif/tools/cmake/3.24.0/CMake.app/Contents/bin:/Volumes/Documents/Devel/Rust/test2/.embuild/espressif/tools/ninja/1.10.2/:/Volumes/Documents/Devel/Rust/test2/.embuild/espressif/python_env/idf5.1_py3.10_env/bin:/Volumes/Documents/Devel/Rust/test2/.embuild/espressif/esp-idf/v5.1.3/tools:$PATH
IDF_DEACTIVATE_FILE_PATH=/var/folders/8t/cnnywgc955d7mmvdnvtzp7ph0000gn/T/tmpohzifa6ridf_39130
Current system platform: macos-arm64
Installing tools: xtensa-esp32-elf, cmake, ninja, esp32ulp-elf
Skipping xtensa-esp32-elf@esp-12.2.0_20230208 (already installed)
Skipping cmake@3.24.0 (already installed)
Skipping ninja@1.10.2 (already installed)
Skipping esp32ulp-elf@2.35_20220830 (already installed)
IDF_PYTHON_ENV_PATH=/Volumes/Documents/Devel/Rust/test2/.embuild/espressif/python_env/idf5.1_py3.10_env
ESP_IDF_VERSION=5.1
PATH=/Volumes/Documents/Devel/Rust/test2/.embuild/espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin:/Volumes/Documents/Devel/Rust/test2/.embuild/espressif/tools/esp32ulp-elf/2.35_20220830/esp32ulp-elf/bin:/Volumes/Documents/Devel/Rust/test2/.embuild/espressif/tools/cmake/3.24.0/CMake.app/Contents/bin:/Volumes/Documents/Devel/Rust/test2/.embuild/espressif/tools/ninja/1.10.2/:/Volumes/Documents/Devel/Rust/test2/.embuild/espressif/python_env/idf5.1_py3.10_env/bin:/Volumes/Documents/Devel/Rust/test2/.embuild/espressif/esp-idf/v5.1.3/tools:$PATH
IDF_DEACTIVATE_FILE_PATH=/var/folders/8t/cnnywgc955d7mmvdnvtzp7ph0000gn/T/tmpy4084_4didf_39130
cargo:rerun-if-changed=/Volumes/Documents/Devel/Rust/test2/sdkconfig.defaults
CMAKE_PREFIX_PATH_xtensa-esp32-espidf = None
CMAKE_PREFIX_PATH_xtensa_esp32_espidf = None
TARGET_CMAKE_PREFIX_PATH = None
CMAKE_PREFIX_PATH = None
CMAKE_xtensa-esp32-espidf = None
CMAKE_xtensa_esp32_espidf = None
TARGET_CMAKE = None
CMAKE = None
running: cd "/Volumes/Documents/Devel/Rust/test2/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-e7fbd4070e43cbc1/out/build" && CMAKE_PREFIX_PATH="" EXTRA_COMPONENT_DIRS="" IDF_COMPONENT_MANAGER="1" IDF_PATH="/Volumes/Documents/Devel/Rust/test2/.embuild/espressif/esp-idf/v5.1.3" IDF_TARGET="esp32" IDF_TOOLS_PATH="/Volumes/Documents/Devel/Rust/test2/.embuild/espressif" PATH="/Volumes/Documents/Devel/Rust/test2/.embuild/espressif/tools/ninja/1.10.2/:/Volumes/Documents/Devel/Rust/test2/.embuild/espressif/python_env/idf5.1_py3.10_env/bin:/Volumes/Documents/Devel/Rust/test2/.embuild/espressif/esp-idf/v5.1.3/tools:/Volumes/Documents/Devel/Rust/test2/.embuild/espressif/tools/esp32ulp-elf/2.35_20220830/esp32ulp-elf/bin:/Volumes/Documents/Devel/Rust/test2/.embuild/espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin:/Volumes/Documents/Devel/Rust/test2/.embuild/espressif/tools/cmake/3.24.0/CMake.app/Contents/bin:/Users/fr/.rustup/toolchains/esp/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin:/Users/fr/miniforge3/bin:/Users/fr/miniforge3/condabin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/Applications/Wireshark.app/Contents/MacOS:/Users/fr/.cargo/bin" PROJECT_DIR="/Volumes/Documents/Devel/Rust/test2" SDKCONFIG_DEFAULTS="/Volumes/Documents/Devel/Rust/test2/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-e7fbd4070e43cbc1/out/gen-sdkconfig.defaults;/Volumes/Documents/Devel/Rust/test2/sdkconfig.defaults" "cmake" "/Volumes/Documents/Devel/Rust/test2/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-e7fbd4070e43cbc1/out" "-G" "Ninja" "-DCMAKE_TOOLCHAIN_FILE=/Volumes/Documents/Devel/Rust/test2/.embuild/espressif/esp-idf/v5.1.3/tools/cmake/toolchain-esp32.cmake" "-DCMAKE_BUILD_TYPE=" "-DPYTHON=/Volumes/Documents/Devel/Rust/test2/.embuild/espressif/python_env/idf5.1_py3.10_env/bin/python" "-DCMAKE_INSTALL_PREFIX=/Volumes/Documents/Devel/Rust/test2/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-e7fbd4070e43cbc1/out" "-DCMAKE_C_FLAGS= -mlongcalls -Wno-frame-address -ffunction-sections -fdata-sections --target=xtensa-esp32-espidf" "-DCMAKE_CXX_FLAGS= -mlongcalls -Wno-frame-address -ffunction-sections -fdata-sections --target=xtensa-esp32-espidf" "-DCMAKE_ASM_FLAGS= -mlongcalls -ffunction-sections -fdata-sections --target=xtensa-esp32-espidf"
-- Found Git: /usr/bin/git (found version "2.39.3 (Apple Git-145)")
-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- The ASM compiler identification is GNU
-- Found assembler: /Volumes/Documents/Devel/Rust/test2/.embuild/espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /Volumes/Documents/Devel/Rust/test2/.embuild/espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc
-- Check for working C compiler: /Volumes/Documents/Devel/Rust/test2/.embuild/espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc - broken
-- Configuring incomplete, errors occurred!
See also "/Volumes/Documents/Devel/Rust/test2/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-e7fbd4070e43cbc1/out/build/CMakeFiles/CMakeOutput.log".
See also "/Volumes/Documents/Devel/Rust/test2/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-e7fbd4070e43cbc1/out/build/CMakeFiles/CMakeError.log".

--- stderr
Build configuration: BuildConfig {
esp_idf_tools_install_dir: None,
esp_idf_sdkconfig: None,
esp_idf_sdkconfig_defaults: None,
mcu: Some(
"esp32",
),
native: NativeConfig {
esp_idf_version: Some(
Tag(
"v5.1.3",
),
),
esp_idf_repository: None,
esp_idf_cmake_generator: None,
idf_path: None,
extra_components: [],
esp_idf_components: None,
esp_idf_component_manager: None,
},
esp_idf_sys_root_crate: None,
}
Using managed esp-idf repository: RemoteSdk { repo_url: None, git_ref: Tag("v5.1.3") }
Using esp-idf v5.1.3 at '/Volumes/Documents/Devel/Rust/test2/.embuild/espressif/esp-idf/v5.1.3'
CMake Error at /Volumes/Documents/Devel/Rust/test2/.embuild/espressif/tools/cmake/3.24.0/CMake.app/Contents/share/cmake-3.24/Modules/CMakeTestCCompiler.cmake:69 (message):
The C compiler

  "/Volumes/Documents/Devel/Rust/test2/.embuild/espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc"

is not able to compile a simple test program.

It fails with the following output:

  Change Dir: /Volumes/Documents/Devel/Rust/test2/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-e7fbd4070e43cbc1/out/build/CMakeFiles/CMakeTmp
  
  Run Build Command(s):/Volumes/Documents/Devel/Rust/test2/.embuild/espressif/tools/ninja/1.10.2/ninja cmTC_4cf07 && [1/2] Building C object CMakeFiles/cmTC_4cf07.dir/testCCompiler.c.obj
  FAILED: CMakeFiles/cmTC_4cf07.dir/testCCompiler.c.obj 
  /Volumes/Documents/Devel/Rust/test2/.embuild/espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc   -mlongcalls -Wno-frame-address  -ffunction-sections -fdata-sections --target=xtensa-esp32-espidf -o CMakeFiles/cmTC_4cf07.dir/testCCompiler.c.obj -c /Volumes/Documents/Devel/Rust/test2/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-e7fbd4070e43cbc1/out/build/CMakeFiles/CMakeTmp/testCCompiler.c
  xtensa-esp32-elf-gcc: error: unrecognized command-line option '--target=xtensa-esp32-espidf'
  ninja: build stopped: subcommand failed.
  
  



CMake will not be able to correctly generate this project.

Call Stack (most recent call first):
/Volumes/Documents/Devel/Rust/test2/.embuild/espressif/esp-idf/v5.1.3/tools/cmake/project.cmake:448 (__project)
CMakeLists.txt:28 (project)

thread 'main' panicked at /Users/fr/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cmake-0.1.50/src/lib.rs:1098:5:

command did not execute successfully, got: exit status: 1

build script failed, must exit now
stack backtrace:
0: _rust_begin_unwind
1: core::panicking::panic_fmt
2: cmake::fail
at /Users/fr/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cmake-0.1.50/src/lib.rs:1098:5
3: cmake::run
at /Users/fr/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cmake-0.1.50/src/lib.rs:1076:9
4: cmake::Config::build
at /Users/fr/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cmake-0.1.50/src/lib.rs:813:13
5: build_script_build::native::cargo_driver::build
at ./build/native/cargo_driver.rs:528:5
6: build_script_build::native::build
at ./build/native.rs:17:9
7: build_script_build::main
at ./build/build.rs:51:24
8: core::ops::function::FnOnce::call_once
at /Users/espressif/action-runner/esp-rs/_work/rust-build/rust-build/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace.
warning: build failed, waiting for other jobs to finish...

@Vollbrecht
Copy link
Collaborator

look at the output : Compiling cc v1.0.89 you did not apply the patch correctly, you probably forgot to run cargo update

@samutigro
Copy link

2 weeks ago the cc crate got some updates, and since then there were made multiple releases that fixed problems on macos, but it may as well still be broken. To test the hypothesis could one of you test it with the following.

add this in your Cargo.toml

[patch.crates-io]
cc = { git = "https://github.com/rust-lang/cc-rs", tag = "1.0.83" }

than run cargo update to fetch the git dependencys, and then run cargo tree -f "{p} {f}" | grep cc -B 6 to check if the cc dependency is acutally the 1.0.83 version.

@Vollbrecht this worked for me!! Thank you! I was struggling with it since 10 days

@NobodyXu
Copy link

NobodyXu commented Mar 8, 2024

Can you please open an issue in rust-lang/cc-rs ?

@clouds56
Copy link

FYI, rust-lang/cc-rs#1005

@NobodyXu
Copy link

It seems that setting cc::Build::no_default_flags to false (can be set by environment variables CRATE_CC_NO_DEFAULTS) fix this problem.

I think updating the build script to disable default flags would probably fix this.

@clouds56
Copy link

I did some investigation, the break change is introduced by rust-lang/cc-rs#709.
After the PR, the could detect cc in PATH is actually clang in macOS, and then add some default flags for clang in build.
I think we should ether

  1. tell cc-rs we do using gcc (something like TARGET_CC="riscv32-esp-elf-gcc" and TARGET_CXX="riscv32-esp-elf-g++")
  2. or like @NobodyXu said set CRATE_CC_NO_DEFAULTS=1

Further more, I checked CMakeCache.txt in the demo esp-idf project, related CFLAGS shows like:

//C Compiler Base Flags
CMAKE_C_FLAGS:STRING='-march=rv32imc_zicsr_zifencei '

//Flags used by the C compiler during DEBUG builds.
CMAKE_C_FLAGS_DEBUG:STRING=-g

//Flags used by the C compiler during MINSIZEREL builds.
CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG

//Flags used by the C compiler during RELEASE builds.
CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG

//Flags used by the C compiler during RELWITHDEBINFO builds.
CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG

//Path to a program.
CMAKE_DLLTOOL:FILEPATH=CMAKE_DLLTOOL-NOTFOUND

//Linker Base Flags
CMAKE_EXE_LINKER_FLAGS:STRING='-nostartfiles -march=rv32imc_zicsr_zifencei --specs=nosys.specs '

//Flags used by the linker during DEBUG builds.
CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=

this is CMakeCache.txt in esp-idf-sys when CC=clang (this is default cc-rs=v1.0.84, and build failed):

//C Compiler Base Flags
CMAKE_C_FLAGS:STRING=-march=rv32imc_zicsr_zifencei  -ffunction-sections -fdata-sections --target=riscv32imc_zicsr_zifencei-esp-espidf

//Flags used by the C compiler during DEBUG builds.
CMAKE_C_FLAGS_DEBUG:STRING=-g

//Flags used by the C compiler during MINSIZEREL builds.
CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG

//Flags used by the C compiler during RELEASE builds.
CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG

//Flags used by the C compiler during RELWITHDEBINFO builds.
CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG

//Path to a program.
CMAKE_DLLTOOL:FILEPATH=CMAKE_DLLTOOL-NOTFOUND

//Linker Base Flags
CMAKE_EXE_LINKER_FLAGS:STRING='-nostartfiles -march=rv32imc_zicsr_zifencei --specs=nosys.specs '

//Flags used by the linker during DEBUG builds.
CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=

and when TARGET_CC=riscv32-esp-elf-gcc (build successfully):

//C Compiler Base Flags
CMAKE_C_FLAGS:STRING=-march=rv32imc_zicsr_zifencei  -ffunction-sections -fdata-sections -mabi=ilp32

//Flags used by the C compiler during DEBUG builds.
CMAKE_C_FLAGS_DEBUG:STRING=-g

//Flags used by the C compiler during MINSIZEREL builds.
CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG

//Flags used by the C compiler during RELEASE builds.
CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG

//Flags used by the C compiler during RELWITHDEBINFO builds.
CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG

//Path to a program.
CMAKE_DLLTOOL:FILEPATH=CMAKE_DLLTOOL-NOTFOUND

//Linker Base Flags
CMAKE_EXE_LINKER_FLAGS:STRING='-nostartfiles -march=rv32imc_zicsr_zifencei --specs=nosys.specs '

//Flags used by the linker during DEBUG builds.
CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=

and with CRATE_CC_NO_DEFAULTS=1 (build successfully):

//C Compiler Base Flags
CMAKE_C_FLAGS:STRING='-march=rv32imc_zicsr_zifencei '

//Flags used by the C compiler during DEBUG builds.
CMAKE_C_FLAGS_DEBUG:STRING=-g

//Flags used by the C compiler during MINSIZEREL builds.
CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG

//Flags used by the C compiler during RELEASE builds.
CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG

//Flags used by the C compiler during RELWITHDEBINFO builds.
CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG

//Path to a program.
CMAKE_DLLTOOL:FILEPATH=CMAKE_DLLTOOL-NOTFOUND

//Linker Base Flags
CMAKE_EXE_LINKER_FLAGS:STRING='-nostartfiles -march=rv32imc_zicsr_zifencei --specs=nosys.specs '

//Flags used by the linker during DEBUG builds.
CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=

Related code position:
// detect_family called from here

// Build the esp-idf.
cmake_config.build();

// TARGET_CC checked at here
https://github.com/rust-lang/cc-rs/blob/77a54a990259b85a1385495594aa6dd188c7c4e8/src/lib.rs#L2697-L2699

@NobodyXu
Copy link

I did some investigation, the break change is introduced by rust-lang/cc-rs#709.

If that is the case, then rust-lang/cc-rs#1000 should fix this.

It fixes the compiler detection logic by using C macros instead of --version

@NobodyXu
Copy link

@clouds56 Can you have a try of rust-lang/cc-rs#1000 , to see if it fixed the issue please?

@clouds56
Copy link

@clouds56 Can you have a try of rust-lang/cc-rs#1000 , to see if it fixed the issue please?

I've tried current main branch (at commit f36d6a7ed06033c38021ef65e2b7f1da38932024)
It failed at a different point, (seems passed the basic compiler test which failed prior to cc-rs#1000)

  CMake Error at /Users/clouds/.local/opt/esp-idf/CMakeLists.txt:234 (message):
    Failed to determine sizeof(time_t)

And the CMakeCache.txt still uses --target

//C Compiler Base Flags
CMAKE_C_FLAGS:STRING=-march=rv32imc_zicsr_zifencei  -ffunction-sections -fdata-sections --target=riscv32imc_zicsr_zifencei-esp-espidf

You might also interest in the CMakeError.log

Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: /Users/clouds/.espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/riscv32-esp-elf-gcc 
Build flags: -march=rv32imc_zicsr_zifencei;;-ffunction-sections;-fdata-sections;-mabi=ilp32
Id flags:  

The output was:
No such file or directory

@Firstyear
Copy link

Same issue here, downgrade to 1.0.83 resolves.

@Vollbrecht
Copy link
Collaborator

@zrll12 that seams unrelated to to issue, you are building against your host target and not against the specific esp targets. Either you forgot to directly pass the target as an argument or if you are using the .cargo/config.toml files it is missing the correct configuration.

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