Skip to content

Commit e990594

Browse files
jmartinez-silabsyyzhong-g
authored andcommitted
Fix efr32 test_driver build and make sure the linkerfile matches the target board (project-chip#35952)
1 parent 3d91e4b commit e990594

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

src/test_driver/efr32/BUILD.gn

+11
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,16 @@ efr32_sdk("sdk") {
6161
]
6262
}
6363

64+
config("efr32_ldflags") {
65+
_ldscript =
66+
"${chip_root}/examples/platform/silabs/ldscripts/${silabs_family}.ld"
67+
68+
ldflags = [
69+
"-T" + rebase_path(_ldscript, root_build_dir),
70+
"-Wl,--no-warn-rwx-segment",
71+
]
72+
}
73+
6474
# This is the test runner. `pw_test` will dep this for each `silabs_executable` target.
6575
source_set("efr32_test_main") {
6676
defines = [ "PW_RPC_ENABLED" ]
@@ -103,6 +113,7 @@ source_set("efr32_test_main") {
103113
]
104114

105115
include_dirs = [ "${chip_root}/examples/common/pigweed/efr32" ]
116+
public_configs = [ ":efr32_ldflags" ]
106117
}
107118

108119
# This target is referred to by BuildRoot in scripts/build/builders/efr32.py, as well as the example in README.md.

src/test_driver/efr32/args.gni

-8
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@
1515
import("//build_overrides/chip.gni")
1616
import("//build_overrides/pigweed.gni")
1717
import("${chip_root}/config/efr32/lib/pw_rpc/pw_rpc.gni")
18-
import("${chip_root}/examples/platform/silabs/args.gni")
1918
import("${chip_root}/src/platform/silabs/efr32/args.gni")
20-
import("${chip_root}/third_party/silabs/silabs_board.gni") # silabs_family
2119

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

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

0 commit comments

Comments
 (0)