The default printf and family will now not implement FPU support, a second copy of the routines will be generated with the _float suffix. ie, printf() has no %f support, but printf_float() does. This is to avoid the default printf from emitting any floating point instructions when used within core kernel code which has been an off and on problem for years, especially on architectures that are eager to use fpu/vector instructions for regular non-fpu code. If FPU is not implemented on the arch, the *_float routines will alias to the integer only one. Perhaps a much more proper solution is to invert this and require every caller of printf that cannot tolerate fpu codegen (which in mainline is most of it) use a _nofloat implementation, but this would touch pratically all printfs in mainline. This solution acknowledges that for the most part most of the code in mainline is in-kernel support code, and doesn't need floating point, except for perhaps some app/* code, which already can opt in. This solution also can potentially bloat the size of the binary by having two complete implementations, though I think in practice the architectures where the extra few KB of code will matter generally dont have FPU support, or aren't using it. In the latter case the link-time-gc should remove unused _float routines.
39 lines
718 B
Makefile
39 lines
718 B
Makefile
LOCAL_DIR := $(GET_LOCAL_DIR)
|
|
|
|
MODULE := $(LOCAL_DIR)
|
|
|
|
MODULE_DEPS := \
|
|
lib/heap \
|
|
lib/io
|
|
|
|
MODULE_SRCS += \
|
|
$(LOCAL_DIR)/abort.c \
|
|
$(LOCAL_DIR)/atexit.c \
|
|
$(LOCAL_DIR)/atoi.c \
|
|
$(LOCAL_DIR)/bsearch.c \
|
|
$(LOCAL_DIR)/ctype.c \
|
|
$(LOCAL_DIR)/eabi.c \
|
|
$(LOCAL_DIR)/errno.c \
|
|
$(LOCAL_DIR)/printf.c \
|
|
$(LOCAL_DIR)/qsort.c \
|
|
$(LOCAL_DIR)/rand.c \
|
|
$(LOCAL_DIR)/stdio.c \
|
|
$(LOCAL_DIR)/strtol.c \
|
|
$(LOCAL_DIR)/strtoll.c \
|
|
|
|
MODULE_FLOAT_SRCS += \
|
|
$(LOCAL_DIR)/printf_float.c \
|
|
$(LOCAL_DIR)/atof.c \
|
|
|
|
MODULE_COMPILEFLAGS += -fno-builtin
|
|
|
|
MODULE_OPTIONS := extra_warnings
|
|
|
|
ifeq ($(call TOBOOL,$(WITH_TESTS)),true)
|
|
MODULE_DEPS += $(LOCAL_DIR)/test
|
|
endif
|
|
|
|
include $(LOCAL_DIR)/string/rules.mk
|
|
|
|
include make/module.mk
|