py/dynruntime.mk: Fix use of musl's libm.a when LINK_RUNTIME=1.

Like PICOLIBC, MUSL also has its math functions in libc.a.  There is a
libm.a, but it's empty.

Signed-off-by: dubiousjim <dubiousjim@gmail.com>
This commit is contained in:
dubiousjim
2025-03-20 05:55:55 -04:00
committed by Damien George
parent 27f4351f5f
commit ba4179bb66

View File

@@ -124,6 +124,10 @@ else
$(error architecture '$(ARCH)' not supported)
endif
ifneq ($(findstring -musl,$(shell $(CROSS)gcc -dumpmachine)),)
USE_MUSL := 1
endif
MICROPY_FLOAT_IMPL_UPPER = $(shell echo $(MICROPY_FLOAT_IMPL) | tr '[:lower:]' '[:upper:]')
CFLAGS += $(CFLAGS_ARCH) -DMICROPY_FLOAT_IMPL=MICROPY_FLOAT_IMPL_$(MICROPY_FLOAT_IMPL_UPPER)
@@ -147,6 +151,8 @@ ifeq ($(LINK_RUNTIME),1)
# distribution.
ifeq ($(USE_PICOLIBC),1)
LIBM_NAME := libc.a
else ifeq ($(USE_MUSL),1)
LIBM_NAME := libc.a
else
LIBM_NAME := libm.a
endif