Update pigweed to latest version (#17247)
* Update pigweed to latest version
* Some updates to add ld unused section removal and disable rosetta downloads
* Move gc sections config into separate default config
* Restyle
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index 7c66e96..8e868be 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -150,6 +150,15 @@
ldflags = cflags
}
+config("dead_code_elimination_default") {
+ # Delete unreferenced sections. Helpful with -ffunction-sections.
+ if (current_os == "mac" || current_os == "ios") {
+ ldflags = [ "-Wl,-dead_strip" ]
+ } else {
+ ldflags = [ "-Wl,--gc-sections" ]
+ }
+}
+
config("target_default") {
if (current_toolchain == default_toolchain) {
defines = target_defines
diff --git a/build/config/defaults.gni b/build/config/defaults.gni
index 45d6d49..a36b6f8 100644
--- a/build/config/defaults.gni
+++ b/build/config/defaults.gni
@@ -82,6 +82,10 @@
# Defaults target-specific configs.
default_configs_target = [ "${build_root}/config/compiler:target_default" ]
+ # Default configs for dead code elimination.
+ default_configs_dead_code =
+ [ "${build_root}/config/compiler:dead_code_elimination_default" ]
+
# Extra default configs.
default_configs_extra = []
}
@@ -105,6 +109,7 @@
default_configs += default_configs_sanitize
default_configs += default_configs_fuzzing
default_configs += default_configs_target
+default_configs += default_configs_dead_code
default_configs += default_configs_extra
executable_default_configs = []
diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh
index 36df1fd..ea8e67b 100644
--- a/scripts/bootstrap.sh
+++ b/scripts/bootstrap.sh
@@ -58,6 +58,11 @@
PW_ROOT="$_CHIP_ROOT/third_party/pigweed/repo"
export PW_ROOT
+ # Do not force use Rosetta in Pigweed because Matter is using host toolchain
+ if [ -z "$PW_BOOTSTRAP_USE_ROSETTA" ]; then
+ export PW_BOOTSTRAP_USE_ROSETTA=false
+ fi
+
. "$_CHIP_ROOT/third_party/pigweed/repo/pw_env_setup/util.sh"
_chip_bootstrap_banner() {
diff --git a/third_party/pigweed/repo b/third_party/pigweed/repo
index 67506a1..bf74197 160000
--- a/third_party/pigweed/repo
+++ b/third_party/pigweed/repo
@@ -1 +1 @@
-Subproject commit 67506a1a4487c7fb1306bedc391883ec58841522
+Subproject commit bf7419765c046936297341b28c89d419971506ec