-
Notifications
You must be signed in to change notification settings - Fork 2k
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
cpu/esp32: fix compilation issues with GCC 12.2 #19450
cpu/esp32: fix compilation issues with GCC 12.2 #19450
Conversation
d27423d
to
9aa43db
Compare
bors try |
bors cancel |
bors try |
tryAlready running a review |
tryBuild failed: |
bors try |
tryBuild succeeded: |
Finally it compiled and worked for me locally with gcc 12.2 and still compiled in Murdock with gcc 8.4.0. That is, it can be compiled with either gcc 8.4.0 or gcc 12.2. So it seems to be ready. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. One remark inline. If you say it is worth to go for -misa-spec-2.2
instead, please squash that right in. Otherwise this can go in as is.
cpu/esp32/Makefile.include
Outdated
ifeq (12,$(shell command -v $(CC) > /dev/null && $(CC) -dumpversion | cut -d . -f 1)) | ||
RISCV_MARCH = rv32imc_zicsr | ||
else | ||
RISCV_MARCH = rv32imc | ||
endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In makefiles/arch/riscv.inc.mk
this is handled slightly differently: It adds -misa-spec=2.2
, which is the latest ISA spec where zicsr
wasn't an extension. This also fixes an issue when binutils and GCC support different ISA specs and e.g. GCC requires the zicsr
with the default ISA, but the assembler fails when invoked with -march=rv32imc_zicsr
.
But I guess with the toolchains more closely controlled in the ESP32 scenario, this is fine as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to work with -misa-spec=2.2
. So I reverted the change to use again -march=rv32imc
together with -misa-spec=2.2
.
The static tests are not yet happy. Please squash at will |
Ah sorry, I pushed accidentally the branch with PR #19452 included that caused the static test error. I removed this commit. |
I do still approve, but the check-commits hook insists on squashing |
I just wanted to keep the latest changes visible. |
@maribu I compared my changes with yours in PR #18719. Some of them are the same but a number of changes differ. A number of differences are caused by the cleanup in PR #19426, e.g, Should we compare and discuss the differences again? For example, my Your PR also includes changes for ESP8266 I would like to get in to be able to upgrade to a newer GCC version. |
Maybe the easiest would be if I just close #18719 in favor of this PR - I haven't really looked actively into or updated the PR for some time anyway. If there is something useful to scavenge from (e.g. regarding ESP8266), you are welcome to do so. |
@@ -111,7 +111,7 @@ void IRAM_ATTR esp_log_writev(esp_log_level_t level, | |||
* We use the log level set for the given tag instead of using | |||
* the given log level. | |||
*/ | |||
esp_log_level_t act_level = LOG_DEBUG; | |||
esp_log_level_t act_level = (esp_log_level_t)LOG_DEBUG; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is more a matter of personal taste an either is fine
bors merge |
👎 Rejected by PR status |
Thanks for the try to merge it. I had to squash it before. |
borse merge |
bors merge |
👎 Rejected by PR status |
Forgot to push the squash commits? |
cc1b56f
to
d8d9a9b
Compare
Indeed. |
bors merge |
19411: cpu/gd32v: add riotboot support r=benpicco a=gschorcht ### Contribution description This PR provides `riotboot` support for GD32V. ### Testing procedure Use any GD32V board with a JTAG adapter and flash the bootloader: ```python PROGRAMMER=openocd BOARD=sipeed-longan-nano make -C bootloaders/riotboot flash ``` Flash slot 0 and set `RIOT_VERSION` to 1 ```python USEMODULE=stdio_uart FEATURES_REQUIRED=riotboot RIOT_VERSION=1 \ PROGRAMMER=openocd BOARD=sipeed-longan-nano make -C tests/shell riotboot/flash-slot0 ... ### Flashing Target ### Binfile detected, adding ROM base address: 0x08000000 Flashing with IMAGE_OFFSET: 0x08001000 ``` ```python > main(): This is RIOT! (Version: 1) test_shell. ``` Flash slot 1 and set `RIOT_VERSION` to 2 ```python USEMODULE=stdio_uart FEATURES_REQUIRED=riotboot RIOT_VERSION=2 \ PROGRAMMER=openocd BOARD=sipeed-longan-nano make -C tests/shell riotboot/flash-slot1 ... ### Flashing Target ### Binfile detected, adding ROM base address: 0x08000000 Flashing with IMAGE_OFFSET: 0x08010800 ``` ```python > main(): This is RIOT! (Version: 2) test_shell. ``` ### Issues/PRs references 19436: cpp11-compat: thread::sleep_for in microseconds r=benpicco a=kfessel ### Contribution description after reviewing #19369 i found that there is a conversion to nanoseconds just to convert it to microseconds some instrunctions later for ztimer64_usec to handle it this removes one of the conversions (convert once direct to microseconds) ### Testing procedure run the cpp tests ### Issues/PRs references #19369 19450: cpu/esp32: fix compilation issues with GCC 12.2 r=benpicco a=gschorcht ### Contribution description This PR provides the changes in `cpu/esp32` and `cpu/esp_common` to fix the compilation issues with GCC v12.2. It is required as the first step in the preparation of the upgrade to ESP-IDF version 5.1. **Please note**: Insead of fixing the ESP-IDF 4.4 code itself by a big bunch of patches to fix the compilation problems with GCC v12.2, it temporarily disables some warnings. The reason is that the ESP-IDF 5.1 requires GCC v12.2 and should be fixed for this compiler version by the vendor. ### Testing procedure Green CI The change were already tested with all ESP-specific modules like `esp_now`, `esp_wifi`, `esp_spi` and `esp_ble` for all supported ESP platforms. ### Issues/PRs references Prerequisite for RIOT-OS/riotdocker#227 Fixes issue #19421 19476: native/syscalls: rename real_clock_gettime to clock_gettime r=benpicco a=Teufelchen1 ### Contribution description When compiling RIOT for native using a recent LLVM and enabling ASAN, one might encounter "Duplicated symbol". This is due to a name clash with `real_clock_gettime()` in compiler-rt from [LLVM](llvm/llvm-project@f50246d), I renamed RIOTs `real_clock_gettime` and just default to the posix function `clock_gettime`. The wrapper existed, most likely, for consistency only. (The best solution would probably to convince the LLVM folks to declare their symbol as `static` and refactor a bit) ### Testing procedure Passing CI should be enough. Co-authored-by: Gunar Schorcht <[email protected]> Co-authored-by: Karl Fessel <[email protected]> Co-authored-by: Teufelchen1 <[email protected]>
Build failed (retrying...): |
Build succeeded: |
@maribu @benpicco Thanks for reviewing and merging. @kaspar030 Next step would be to try to update Murdock RIOT-OS/riotdocker#227 |
19561: cpu/esp32: fix compilation issues with GCC 12.2 [backport 2023.04] r=MrKevinWeiss a=kaspar030 # Backport of #19450 ### Contribution description This PR provides the changes in `cpu/esp32` and `cpu/esp_common` to fix the compilation issues with GCC v12.2. It is required as the first step in the preparation of the upgrade to ESP-IDF version 5.1. **Please note**: Insead of fixing the ESP-IDF 4.4 code itself by a big bunch of patches to fix the compilation problems with GCC v12.2, it temporarily disables some warnings. The reason is that the ESP-IDF 5.1 requires GCC v12.2 and should be fixed for this compiler version by the vendor. ### Testing procedure Green CI The change were already tested with all ESP-specific modules like `esp_now`, `esp_wifi`, `esp_spi` and `esp_ble` for all supported ESP platforms. ### Issues/PRs references Prerequisite for RIOT-OS/riotdocker#227 Fixes issue #19421 Co-authored-by: Gunar Schorcht <[email protected]>
19561: cpu/esp32: fix compilation issues with GCC 12.2 [backport 2023.04] r=maribu a=kaspar030 # Backport of #19450 ### Contribution description This PR provides the changes in `cpu/esp32` and `cpu/esp_common` to fix the compilation issues with GCC v12.2. It is required as the first step in the preparation of the upgrade to ESP-IDF version 5.1. **Please note**: Insead of fixing the ESP-IDF 4.4 code itself by a big bunch of patches to fix the compilation problems with GCC v12.2, it temporarily disables some warnings. The reason is that the ESP-IDF 5.1 requires GCC v12.2 and should be fixed for this compiler version by the vendor. ### Testing procedure Green CI The change were already tested with all ESP-specific modules like `esp_now`, `esp_wifi`, `esp_spi` and `esp_ble` for all supported ESP platforms. ### Issues/PRs references Prerequisite for RIOT-OS/riotdocker#227 Fixes issue #19421 19563: treewide: fix typos and false positives found by codespell [backport 2023.04] r=maribu a=MrKevinWeiss # Backport of #19528 ### Contribution description This fixes some typos and adds one correctly used abbreviation to the ignore list. Co-authored-by: Gunar Schorcht <[email protected]> Co-authored-by: Marian Buschsieweke <[email protected]>
227: riotbuild: bump esp32x toolchains to gcc version 12.2 r=kaspar030 a=gschorcht This PR upgrades ESP32x toolchains to GCC version 12.2. Since ESP-IDF 5.1 requires this compiler version, this PR has to be merged before we can start with RIOT upgrade to ESP-IDF 5.1. This PR depends on RIOT-OS/RIOT#19450. Co-authored-by: Gunar Schorcht <[email protected]>
19452: dist/tools/esptools: upgrade ESP32x toolchains to GCC version 12.2 r=MrKevinWeiss a=gschorcht ### Contribution description This PR upgrades ESP32x toolchains to GCC version 12.2 which is a prerequisite for upgrading the ESP-IDF to version 5.1. This PR depends on PR #19450 ### Testing procedure `dist/tools/install.sh all` should install all ESP32x toolchains. `. dist/tools/export.sh all` should make them visible. ### Issues/PRs references Depends on PR #19450 Co-authored-by: Gunar Schorcht <[email protected]>
Contribution description
This PR provides the changes in
cpu/esp32
andcpu/esp_common
to fix the compilation issues with GCC v12.2. It is required as the first step in the preparation of the upgrade to ESP-IDF version 5.1.Please note: Insead of fixing the ESP-IDF 4.4 code itself by a big bunch of patches to fix the compilation problems with GCC v12.2, it temporarily disables some warnings. The reason is that the ESP-IDF 5.1 requires GCC v12.2 and should be fixed for this compiler version by the vendor.
Testing procedure
Green CI
The change were already tested with all ESP-specific modules like
esp_now
,esp_wifi
,esp_spi
andesp_ble
for all supported ESP platforms.Issues/PRs references
Prerequisite for RIOT-OS/riotdocker#227
Fixes issue #19421