From 7cce6436a142f680af7dc777d943fe06309349ff Mon Sep 17 00:00:00 2001 From: Jamie Smith Date: Sat, 6 Sep 2025 16:45:09 -0700 Subject: [PATCH 1/3] Builder tweaks to allow Mbed CE support --- platformio/builder/tools/piobuild.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/platformio/builder/tools/piobuild.py b/platformio/builder/tools/piobuild.py index 8ef2522cf7..43ad0df569 100644 --- a/platformio/builder/tools/piobuild.py +++ b/platformio/builder/tools/piobuild.py @@ -75,9 +75,18 @@ def BuildProgram(env): env.Prepend(_LIBFLAGS="-Wl,--start-group ") env.Append(_LIBFLAGS=" -Wl,--end-group") - program = env.Program(env.subst("$PROGPATH"), env["PIOBUILDFILES"]) + # PIO_FRAMEWORK_APPEND_OBJS can be set by the framework to add additional objects (and static libraries) + # into the link command for the application. + program_objects = env["PIOBUILDFILES"] + env["PIO_FRAMEWORK_APPEND_OBJS"] + program = env.Program(env.subst("$PROGPATH"), program_objects) env.Replace(PIOMAINPROG=program) + # PIO_EXTRA_APP_SOURCE_DEPS can be set to cause all application objects to depend on the given path(s). + app_source_deps = env.get("PIO_EXTRA_APP_SOURCE_DEPS", []) + for dep in app_source_deps: + for prog_obj in program_objects: + env.Depends(prog_obj, dep) + AlwaysBuild( env.Alias( "checkprogsize", From 2f5e08b5a3494ac88bc3946984ad75d9749f12b3 Mon Sep 17 00:00:00 2001 From: Jamie Smith Date: Sat, 6 Sep 2025 16:57:09 -0700 Subject: [PATCH 2/3] Rename --- platformio/builder/tools/piobuild.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/builder/tools/piobuild.py b/platformio/builder/tools/piobuild.py index 43ad0df569..526ed1ba4d 100644 --- a/platformio/builder/tools/piobuild.py +++ b/platformio/builder/tools/piobuild.py @@ -77,7 +77,7 @@ def BuildProgram(env): # PIO_FRAMEWORK_APPEND_OBJS can be set by the framework to add additional objects (and static libraries) # into the link command for the application. - program_objects = env["PIOBUILDFILES"] + env["PIO_FRAMEWORK_APPEND_OBJS"] + program_objects = env["PIOBUILDFILES"] + env["PIO_EXTRA_APP_OBJS"] program = env.Program(env.subst("$PROGPATH"), program_objects) env.Replace(PIOMAINPROG=program) From a69048c3284811c67783a60232193f4130e34ff4 Mon Sep 17 00:00:00 2001 From: Jamie Smith Date: Mon, 8 Sep 2025 08:27:42 -0700 Subject: [PATCH 3/3] Revert tweak 1 --- platformio/builder/tools/piobuild.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/platformio/builder/tools/piobuild.py b/platformio/builder/tools/piobuild.py index 526ed1ba4d..a8e8d3be59 100644 --- a/platformio/builder/tools/piobuild.py +++ b/platformio/builder/tools/piobuild.py @@ -75,16 +75,13 @@ def BuildProgram(env): env.Prepend(_LIBFLAGS="-Wl,--start-group ") env.Append(_LIBFLAGS=" -Wl,--end-group") - # PIO_FRAMEWORK_APPEND_OBJS can be set by the framework to add additional objects (and static libraries) - # into the link command for the application. - program_objects = env["PIOBUILDFILES"] + env["PIO_EXTRA_APP_OBJS"] - program = env.Program(env.subst("$PROGPATH"), program_objects) + program = env.Program(env.subst("$PROGPATH"), env["PIOBUILDFILES"]) env.Replace(PIOMAINPROG=program) # PIO_EXTRA_APP_SOURCE_DEPS can be set to cause all application objects to depend on the given path(s). app_source_deps = env.get("PIO_EXTRA_APP_SOURCE_DEPS", []) for dep in app_source_deps: - for prog_obj in program_objects: + for prog_obj in env["PIOBUILDFILES"]: env.Depends(prog_obj, dep) AlwaysBuild(