Skip to content

pkg/qcbor: disable HW FPU support for ESP32S2&ESP8266 - #22179

Merged
maribu merged 2 commits into
RIOT-OS:masterfrom
crasbe:pr/qcbor_esp
Apr 21, 2026
Merged

pkg/qcbor: disable HW FPU support for ESP32S2&ESP8266#22179
maribu merged 2 commits into
RIOT-OS:masterfrom
crasbe:pr/qcbor_esp

Conversation

@crasbe

@crasbe crasbe commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Contribution description

The newlib implementation of some ESP variants does not implement the
feclearexcept and fetestexcept functions from fenv.h used by
QCBOR. Disabling the HW FPU support works around this issue.

Testing procedure

I added a test case in the qcbor test. Comment out the CFLAGS line and the compilation will fail, with the line commented in it will succeed.

Commented out:

buechse@skyleaf:~/RIOTstuff/riot-vanilla/RIOT$ BUILD_IN_DOCKER=1 BOARD=esp8266-sparkfun-thing make -C tests/pkg/qcbor/ -j
make: Entering directory '/home/buechse/RIOTstuff/riot-vanilla/RIOT/tests/pkg/qcbor'
Launching build container using image "docker.io/riot/riotbuild@sha256:08fa7da2c702ac4db7cf57c23fc46c1971f3bffc4a6eff129793f853ec808736".
docker run --rm --tty --user $(id -u) --platform linux/amd64 -v '/home/buechse/RIOTstuff/riot-vanilla/RIOT:/data/riotbuild/riotbase:delegated' -v '/home/buechse/.cargo/registry:/data/riotbuild/.cargo/registry:delegated' -v '/home/buechse/.cargo/git:/data/riotbuild/.cargo/git:delegated' -e 'TZ=Europe/Berlin' -e 'RIOTBASE=/data/riotbuild/riotbase' -e 'CCACHE_BASEDIR=/data/riotbuild/riotbase' -e 'BUILD_DIR=/data/riotbuild/riotbase/build' -e 'BUILD_IN_DOCKER=0' -e 'RIOTPROJECT=/data/riotbuild/riotbase' -e 'RIOTCPU=/data/riotbuild/riotbase/cpu' -e 'RIOTBOARD=/data/riotbuild/riotbase/boards' -e 'RIOTMAKE=/data/riotbuild/riotbase/makefiles'      -e 'BOARD=esp8266-sparkfun-thing' -e 'DISABLE_MODULE=' -e 'DEFAULT_MODULE=test_utils_interactive_sync test_utils_print_stack_usage' -e 'FEATURES_REQUIRED=' -e 'FEATURES_BLACKLIST=' -e 'FEATURES_OPTIONAL=' -e 'USEMODULE=embunit' -e 'USEPKG=qcbor'  -w '/data/riotbuild/riotbase/tests/pkg/qcbor/' 'docker.io/riot/riotbuild@sha256:08fa7da2c702ac4db7cf57c23fc46c1971f3bffc4a6eff129793f853ec808736' make    -j
Building application "tests_qcbor" for "esp8266-sparkfun-thing" with CPU "esp8266".

"make" -C /data/riotbuild/riotbase/pkg/esp8266_sdk/
...
"make" -C /data/riotbuild/riotbase/cpu/esp8266/vendor/esp-idf/wpa_supplicant/src/crypto
esptool v5.0.0
Creating ESP8266 image...
Merged 1 ELF section.
Successfully created ESP8266 image.
/data/riotbuild/riotbase/tests/pkg/qcbor/bin/esp8266-sparkfun-thing/qcbor/qcbor_decode.o: In function `QCBOR_Private_DecodeDateEpoch':
/data/riotbuild/riotbase/build/pkg/qcbor/src/qcbor_decode.c:6042: undefined reference to `feclearexcept'
/data/riotbuild/riotbase/build/pkg/qcbor/src/qcbor_decode.c:6042: undefined reference to `fetestexcept'
/data/riotbuild/riotbase/tests/pkg/qcbor/bin/esp8266-sparkfun-thing/qcbor/qcbor_decode.o: In function `QCBOR_Private_ConvertUInt64':
/data/riotbuild/riotbase/build/pkg/qcbor/src/qcbor_decode.c:6042: undefined reference to `feclearexcept'
/data/riotbuild/riotbase/build/pkg/qcbor/src/qcbor_decode.c:6042: undefined reference to `fetestexcept'
collect2: error: ld returned 1 exit status
make: *** [/data/riotbuild/riotbase/Makefile.include:734: /data/riotbuild/riotbase/tests/pkg/qcbor/bin/esp8266-sparkfun-thing/tests_qcbor.elf] Error 1
make: *** [/home/buechse/RIOTstuff/riot-vanilla/RIOT/makefiles/docker.inc.mk:395: ..in-docker-container] Error 2
make: Leaving directory '/home/buechse/RIOTstuff/riot-vanilla/RIOT/tests/pkg/qcbor'

Commented in:

buechse@skyleaf:~/RIOTstuff/riot-vanilla/RIOT$ BUILD_IN_DOCKER=1 BOARD=esp8266-sparkfun-thing make -C tests/pkg/qcbor/ -j
make: Entering directory '/home/buechse/RIOTstuff/riot-vanilla/RIOT/tests/pkg/qcbor'
Launching build container using image "docker.io/riot/riotbuild@sha256:08fa7da2c702ac4db7cf57c23fc46c1971f3bffc4a6eff129793f853ec808736".
docker run --rm --tty --user $(id -u) --platform linux/amd64 -v '/home/buechse/RIOTstuff/riot-vanilla/RIOT:/data/riotbuild/riotbase:delegated' -v '/home/buechse/.cargo/registry:/data/riotbuild/.cargo/registry:delegated' -v '/home/buechse/.cargo/git:/data/riotbuild/.cargo/git:delegated' -e 'TZ=Europe/Berlin' -e 'RIOTBASE=/data/riotbuild/riotbase' -e 'CCACHE_BASEDIR=/data/riotbuild/riotbase' -e 'BUILD_DIR=/data/riotbuild/riotbase/build' -e 'BUILD_IN_DOCKER=0' -e 'RIOTPROJECT=/data/riotbuild/riotbase' -e 'RIOTCPU=/data/riotbuild/riotbase/cpu' -e 'RIOTBOARD=/data/riotbuild/riotbase/boards' -e 'RIOTMAKE=/data/riotbuild/riotbase/makefiles'      -e 'BOARD=esp8266-sparkfun-thing' -e 'DISABLE_MODULE=' -e 'DEFAULT_MODULE=test_utils_interactive_sync test_utils_print_stack_usage' -e 'FEATURES_REQUIRED=' -e 'FEATURES_BLACKLIST=' -e 'FEATURES_OPTIONAL=' -e 'USEMODULE=embunit' -e 'USEPKG=qcbor'  -w '/data/riotbuild/riotbase/tests/pkg/qcbor/' 'docker.io/riot/riotbuild@sha256:08fa7da2c702ac4db7cf57c23fc46c1971f3bffc4a6eff129793f853ec808736' make    -j
Building application "tests_qcbor" for "esp8266-sparkfun-thing" with CPU "esp8266".

"make" -C /data/riotbuild/riotbase/pkg/esp8266_sdk/
...
Generating bootloader image /data/riotbuild/riotbase/tests/pkg/qcbor/bin/esp8266-sparkfun-thing/esp_bootloader/bootloader.bin
esptool v5.0.0
Creating ESP8266 image...
Merged 1 ELF section.
Successfully created ESP8266 image.
esptool v5.0.0
Creating ESP8266 image...
Merged 1 ELF section.
Successfully created ESP8266 image.
# append size of /data/riotbuild/riotbase/tests/pkg/qcbor/bin/esp8266-sparkfun-thing/tests_qcbor.elf.bin
Parsing CSV input...
   text    data     bss     dec     hex filename
 286104    5292   28712  320108   4e26c /data/riotbuild/riotbase/tests/pkg/qcbor/bin/esp8266-sparkfun-thing/tests_qcbor.elf
make: Leaving directory '/home/buechse/RIOTstuff/riot-vanilla/RIOT/tests/pkg/qcbor'

Issues/PRs references

Discovered while building the Makefile.ci for #22091.

Declaration of AI-Tools / LLMs usage:

AI-Tools / LLMs that were used are:

  • none

@crasbe crasbe added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR CI: full build disable CI build filter labels Apr 8, 2026
@github-actions github-actions Bot added Area: tests Area: tests and testing framework Area: pkg Area: External package ports labels Apr 8, 2026
@crasbe crasbe added the CI: no fast fail don't abort PR build after first error label Apr 8, 2026
crasbe added 2 commits April 8, 2026 02:39
In some newlib implementations of the ESP toolchain, the
`feclearexcept` and `fetestexcept` functions are not implemented.
Converting a float to UINT64 explicitly triggers these functions,
enabling us to check if the exception condition in the package Makefile
still works as intended.
@riot-ci

riot-ci commented Apr 8, 2026

Copy link
Copy Markdown

Murdock results

✔️ PASSED

fc4e327 tests/pkg/qcbor: add test for float to UINT64 conversion

Success Failures Total Runtime
163953 0 163953 03h:22m:01s

Artifacts

@benpicco
benpicco requested a review from gschorcht April 8, 2026 11:01
@crasbe crasbe removed the CI: full build disable CI build filter label Apr 8, 2026
@crasbe crasbe mentioned this pull request Apr 8, 2026
11 tasks
@maribu
maribu enabled auto-merge April 20, 2026 14:01
@maribu
maribu added this pull request to the merge queue Apr 20, 2026
Merged via the queue into RIOT-OS:master with commit cf27c25 Apr 21, 2026
27 checks passed
@crasbe
crasbe deleted the pr/qcbor_esp branch April 22, 2026 11:58
@MrKevinWeiss MrKevinWeiss added this to the Release 2026.07 milestone Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: pkg Area: External package ports Area: tests Area: tests and testing framework CI: no fast fail don't abort PR build after first error CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants