Skip to content

Commit

Permalink
Fix efr32 test_driver build and make sure the linkerfile matches the …
Browse files Browse the repository at this point in the history
…target board (project-chip#35952)
  • Loading branch information
jmartinez-silabs authored Oct 7, 2024
1 parent 7fd3d59 commit 52a5589
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
11 changes: 11 additions & 0 deletions src/test_driver/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@ efr32_sdk("sdk") {
]
}

config("efr32_ldflags") {
_ldscript =
"${chip_root}/examples/platform/silabs/ldscripts/${silabs_family}.ld"

ldflags = [
"-T" + rebase_path(_ldscript, root_build_dir),
"-Wl,--no-warn-rwx-segment",
]
}

# This is the test runner. `pw_test` will dep this for each `silabs_executable` target.
source_set("efr32_test_main") {
defines = [ "PW_RPC_ENABLED" ]
Expand Down Expand Up @@ -103,6 +113,7 @@ source_set("efr32_test_main") {
]

include_dirs = [ "${chip_root}/examples/common/pigweed/efr32" ]
public_configs = [ ":efr32_ldflags" ]
}

# This target is referred to by BuildRoot in scripts/build/builders/efr32.py, as well as the example in README.md.
Expand Down
8 changes: 0 additions & 8 deletions src/test_driver/efr32/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
import("//build_overrides/chip.gni")
import("//build_overrides/pigweed.gni")
import("${chip_root}/config/efr32/lib/pw_rpc/pw_rpc.gni")
import("${chip_root}/examples/platform/silabs/args.gni")
import("${chip_root}/src/platform/silabs/efr32/args.gni")
import("${chip_root}/third_party/silabs/silabs_board.gni") # silabs_family

silabs_sdk_target = get_label_info(":sdk", "label_no_toolchain")

Expand Down Expand Up @@ -46,9 +44,3 @@ pw_unit_test_MAIN = "//:efr32_test_main"
# Additional variables needed by silabs_executable that must be passed in to pw_test.
test_executable_output_name = "matter-silabs-device_tests-"
test_executable_output_name_suffix = ".out"
_ldscript =
"${chip_root}/examples/platform/silabs/ldscripts/${silabs_family}.ld"
test_executable_ldflags = [
"-T" + rebase_path(_ldscript, root_build_dir),
"-Wl,--no-warn-rwx-segment",
]

0 comments on commit 52a5589

Please sign in to comment.