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

error: unrecognized command-line option '--target=riscv32imc_zicsr_zifencei-esp-espidf #237

Closed
tomvictor opened this issue Mar 11, 2024 · 2 comments

Comments

@tomvictor
Copy link
Contributor

tomvictor commented Mar 11, 2024

I am trying to build the ´hardware-check´ sample program on mac os with M1 pro processor. I have followed the software installation described in the doc, then also tried to redo it exactly like in the Development docker container, but the issue still persist. Fortunately I am able to build successfully using the devcontainer.

It fails with the following output:

  Change Dir: /Users/dev_user/git/tom/std-training/intro/hardware-check/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-3cd462394fb85936/out/build/CMakeFiles/CMakeTmp
  
  Run Build Command(s):/Users/dev_user/.espressif/tools/ninja/1.10.2/ninja cmTC_1a10f && [1/2] Building C object CMakeFiles/cmTC_1a10f.dir/testCCompiler.c.obj
  FAILED: CMakeFiles/cmTC_1a10f.dir/testCCompiler.c.obj 
  /Users/dev_user/.espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/riscv32-esp-elf-gcc   -march=rv32imc_zicsr_zifencei  -ffunction-sections -fdata-sections --target=riscv32imc_zicsr_zifencei-esp-espidf -o CMakeFiles/cmTC_1a10f.dir/testCCompiler.c.obj -c /Users/dev_user/git/tom/std-training/intro/hardware-check/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-3cd462394fb85936/out/build/CMakeFiles/CMakeTmp/testCCompiler.c
  riscv32-esp-elf-gcc: error: unrecognized command-line option '--target=riscv32imc_zicsr_zifencei-esp-espidf'
  ninja: build stopped: subcommand failed.      

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

thread 'main' panicked at /Users/dev_user/.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`

Really appreciate any suggestions

Thanks

@Vollbrecht
Copy link
Contributor

this is most likely the same problem we are tracking here esp-rs/esp-idf-sys#287 .

Can you try to build with the CRATE_CC_NO_DEFAULTS=1 env variable set? You can either directly provide it with CRATE_CC_NO_DEFAULTS=1 cargo build or set it in the projects .cargo/config.toml inside the [env] section

@tomvictor
Copy link
Contributor Author

Thanks @Vollbrecht for the quick response, it is working perfectly fine now.

@github-project-automation github-project-automation bot moved this from Todo to Done in esp-rs Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants