From 9a84753a389f01dd43ab428271d6e292df3084de Mon Sep 17 00:00:00 2001 From: PhysicistJohn <54456354+PhysicistJohn@users.noreply.github.com> Date: Tue, 14 Jul 2026 22:28:20 -0700 Subject: [PATCH] build: preserve F303 float constant semantics --- Makefile | 4 +++- docs/CHIBIOS_21_11_5_PORT.md | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 12009e5..5afef93 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,9 @@ endif # Compiler options here. ifeq ($(USE_OPT),) ifeq ($(TARGET),F303) -USE_OPT = -Og -fno-inline-small-functions -ggdb -fomit-frame-pointer -falign-functions=16 --specs=nano.specs -fstack-usage -std=c11 +USE_OPT = -Og -fno-inline-small-functions -ggdb -fomit-frame-pointer -falign-functions=16 --specs=nano.specs -fstack-usage -fsingle-precision-constant -std=c11 +# The legacy ChibiOS rules appended -fsingle-precision-constant for hard-FPU +# builds. Keep that numeric behavior explicit when using the 21.11.x rules. #USE_OPT+=-fstack-protector-strong else USE_OPT = -Og -fno-inline-small-functions -ggdb -fomit-frame-pointer -falign-functions=16 --specs=nano.specs -fstack-usage -fsingle-precision-constant diff --git a/docs/CHIBIOS_21_11_5_PORT.md b/docs/CHIBIOS_21_11_5_PORT.md index 0b7a101..c1bb16a 100644 --- a/docs/CHIBIOS_21_11_5_PORT.md +++ b/docs/CHIBIOS_21_11_5_PORT.md @@ -28,7 +28,12 @@ this port is marked ready. queue reset calls, time conversions, and thread diagnostics. - Update the project-local F303 ADC LLD while retaining its tinySA-specific behavior. -- Convert custom `BaseSequentialStream` VMTs to the current layout. +- Convert custom `BaseSequentialStream` VMTs to the current layout, including + the required `instance_offset` field. +- Preserve the legacy hard-FPU build's `-fsingle-precision-constant` behavior + explicitly. ChibiOS 21.11.x no longer adds it automatically; omitting it + promotes unsuffixed sweep constants to software double precision and causes + a measurable self-test sweep regression. ## Build