File tree Expand file tree Collapse file tree 2 files changed +21
-16
lines changed
Expand file tree Collapse file tree 2 files changed +21
-16
lines changed Original file line number Diff line number Diff line change 11Import ("env" )
22
3+ build_flags = env ['BUILD_FLAGS' ]
4+ chip = env .get ("BOARD_MCU" ).lower ()
5+
36# General options that are passed to the C++ compiler
47env .Append (CXXFLAGS = ["-Wno-volatile" ])
58
69# General options that are passed to the C compiler (C only; not C++).
710env .Append (CFLAGS = ["-Wno-discarded-qualifiers" , "-Wno-implicit-function-declaration" , "-Wno-incompatible-pointer-types" ])
811
9-
1012# Remove build flags which are not valid for risc-v
11- build_flags = env ['BUILD_FLAGS' ]
12- chip = env .get ("BOARD_MCU" ).lower ()
13-
14- if "c" in chip :
15- build_flags .pop (build_flags .index ("-mno-target-align" ))
16- build_flags .pop (build_flags .index ("-mtarget-align" ))
13+ if chip in ("esp32c2" , "esp32c3" , "esp32c6" , "esp32h2" ):
14+ try :
15+ build_flags .pop (build_flags .index ("-mno-target-align" ))
16+ except :
17+ do_nothing = ""
18+ try :
19+ build_flags .pop (build_flags .index ("-mtarget-align" ))
20+ except :
21+ do_nothing = ""
Original file line number Diff line number Diff line change 11Import ('env' )
22
3- link_flags = " " . join ( env ['LINKFLAGS' ])
3+ link_flags = env ['LINKFLAGS' ]
44build_flags = " " .join (env ['BUILD_FLAGS' ])
55
66if "FIRMWARE_SAFEBOOT" in build_flags :
77 # Crash Recorder is not included in safeboot firmware -> remove Linker wrap
8- link_flags = link_flags . replace ( "-Wl,--wrap=panicHandler" , "" )
9- link_flags = link_flags .replace ( "-Wl,--wrap=xt_unhandled_exception" , "" )
10-
11- new_link_flags = link_flags . split ()
12-
13- env . Replace (
14- LINKFLAGS = new_link_flags
15- )
8+ try :
9+ link_flags .pop ( link_flags . index ( "-Wl,--wrap=panicHandler" ) )
10+ except :
11+ do_nothing = ""
12+ try :
13+ link_flags . pop ( link_flags . index ( "-Wl,--wrap=xt_unhandled_exception" ))
14+ except :
15+ do_nothing = ""
You can’t perform that action at this time.
0 commit comments