You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "shaochen1850 (via GitHub)" <gi...@apache.org> on 2026/10/16 13:14:26 UTC

[I] [BUG] esp32s3: esp-hal-3rdparty fails to build with GCC 15 (ATOMIC_VAR_INIT removed) [nuttx]

shaochen1850 opened a new issue, #20704:
URL: https://github.com/apache/nuttx/issues/20704

   ### Description / Steps to reproduce the issue
   
   ### Bug Description
   
   NuttX fails to build for ESP32-S3 with GCC 15 due to `ATOMIC_VAR_INIT` being removed from the toolchain.
   
   `ATOMIC_VAR_INIT` was deprecated in C17 and removed in GCC 15. The `esp-hal-3rdparty` code pinned by NuttX 13.1 still uses it.
   
   ### Toolchain
   
   - `xtensa-esp-elf-gcc (crosstool-NG esp-15.2.0_20251204) 15.2.0`
   - ESP-IDF v6.1
   
   NuttX 13.1 pins `ESP_HAL_3RDPARTY_VERSION = b90b1837cb5ad24747deb4c895246037cc206ce5` in `arch/xtensa/src/esp32s3/Make.defs`.
   
   ### Error
   
   CC: chip/esp-hal-3rdparty/components/esp_hw_support/esp_gpio_reserve.c
   chip/esp-hal-3rdparty/components/esp_hw_support/esp_gpio_reserve.c:13:47: error: implicit declaration of function 'ATOMIC_VAR_INIT'; did you mean 'ATOMIC_FLAG_INIT'? [-Wimplicit-function-declaration]
   13 | static _Atomic uint64_t s_reserved_pin_mask = ATOMIC_VAR_INIT(~(SOC_GPIO_VALID_GPIO_MASK));
   | ^~~~~~~~~~~~~~~
   | ATOMIC_FLAG_INIT
   chip/esp-hal-3rdparty/components/esp_hw_support/esp_gpio_reserve.c:13:47: error: initializer element is not constant
   make[1]: *** [Makefile:146:chip/esp-hal-3rdparty/components/esp_hw_support/esp_gpio_reserve.o] error 1
   make: *** [tools/LibTargets.mk:170:arch/xtensa/src/libarch.a] error 2
   
   
   ### Temporary Workaround
   
   Modify `arch/xtensa/src/esp32s3/esp-hal-3rdparty/components/esp_hw_support/esp_gpio_reserve.c` line 13:
   
   ```c
   // from
   static _Atomic uint64_t s_reserved_pin_mask = ATOMIC_VAR_INIT(~(SOC_GPIO_VALID_GPIO_MASK));
   // to
   static _Atomic uint64_t s_reserved_pin_mask = ~(SOC_GPIO_VALID_GPIO_MASK);
   
   After this change, the build succeeded.
   Suggested Fix
   
   Either bump the pinned ESP_HAL_3RDPARTY_VERSION to a commit that already uses direct initialization, or document that GCC ≤ 14 is required for ESP32-S3.
   
   ### On which OS does this issue occur?
   
   [OS: Linux]
   
   ### What is the version of your OS?
   
   EndeavourOS  Linux 7.2.9-arch1-1
   
   ### NuttX Version
   
   releases/13.1
   
   ### Issue Architecture
   
   [Arch: xtensa]
   
   ### Issue Area
   
   [Area: Board support], [Area: Build System]
   
   ### Host information
   
   ### Host Info
   
   - OS: Linux x86_64 (Arch)
   - Toolchain: `xtensa-esp32s3-elf-gcc (crosstool-NG esp-15.2.0_20251204) 15.2.0`
   - ESP-IDF: v6.1
   - HAL version: `sync/master.c-nuttx-20260428-24-gb90b1837cb5`
   - esptool: 5.6.0
   - defconfig: `esp32s3-devkit:nsh`
   
   ### Verification
   
   - [x] I have verified before submitting the report.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [BUG] esp32s3: esp-hal-3rdparty fails to build with GCC 15 (ATOMIC_VAR_INIT removed) [nuttx]

Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis closed issue #20704: [BUG] esp32s3: esp-hal-3rdparty fails to build with GCC 15 (ATOMIC_VAR_INIT removed)
URL: https://github.com/apache/nuttx/issues/20704


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org