Mark Mentovai f735d050c4 Port the util library to Linux
With this change, it is possible to build crashpad_util on Linux. I
built with clang 3.8.1 and GCC 6.2.0.

 - For per-OS “exception code” metrics, Android and Linux are broken out
   distinctly.
 - Because Linux provides no standard UUID generator, base::RandBytes()
   is used to generate random UUIDs for the InitializeWithNew() form.
 - Multiple fixes for CloseMultipleNowOrOnExec():
    - readdir_r() is deprecated in glibc 2.24. Use readdir() on Linux.
    - Linux does not have OPEN_MAX. Use the fs.nr_open sysctl (via
      /proc/sys) to determine the maximum (currently-configured)
      possible number of file descriptors per process.
    - Use the {CTL_KERN, KERN_MAXFILESPERPROC} sysctl on Mac to
      determine the maximum (currently-configured) possible number of
      file descriptors per process. This is an improvement over using
      OPEN_MAX, which is still consulted.
 - ThreadLogMessages’ use of DCHECK_EQ() needs an address-of operator on
   function pointers to avoid confusing GCC.

One problem remains:

 - util/misc/pdb_structures.h produces -Wmultichar errors. -Wmultichar
   is enabled by default with GCC (but not clang). It is impossible to
   disable this warning with #pragma GCC diagnostic ignored. See
   https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53431

This has not been tested beyond building the crashpad_util target.

BUG=crashpad:30

Change-Id: I02e7a05da512ca312806d825b3fc9b2c5bf1a990
Reviewed-on: https://chromium-review.googlesource.com/404009
Reviewed-by: Robert Sesek <rsesek@chromium.org>
2016-10-31 15:20:59 +00:00
..
2014-12-19 14:20:20 -05:00
2014-11-14 18:44:19 -05:00