Skip to content

Commit

Permalink
Merge pull request #2694 from particle-iot/feature/printf-i-long-long
Browse files Browse the repository at this point in the history
[services] add long long support to printf/scanf
  • Loading branch information
avtolstoy authored and technobly committed Sep 19, 2023
1 parent ba32c48 commit e556939
Show file tree
Hide file tree
Showing 8 changed files with 1,306 additions and 2 deletions.
8 changes: 6 additions & 2 deletions build/arm-tools.mk
Expand Up @@ -9,6 +9,12 @@ include $(COMMON_BUILD)/common-tools.mk

AR = $(GCC_ARM_PATH)$(GCC_PREFIX)gcc-ar

# Newlib has a bug in fake stdin/stdout/stderr implementation and leaks memory
# Stub printf/fprintf out, override printf/scanf for 64-bit int/unsigned support
CFLAGS += -fno-builtin-puts -fno-builtin-printf -Wl,--wrap=puts -Wl,--wrap=printf
CFLAGS += -Wl,--wrap=_printf_i -Wl,--wrap=_svfprintf_r
CFLAGS += -Wl,--wrap=_scanf_i -Wl,--wrap=__ssvfscanf_r

#
# default flags for targeting ARM Cortex-M3
#
Expand Down Expand Up @@ -55,8 +61,6 @@ endif
#
# -fno-use-cxa-atexit makes sure that destructors for statically created C++ objects are never called,
# which saves us some flash space.
CPPFLAGS += -flto -ffat-lto-objects -DPARTICLE_COMPILE_LTO_FAT -fno-use-cxa-atexit
CONLYFLAGS += -flto -ffat-lto-objects -DPARTICLE_COMPILE_LTO_FAT
LDFLAGS += -fno-use-cxa-atexit

ifeq ($(COMPILE_LTO),y)
Expand Down

0 comments on commit e556939

Please sign in to comment.