Skip to content

Commit 8765f6f

Browse files
authored
refactor circle command linker fix "--start..."
1 parent 2ebdc63 commit 8765f6f

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

builder/frameworks/espidf.py

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1523,7 +1523,9 @@ def get_python_exe():
15231523

15241524
# Extra flags which need to be explicitly specified in LINKFLAGS section because SCons
15251525
# cannot merge them correctly
1526-
extra_flags = filter_args(link_args["LINKFLAGS"], ["-T", "-u"])
1526+
extra_flags = filter_args(
1527+
link_args["LINKFLAGS"], ["-T", "-u", "-Wl,--start-group", "-Wl,--end-group"]
1528+
)
15271529
link_args["LINKFLAGS"] = sorted(list(set(link_args["LINKFLAGS"]) - set(extra_flags)))
15281530

15291531
# remove the main linker script flags '-T memory.ld'
@@ -1534,19 +1536,6 @@ def get_python_exe():
15341536
except:
15351537
print("Warning! Couldn't find the main linker script in the CMake code model.")
15361538

1537-
# remove circle linker commands
1538-
try:
1539-
link_args_index = link_args["LINKFLAGS"].index("-Wl,--start-group")
1540-
link_args["LINKFLAGS"].pop(link_args_index)
1541-
except:
1542-
pass
1543-
1544-
try:
1545-
link_args_index = link_args["LINKFLAGS"].index("-Wl,--end-group")
1546-
link_args["LINKFLAGS"].pop(link_args_index)
1547-
except:
1548-
pass
1549-
15501539
#
15511540
# Process project sources
15521541
#

0 commit comments

Comments
 (0)