HomeFreeBSD

Merge a bunch of googletest build improvements

Description

Merge a bunch of googletest build improvements

googletest: pick from upstream: Don't allow signed/unsigned wchar_t in gcc 9 and later

Pick 711fccf8317b4fb7adc21c00fc1e20823c5d875f from upstream googletest:

Don't allow signed/unsigned wchar_t in gcc 9 and later

Upstream pull request: https://github.com/google/googletest/pull/2270

Sponsored by: Dell EMC Isilon

(cherry picked from commit f157ca4696f5922275d5d451736005b9332eb136)

Major improvement to build parallelism for googletest internal tests

Currently the googletest internal tests build after the matching library.
However, each of these is serialized at the top level makefile.
Additionally some of the tests (e.g. the gmock-matches-test) take up to
90 seconds to build with clang -O2. Having to wait for this test to
complete before continuing to the next directory seriously slows down the
parllelism of a -j32 build.
Before this change running make -C lib/googletest -j32 -s in buildenv
took 202 seconds, now it's 153 due to improved parallelism.

Reviewed By: emaste (no objection)
Differential Revision: https://reviews.freebsd.org/D26748

(cherry picked from commit 2ed3236082a4473c1da8f72c1ebc071a7b54321f)

Enable SUBDIR_PARALLEL for lib/googletest

This saves a few seconds in a parallel build since we can build the
gtest_main and gmock subdirectories in parallel.

Reviewed By: ngie
Differential Revision: https://reviews.freebsd.org/D26760

(cherry picked from commit 4fa4bd6312cbeebda23a80feb77f29691af0cd7b)

Significantly reduce compile time for googletest internal tests

Clang's optimizer spends a really long time on these tests at -O2, so we now
use -O0 instead. This reduces the -j32 time for lib/googletest/test from 131s
to 29s. Using -O0 also reduces the disk usage from 144MB (at -O2) / 92MB (at
-O1) to 82MB.

Reviewed By: ngie, dim
Differential Revision: https://reviews.freebsd.org/D26751

(cherry picked from commit 433f33d285eee7cd6a822b9d833a537dfc808634)

Details

Provenance
dimAuthored on May 27 2021, 6:45 PM
Reviewer
emaste
Differential Revision
D26748: Major improvement to build parallelism for googletest internal tests
Parents
rG4234e5ee7644: scsi(4): fix "NMVe" typo
Branches
Unknown
Tags
Unknown