-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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
idf_as_lib example does not compile for esp32s3 (IDFGH-6453) #8112
Comments
Hi @kevin-june, this issue is probably related to our recent attempt to fix #7507. In 0baf2c4, we changed the way toolchain files set the compiler options, and while doing that we have overlooked idf_as_lib use case. Additionally, idf_as_lib example wasn't tested in our CI properly, so we didn't notice the issue. While we are working on a fix you can either revert commit 0baf2c4 in your copy of IDF, or check out the commit right before it (961407c). |
@igrr This issue seems to impact the IDF v4.4 docker image as well, is there an ETA for fixing this issue in the docker container as well? example: https://github.com/atanisoft/ESP32CommandStation/runs/4667689780?check_suite_focus=true |
@atanisoft this seems to be a different issue, at least the commit which introduced this particular problem hasn't been backported to release/v4.4. |
Ok, I'm not 100% certain then what might cause it as I am able to build successfully locally but not with the tagged docker. Perhaps the docker is pulling in master rather than the 4.4 branch? |
@atanisoft it looks like you are reusing the |
Ahh, you might be right. I adjusted the actions run to use parallel jobs and haven't tested v4.4 since then. I've enabled it now and testing: https://github.com/atanisoft/ESP32CommandStation/runs/4692894859?check_suite_focus=true |
This has been fixed by @o-marshmallow in commit cb90544. |
Thanks! This works for me and seems to pass the |
Environment
git describe --tags
to find it): v5.0-dev-758-g07bfc09d0cxtensa-esp32-elf-gcc --version
to find it): xtensa-esp32-elf-gcc (crosstool-NG esp-2021r2) 8.4.0Problem Description
The
idf_as_lib
example does not compile for the s3 chip:My understanding of the issue is described below, should you find it useful.
I think that the issue stems from how the IDF's toolchain file indirectly sets compiler flags. The toolchain file adds flags to an IDF variable:
which is later used to set compile options. However, the call to
__build_set_default_build_specifications()
clearscompile_options
:This occurs before
add_compile_options()
oridf_build_set_property(COMPILE_OPTIONS)
has been called, so the settings from the toolchain file seem to be lost.This behavior does not occur with a traditional idf.py build because that approach overrides
project()
and sets the toolchain file after__build_set_default_build_specifications()
is called.I'm not sure if it is best practice, but it seems to be possible to call
add_compile_options()
in the toolchain file.Note that this problem also exists for the esp32 example, but there is no compilation error.
Expected Behavior
Compilation should succeed; compiler flags from the toolchain file should apply to all compiled files.
Actual Behavior
Compilation fails; compiler flags from the toolchain file are not applied to all compiled files.
Steps to reproduce
idf_as_lib/CMakeLists.txt
to support the esp32s3 chip (see code sample below)mkdir build && cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=$IDF_PATH/tools/cmake/toolchain-esp32s3.cmake -DTARGET=esp32s3 -GNinja
make
Code to reproduce this issue
In
idf_as_lib/CMakeLists.txt
:Debug Logs
When compiled with Make:
Ninja fails similarly.
The text was updated successfully, but these errors were encountered: