Skip to content

Commit

Permalink
pio: missing scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
mcspr committed Aug 30, 2022
1 parent f3d4a4a commit e8e9c15
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions code/scripts/espurna_utils/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Override functions after build b/c neither runtime (api) or build (flags, order, etc.) has any way to do so
def disable_postmortem_output(env):
env.AddPostAction(
"$BUILD_DIR/FrameworkArduino/core_esp8266_postmortem.cpp.o",
env.VerboseAction(
"$OBJCOPY"
" --redefine-sym ets_printf=__stub_printf"
" --redefine-sym ets_printf_P=__stub_printf_P"
" --redefine-sym ets_putc=__stub_putc"
" $TARGET",
"Overriding POSTMORTEM print functions from $TARGET",
),
)


# newlib internal printf implementation declares these as weak, and neither symbol
# is exported in a way that usual build picks them up. remove implicit definitions
# to exclude them from the build completely
def remove_float_support(env):
flags = " ".join(env["LINKFLAGS"])
flags = flags.replace("-u _printf_float", "")
flags = flags.replace("-u _scanf_float", "")
newflags = flags.split()

env.Replace(LINKFLAGS=newflags)

0 comments on commit e8e9c15

Please sign in to comment.