Instrumented libraries for dynamic tools
Only Ubuntu Trusty x86_64 is supported at this time.
Sanitizer tools rely on compile-time instrumentation. However, Chromium code may call into system-installed third-party shared libraries, which were not built with the appropriate instrumentation. This is a problem:
- bugs in third-party libraries, which may affect Chromium, go undetected,
- certain Chromium bugs may go undetected (e.g. passing an invalid buffer to third-party code),
- MemorySanitizer generates lots of bogus reports, which makes it unusable. This happens because MSan doesn't recognize any memory initialization which happens in uninstrumented code.
To avoid this issue, we've made it possible to make Chromium use sanitizer-instrumented versions of third-party DSOs. By setting a GYP flag, you can either have them built from source during Chromium build, or download pre-built binaries from Google Storage. The list contains ~50 third-party packages, which should cover most of the DSO dependencies of Chrome and tests (enough at least to run MSan without bogus reports).
Follow the MemorySanitizer instructions.
Note that we don't provide pre-built binaries for every configuration. At this
point in time only MSan is supported, with
msan_track_origins either 0 or 2.
First you need to install build dependencies:
Additionally, if you have gccgo installed, you probably want to remove it with:
sudo apt-get remove --purge gccgo-4.9
With this package installed, running clang++ gives the error cannot find -lstdc++.
To build instrumented libraries from source, add
args.gn. This will add ~50
extra steps to the build. Each step runs a script which does the following:
- checks out a specific package with
- maybe applies a Chromium-specific patch,
- builds the package using
- installs the shared libraries into
- copies the source archives to
GOMA is supported (just add
You'll need to ping earthdok@ or glider@ to do this. The information below is for reference.
To add a new package, you need to do the following:
- get OSS compliance approval,
- add a new target to
- add the package to
- make sure it builds and works on Trusty (i.e. where applicable),
- update the pre-built binaries.
Usually you want to use the same configure flags that
To rebuild the binaries, run:
The entire process will take several hours. For that reason, it is recommended to use --parallel to build all configs concurrently, and -j96 (or whatever value you prefer) to build multiple packages concurrently.
It's a good idea to not do this on Goobuntu. We have a couple GCE instances configured for this. You can also build in an Ubuntu VM.
After uploading the archives to GCS as the script instructs, you'll get several
.sha1 files. You should commit those under