mirror of
https://github.com/arendst/Tasmota.git
synced 2026-07-27 20:05:46 +00:00
redirect the floating-point capable vfprintf / vfscanf symbols to picolibc's integer-only variant (#24720)
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
#
|
||||
# Picolibc-specific linker flags.
|
||||
#
|
||||
# When the Arduino ESP32 framework is built against picolibc (detected via
|
||||
# `-specs=picolibc.specs`), redirect the floating-point capable vfprintf / vfscanf
|
||||
# symbols to picolibc's integer-only variants (__i_vfprintf / __i_vfscanf).
|
||||
# This drops the float/double formatting code path from the firmware and saves
|
||||
# a noticeable amount of flash.
|
||||
#
|
||||
|
||||
Import("env")
|
||||
|
||||
|
||||
def _picolibc_in_use(env):
|
||||
for var in ("CCFLAGS", "CFLAGS", "CXXFLAGS", "LINKFLAGS"):
|
||||
for flag in env.get(var, []):
|
||||
if "picolibc.specs" in str(flag):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
if _picolibc_in_use(env):
|
||||
env.Append(LINKFLAGS=[
|
||||
"-Wl,--defsym=vfprintf=__i_vfprintf",
|
||||
"-Wl,--defsym=vfscanf=__i_vfscanf",
|
||||
])
|
||||
@@ -49,6 +49,7 @@ lib_ignore =
|
||||
ArduinoOTA
|
||||
extra_scripts = pre:pio-tools/add_c_flags.py
|
||||
pre:pio-tools/solidify-from-url.py
|
||||
post:pio-tools/picolibc_flags.py
|
||||
post:pio-tools/dump-defines.py
|
||||
post:pio-tools/gen-berry-defines.py
|
||||
post:pio-tools/gen-berry-structures.py
|
||||
@@ -103,4 +104,3 @@ platform = https://github.com/tasmota/platform-espressif32/re
|
||||
platform_packages =
|
||||
build_unflags = ${esp32_defaults.build_unflags}
|
||||
build_flags = ${esp32_defaults.build_flags}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user