From cb702f414def21c8da32709a93b51d6a34d05415 Mon Sep 17 00:00:00 2001 From: valeros Date: Mon, 29 Jul 2024 18:04:48 +0300 Subject: [PATCH] Fix incorrect handling of positional linker flags Resolves #1430 --- builder/frameworks/espidf.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/builder/frameworks/espidf.py b/builder/frameworks/espidf.py index c488352c6..9c5158785 100644 --- a/builder/frameworks/espidf.py +++ b/builder/frameworks/espidf.py @@ -1595,7 +1595,9 @@ def get_python_exe(): # Extra flags which need to be explicitly specified in LINKFLAGS section because SCons # cannot merge them correctly -extra_flags = filter_args(link_args["LINKFLAGS"], ["-T", "-u"]) +extra_flags = filter_args( + link_args["LINKFLAGS"], ["-T", "-u", "-Wl,--start-group", "-Wl,--end-group"] +) link_args["LINKFLAGS"] = sorted(list(set(link_args["LINKFLAGS"]) - set(extra_flags))) # remove the main linker script flags '-T memory.ld'