Skip to content

Commit 59150e7

Browse files
authored
Simplify LTO management in Arduino build process
Removed LTO management for BUILD_FLAGS and related checks.
1 parent 10f4260 commit 59150e7

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

builder/frameworks/arduino.py

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -599,22 +599,11 @@ def has_psram_config():
599599
if has_unicore_flags():
600600
build_unflags += " -ustart_app_other_cores"
601601

602+
if '-fno-lto' in build_unflags:
603+
flag_lto = True
604+
602605
new_build_unflags = build_unflags.split()
603606
env.Replace(BUILD_UNFLAGS=new_build_unflags)
604-
605-
if not env.get('BUILD_FLAGS'): # Initialize if not set
606-
env['BUILD_FLAGS'] = []
607-
# Check if BUILD_FLAGS contains -flto=auto
608-
build_flags = env.get('BUILD_FLAGS', [])
609-
if isinstance(build_flags, str):
610-
build_flags = build_flags.split()
611-
612-
if '-flto=auto' in build_flags:
613-
# Remove -flto=auto from BUILD_FLAGS
614-
build_flags = [flag for flag in build_flags if flag != '-flto=auto']
615-
env.Replace(BUILD_FLAGS=build_flags)
616-
flag_lto = True
617-
print("*** Detected -flto=auto in BUILD_FLAGS, will apply LTO management ***")
618607

619608

620609
def get_MD5_hash(phrase):

0 commit comments

Comments
 (0)