Commit Graph

11 Commits

Author SHA1 Message Date
Alexei Frolov
213060fd22
Move pw_build_host_tools var to host_common.gni
This change moves the pw_build_host_tools variable from host.gni to
host_common.gni, where it belongs.

Change-Id: I8f7188900344d9ce7cff33a99b8725d5347b9b02
2020-01-02 15:00:26 -08:00
Alexei Frolov
ca9cf604dc Add pw_host_tool GN template
This change cerates a GN template called pw_host_tool which copies a
binary target to a common host_tools directory that can be added to a
user's PATH.

Change-Id: I9eb38ab4ff9d11a4a87e6be2547d5224370e3412
2019-12-26 21:58:46 +00:00
Alexei Frolov
3fde6b116f pw_toolchain_size_report template
This change adds a GN template which creates a size report card across
a set of different toolchains. The toolchains are defined in a build
variable, each with an optional linker script and Bloaty config. The
size report template builds a base and diff executable with each of the
toolchains and compares the size difference of each.

Example output for the host target:

             simple_bloat_toolchain
             ──────────────────────
┌───────────┬─────────┬────────┬───────┬───────┐
│   Label   │ Segment │ Before │ Delta │ After │
├═══════════┼═════════┼════════┼═══════┼═══════┤
│   gcc -Og │    CODE │    413 │   +32 │   445 │
│           │     RAM │    576 │    +8 │   584 │
├───────────┼─────────┼────────┼───────┼───────┤
│   gcc -Os │    CODE │    429 │   +16 │   445 │
│           │     RAM │    576 │    +8 │   584 │
├───────────┼─────────┼────────┼───────┼───────┤
│   gcc -O2 │    CODE │    429 │   +32 │   461 │
│           │     RAM │    576 │    +8 │   584 │
├───────────┼─────────┼────────┼───────┼───────┤
│ clang -Og │    CODE │    448 │   +32 │   480 │
│           │     RAM │    113 │   +15 │   128 │
├───────────┼─────────┼────────┼───────┼───────┤
│ clang -Os │    CODE │    432 │   +16 │   448 │
│           │     RAM │    113 │   +15 │   128 │
├───────────┼─────────┼────────┼───────┼───────┤
│ clang -O2 │    CODE │    448 │   +80 │   528 │
│           │     RAM │    113 │   +15 │   128 │
└───────────┴─────────┴────────┴───────┴───────┘

Change-Id: I2c65f4d4f61354b9779628f207297eacd04470b9
2019-12-23 20:37:42 +00:00
Alexei Frolov
8403f0a2db Update test runner to run tests from metadata
This change adds functionality to the test runner script to search a
directory tree for generated test metadata files, build up a graph of
test groups, and run a user-specified list of groups with all of their
dependencies.

Tests are run through an external runner executable provided on the
command line. The executable is called with the path to a unit test
binary file.

The old test runner functionality to run a single test directly from its
binary path is maintained, but now uses a runner executable. This is
configured in GN using the build variable "pw_automatic_test_runner",
which replaces the functionality of "pw_unit_test_create_run_targets".

Change-Id: Ic1ed959d87a71266408e1f26e0ae1bf906eebfb0
2019-11-22 17:58:51 +00:00
Keir Mierle
49caa10484 Fix macOS build by adding bloaty config
This fixes the macOS host build by adding a bloaty config. However, the
bloaty config isn't quite right; followup work will be needed to decide
if it makes sense to have Mach-O bloat reports.

Change-Id: I4148c85d73a1b8dbd02b1772688259dbe59e950e
2019-11-20 22:38:17 +00:00
Armando Montanez
68de071c7d Add pw_dumb_io with host backend
This change introduces the pw_dumb_io module, a module intended for
pigweed testing and bringup. pw_dumb_io includes a facade, and a backend
implementation using stdio (pw_dumb_io_stdio).

Change-Id: I5d9ca3c256c7e7c6d60cc07292aaead808a7f3dd
2019-11-16 00:14:15 +00:00
Alexei Frolov
e2016763a8
Add pw_bloat module
This change adds a size reporting module named pw_bloat. The module
uses Bloaty McBloatface to generate size report cards for binaries. It
provides a GN template which defines an action to perform a size diff
on a group of binary targets.

Example output:

                       simple_bloat
                       ────────────
┌────────────────┬──────────────┬────────┬───────┬───────┐
│      Label     │    Segment   │ Before │ Delta │ After │
├════════════════┼══════════════┼════════┼═══════┼═══════┤
│     Add a loop │ EXAMPLE CODE │    429 │   +32 │   461 │
│                │ EXAMPLE  RAM │    576 │    +8 │   584 │
├────────────────┼──────────────┼────────┼───────┼───────┤
│ Add a function │ EXAMPLE CODE │    429 │   +16 │   445 │
│                │ EXAMPLE  RAM │    576 │    +8 │   584 │
└────────────────┴──────────────┴────────┴───────┴───────┘

Change-Id: I14b3d383ec450bc6d017bf5d0111e266b0a3c368
2019-11-14 14:29:28 -08:00
Wyatt Hepler
09517ed9b8 Have targets set pw_unit_test_create_run_targets
- Move pw_unit_test_create_run_targets to pw_vars_default.gni so that
  targets can set it.
- Keep the default false, but set it to true for the host targets.

Change-Id: Ia1af584642d0dd4d16b801b2ee4a8bb1a78c286e
2019-11-14 12:45:18 -08:00
Wyatt Hepler
cca0daf7b1 Clang toolchain Linux support
- Update host_clang to work on Linux: switch to -Map and --gc-sections
  options
- Make pw_target_toolchain a build arg for Linux and macOS targets.
  Default to gcc on Linux, clang on macOS.
- Rename x86_linux_gcc to host_gcc.

Change-Id: I72eef9ba9398a331f6567b68ad404092186eb15b
2019-11-14 12:34:15 -08:00
Keir Mierle
586719197a pw_toolchain: Start host_clang toolchain
This adds a generic host_clang toolchain, targeting hosts running Mac and
Linux to start, and likely Windows later.

For now, on Mac the default toolchain is set to host_clang_og

Change-Id: Iea457c61586930d509439c6616574c9a74919433
2019-11-14 18:26:54 +00:00
Alexei Frolov
e899dcf4a3 Start build target config files
This change defines the build target system used by Pigweed, where the
build is configured using per-target globals imported from a target .gni
file. A single build arg specifying the path to the target file replaces
the previous args.

A default build variables file is provided in the Pigweed root. This
file defines and documents all of the build variables used by Pigweed.

A top-level targets directory is added to define the targets used by
Pigweed developers. Currently, only a "host" target is added, which
configures the build for a development system based on the host OS.

Change-Id: Ie62b8d41e5789bfe7fffe20462160142c79076c4
2019-11-14 00:34:25 +00:00