Skip to content

Commit

Permalink
Update pigweed to latest version (#17247)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
andy31415 authored and pull[bot] committed Nov 6, 2023
1 parent 5df3bdf commit a93d533
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
9 changes: 9 additions & 0 deletions build/config/compiler/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,15 @@ config("abi_default") {
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
Expand Down
5 changes: 5 additions & 0 deletions build/config/defaults.gni
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ declare_args() {
# 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 = []
}
Expand All @@ -105,6 +109,7 @@ default_configs += default_configs_aliasing
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 = []
Expand Down
5 changes: 5 additions & 0 deletions scripts/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ EOF
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() {
Expand Down
2 changes: 1 addition & 1 deletion third_party/pigweed/repo
Submodule repo updated 291 files

0 comments on commit a93d533

Please sign in to comment.