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

How to get new GCC compiler (IDFGH-5101) #6885

Closed
0xFEEDC0DE64 opened this issue Apr 16, 2021 · 8 comments
Closed

How to get new GCC compiler (IDFGH-5101) #6885

0xFEEDC0DE64 opened this issue Apr 16, 2021 · 8 comments
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally Type: Feature Request Feature request for IDF

Comments

@0xFEEDC0DE64
Copy link
Contributor

I noticed when sourcing the export.sh of esp-idf 4.4-dev I get a gcc compiler version 8.4.0:

$ xtensa-esp32-elf-g++ --version
xtensa-esp32-elf-g++ (crosstool-NG esp-2020r3) 8.4.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

But then I noticed Arch Linux already has version 10. How can I get version 10 with esp-idf and without using distro provided compilers?

https://aur.archlinux.org/packages/xtensa-esp32-elf-gcc/

@0xFEEDC0DE64 0xFEEDC0DE64 added the Type: Feature Request Feature request for IDF label Apr 16, 2021
@espressif-bot espressif-bot added the Status: Opened Issue is new label Apr 16, 2021
@github-actions github-actions bot changed the title How to get new GCC compiler How to get new GCC compiler (IDFGH-5101) Apr 16, 2021
@negativekelvin
Copy link
Contributor

Those are unofficial builds and do not include all espressif patches. Latest releases are here https://github.com/espressif/crosstool-NG/releases

@0xFEEDC0DE64
Copy link
Contributor Author

Ok got that, how can I stop the esp-idf export.sh from changing the PATH so that the outdated 8.4.0 compiler binaries are used and instead the distro provided ones from /usr/bin/xtensa-esp32-elf-gcc are used?

@0xFEEDC0DE64
Copy link
Contributor Author

Is there any esp-idf provided way to override the compiler?

@igrr
Copy link
Member

igrr commented Apr 26, 2021

Hi @0xFEEDC0DE64, adding the toolchain bin directory as the first entry of PATH should be sufficient.

For example, you can run . export.sh and then do export PATH=/path/to/my/toolchain/bin:$PATH.

Or, don't run . export.sh at all, and add the necessary directories (Python virtual environment, cross-compiler toolchain, CMake, Ninja) to PATH yourself.

After doing this, remember to run idf.py fullclean or remove the build directory, as CMake normally caches the compiler path.

@0xFEEDC0DE64
Copy link
Contributor Author

the cmake step already fails because the arch rebased gcc isn't able to compile simple small test programs. I understand that the development on gcc from espressif may have been stopped, but is there anything going on in regards to newer toolsets? Is llvm in consideration?

@igrr
Copy link
Member

igrr commented May 27, 2021

Yes we will definitely switch to a newer compiler version in one of the next IDF releases. I am sorry I can't give you more specific timeline. If you'd like to build GCC 10 yourself in the meantime, you can try the branches linked in espressif/crosstool-NG#11 (comment). Binary builds are also provided.

@0xFEEDC0DE64
Copy link
Contributor Author

Any update on this? When is a c++20 capable compiler finally supported by the idf?

@b1ackviking
Copy link
Contributor

According to this comment in #6214, it is planned to upgrade the toolchain to GCC 11.

@espressif-bot espressif-bot added Status: In Progress Work is in progress and removed Status: Opened Issue is new labels Jan 6, 2022
@espressif-bot espressif-bot added Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Resolution: Done Issue is done internally and removed Status: In Progress Work is in progress Resolution: NA Issue resolution is unavailable labels Jun 3, 2022
espressif-bot pushed a commit that referenced this issue Jun 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally Type: Feature Request Feature request for IDF
Projects
None yet
Development

No branches or pull requests

5 participants