Skip to content

Commit

Permalink
Make sure to relink executables after linker script changes (#6301)
Browse files Browse the repository at this point in the history
The linker script is passed in ldflags, which isn't tracked
automatically, so incremental builds don't re-trigger linking correctly
when it changes.

Add it to inputs to force a re-link if the timestamp changes.
  • Loading branch information
mspang authored Apr 28, 2021
1 parent 5886ff7 commit e2b2f30
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/lighting-app/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ efr32_executable("lighting_app") {
ldscript = "${examples_plat_dir}/ldscripts/efr32-MG21.ld"
}

inputs = [ ldscript ]

ldflags = [ "-T" + rebase_path(ldscript, root_build_dir) ]

if (chip_print_memory_usage) {
Expand Down
2 changes: 2 additions & 0 deletions examples/lighting-app/k32w/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ k32w_executable("light_app") {

ldscript = "${k32w_platform_dir}/app/ldscripts/chip-k32w061-linker.ld"

inputs = [ ldscript ]

ldflags = [ "-T" + rebase_path(ldscript, root_build_dir) ]

output_dir = root_out_dir
Expand Down
2 changes: 2 additions & 0 deletions examples/lighting-app/qpg6100/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ qpg6100_executable("lighting_app") {

ldscript = "${qpg6100_sdk_root}/qpg6100/ldscripts/chip-qpg6100-example.ld"

inputs = [ ldscript ]

ldflags = [ "-T" + rebase_path(ldscript, root_build_dir) ]

output_dir = root_out_dir
Expand Down
2 changes: 2 additions & 0 deletions examples/lock-app/cc13x2x7_26x2x7/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ ti_simplelink_executable("lock_app") {

ldscript = "${ti_simplelink_sdk_root}/source/ti/dmm/apps/common/freertos/cc13x2x7_cc26x2x7.lds"

inputs = [ ldscript ]

ldflags = [
"-L${ti_simplelink_sdk_root}/source",
rebase_path("${target_gen_dir}/sysconfig/ti_utils_build_linker.cmd.genlibs",
Expand Down
2 changes: 2 additions & 0 deletions examples/lock-app/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ efr32_executable("lock_app") {

ldflags = [ "-T" + rebase_path(ldscript, root_build_dir) ]

inputs = [ ldscript ]

if (chip_print_memory_usage) {
ldflags += [
"-Wl,--print-memory-usage",
Expand Down
2 changes: 2 additions & 0 deletions examples/lock-app/k32w/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ k32w_executable("lock_app") {

ldscript = "${k32w_platform_dir}/app/ldscripts/chip-k32w061-linker.ld"

inputs = [ ldscript ]

ldflags = [ "-T" + rebase_path(ldscript, root_build_dir) ]
}

Expand Down
2 changes: 2 additions & 0 deletions examples/lock-app/qpg6100/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ qpg6100_executable("lock_app") {

ldscript = "${qpg6100_sdk_root}/qpg6100/ldscripts/chip-qpg6100-example.ld"

inputs = [ ldscript ]

ldflags = [ "-T" + rebase_path(ldscript, root_build_dir) ]

output_dir = root_out_dir
Expand Down
2 changes: 2 additions & 0 deletions examples/persistent-storage/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ efr32_executable("persistent_storage") {
ldscript = "${examples_plat_dir}/ldscripts/efr32-MG21.ld"
}

inputs = [ ldscript ]

ldflags = [ "-T" + rebase_path(ldscript, root_build_dir) ]

output_dir = root_out_dir
Expand Down
2 changes: 2 additions & 0 deletions examples/persistent-storage/qpg6100/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ qpg6100_executable("persistent_storage") {

ldscript = "${qpg6100_sdk_root}/qpg6100/ldscripts/chip-qpg6100-example.ld"

inputs = [ ldscript ]

ldflags = [ "-T" + rebase_path(ldscript, root_build_dir) ]
}

Expand Down
2 changes: 2 additions & 0 deletions examples/pigweed-app/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ efr32_executable("pigweed_app") {
ldscript = "${examples_plat_dir}/ldscripts/efr32-MG21.ld"
}

inputs = [ ldscript ]

ldflags = [ "-T" + rebase_path(ldscript, root_build_dir) ]

output_dir = root_out_dir
Expand Down
2 changes: 2 additions & 0 deletions examples/window-app/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ efr32_executable("window_app") {
ldscript = "${examples_plat_dir}/ldscripts/efr32-MG21.ld"
}

inputs = [ ldscript ]

ldflags = [ "-T" + rebase_path(ldscript, root_build_dir) ]

if (chip_print_memory_usage) {
Expand Down

0 comments on commit e2b2f30

Please sign in to comment.