Skip to content

Commit

Permalink
Create strip-flags.py
Browse files Browse the repository at this point in the history
  • Loading branch information
gemu2015 committed Jun 27, 2024
1 parent 65a3928 commit 413f9c4
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pio-tools/strip-flags.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Import('env')

link_flags = env['LINKFLAGS']
build_flags = " ".join(env['BUILD_FLAGS'])

if "FIRMWARE_SAFEBOOT" in build_flags:
# Crash Recorder is not included in safeboot firmware -> remove Linker wrap
try:
link_flags.pop(link_flags.index("-Wl,--wrap=panicHandler"))
except:
do_nothing=""
try:
link_flags.pop(link_flags.index("-Wl,--wrap=xt_unhandled_exception"))
except:
do_nothing=""

0 comments on commit 413f9c4

Please sign in to comment.