From d27b674d1a44ea43782b19f7ba3e6ce8d3269503 Mon Sep 17 00:00:00 2001 From: Alexei Frolov Date: Wed, 19 Aug 2020 10:54:56 -0700 Subject: [PATCH] docs: Use stm32f429i-disc1 toolchain This updates the upstream docs target to use the disco toolchain instead of a custom one, to produce more accurate size reports for an actual board configuration. Change-Id: I50e6d03322273d33e34b4114d74b5bb9dc5f1c6a Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/16285 Reviewed-by: Keir Mierle Commit-Queue: Alexei Frolov --- pw_bloat/bloat.gni | 10 ++++------ targets/docs/BUILD.gn | 30 ++++-------------------------- 2 files changed, 8 insertions(+), 32 deletions(-) diff --git a/pw_bloat/bloat.gni b/pw_bloat/bloat.gni index 14e64a4e0..8b5436a65 100644 --- a/pw_bloat/bloat.gni +++ b/pw_bloat/bloat.gni @@ -113,9 +113,9 @@ template("pw_size_report") { # Allow each binary to override the global bloaty config. if (defined(binary.bloaty_config)) { - _bloaty_configs += [ get_path_info(binary.bloaty_config, "abspath") ] + _bloaty_configs += [ rebase_path(binary.bloaty_config) ] } else { - _bloaty_configs += [ get_path_info(pw_bloat_BLOATY_CONFIG, "abspath") ] + _bloaty_configs += [ rebase_path(pw_bloat_BLOATY_CONFIG) ] } _binary_path += ";" + "" @@ -128,7 +128,7 @@ template("pw_size_report") { "--bloaty-config", string_join(";", _bloaty_configs), "--out-dir", - target_gen_dir, + rebase_path(target_gen_dir), "--target", target_name, "--title", @@ -150,9 +150,7 @@ template("pw_size_report") { _doc_rst_output = "$target_gen_dir/${target_name}" - # TODO(frolv): Size reports are temporarily disabled pending the toolchain - # refactor. - if (true || host_os == "win") { + if (host_os == "win") { # Bloaty is not yet packaged for Windows systems; display a message # indicating this. not_needed("*") diff --git a/targets/docs/BUILD.gn b/targets/docs/BUILD.gn index 72b68fef1..b98a20ce3 100644 --- a/targets/docs/BUILD.gn +++ b/targets/docs/BUILD.gn @@ -15,48 +15,26 @@ # gn-format disable import("//build_overrides/pigweed.gni") +import("$dir_pigweed/targets/stm32f429i-disc1/target_toolchains.gni") import("$dir_pw_docgen/docs.gni") import("$dir_pw_toolchain/arm_gcc/toolchains.gni") import("$dir_pw_toolchain/generate_toolchain.gni") # Toolchain for generating upstream Pigweed documentation. generate_toolchain("docs") { - # Use the Cortex M4 toolchain for regular pw_size_report targets. - forward_variables_from(pw_toolchain_arm_gcc.cortex_m4_size_optimized, + # Use the stm32f429i-disc1 toolchain for pw_size_report targets. + _base_toolchain = pw_target_toolchain_stm32f429i_disc1.size_optimized + forward_variables_from(_base_toolchain, "*", [ "defaults", "name", ]) defaults = { - _base_toolchain = pw_toolchain_arm_gcc.cortex_m4_size_optimized forward_variables_from(_base_toolchain.defaults, "*") # This is the docs target. pw_docgen_BUILD_DOCS = true - - _arm_bloaty_config = "$dir_pw_boot_armv7m/bloaty_config.bloaty" - - pw_bloat_BLOATY_CONFIG = _arm_bloaty_config - - # Toolchains to compare in documentation size reports. - pw_bloat_TOOLCHAINS = [ - { - name = "arm-none-eabi-gcc -Og -mcpu=cortex-m4" - target = "$dir_pw_toolchain:arm_gcc_cortex_m4_debug" - bloaty_config = _arm_bloaty_config - }, - { - name = "arm-none-eabi-gcc -Os -mcpu=cortex-m4" - target = "$dir_pw_toolchain:arm_gcc_cortex_m4_size_optimized" - bloaty_config = _arm_bloaty_config - }, - { - name = "arm-none-eabi-gcc -O2 -mcpu=cortex-m4" - target = "$dir_pw_toolchain:arm_gcc_cortex_m4_speed_optimized" - bloaty_config = _arm_bloaty_config - }, - ] } }