summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2025-05-28 14:28:02 +1000
committerDamien George <damien@micropython.org>2025-06-10 13:43:03 +1000
commit17951cee87d63bcc001fdaf1e669a74e6da4af29 (patch)
treeb1b28f53dde5c3ee1e52b6a5b81aa3934ead904f
parent718ff4fdd58efd3e853599b489640877070d17be (diff)
downloadmicropython-17951cee87d63bcc001fdaf1e669a74e6da4af29.tar.gz
micropython-17951cee87d63bcc001fdaf1e669a74e6da4af29.zip
py/dynruntime.mk: Enable single-precision float by default on armv6/7m.
Soft float now works on these ARM targets thanks to the parent commit. Signed-off-by: Damien George <damien@micropython.org>
-rw-r--r--examples/natmod/random/Makefile5
-rw-r--r--py/dynruntime.mk4
-rwxr-xr-xtools/ci.sh8
3 files changed, 10 insertions, 7 deletions
diff --git a/examples/natmod/random/Makefile b/examples/natmod/random/Makefile
index 5d23eac1e9..bffbb32d60 100644
--- a/examples/natmod/random/Makefile
+++ b/examples/natmod/random/Makefile
@@ -14,4 +14,9 @@ ifeq ($(ARCH),xtensa)
MPY_EXTERN_SYM_FILE=$(MPY_DIR)/ports/esp8266/boards/eagle.rom.addr.v6.ld
endif
+ifeq ($(ARCH),$(filter $(ARCH),armv6m armv7m))
+# Link with libm.a for soft-float helper functions
+LINK_RUNTIME = 1
+endif
+
include $(MPY_DIR)/py/dynruntime.mk
diff --git a/py/dynruntime.mk b/py/dynruntime.mk
index 84c78d6225..030728cfc9 100644
--- a/py/dynruntime.mk
+++ b/py/dynruntime.mk
@@ -63,14 +63,14 @@ else ifeq ($(ARCH),armv6m)
# thumb
CROSS = arm-none-eabi-
CFLAGS_ARCH += -mthumb -mcpu=cortex-m0
-MICROPY_FLOAT_IMPL ?= none
+MICROPY_FLOAT_IMPL ?= float
else ifeq ($(ARCH),armv7m)
# thumb
CROSS = arm-none-eabi-
CFLAGS_ARCH += -mthumb -mcpu=cortex-m3
-MICROPY_FLOAT_IMPL ?= none
+MICROPY_FLOAT_IMPL ?= float
else ifeq ($(ARCH),armv7emsp)
diff --git a/tools/ci.sh b/tools/ci.sh
index aafd6cc573..a5cd326c1c 100755
--- a/tools/ci.sh
+++ b/tools/ci.sh
@@ -561,13 +561,11 @@ function ci_native_mpy_modules_build {
make -C examples/natmod/$natmod ARCH=$arch
done
- # features2 requires soft-float on armv7m, rv32imc, and xtensa. On armv6m
- # the compiler generates absolute relocations in the object file
- # referencing soft-float functions, which is not supported at the moment.
+ # features2 requires soft-float on rv32imc and xtensa.
make -C examples/natmod/features2 ARCH=$arch clean
- if [ $arch = "rv32imc" ] || [ $arch = "armv7m" ] || [ $arch = "xtensa" ]; then
+ if [ $arch = "rv32imc" ] || [ $arch = "xtensa" ]; then
make -C examples/natmod/features2 ARCH=$arch MICROPY_FLOAT_IMPL=float
- elif [ $arch != "armv6m" ]; then
+ else
make -C examples/natmod/features2 ARCH=$arch
fi