compat: Provide <elf.h> and <mach-o/loader.h> for everyone

I’m working on something that I’m not ready to share, but maintaining
these compat headers in my local branch is becoming annoying because
“git cl format” keeps reformatting them since they were added since my
local branch point.

Because these headers are non-trivial, they’re brought nearly unmodified
from upstream into third_party, with forwarding from the appropriate
locations in compat.

<elf.h> comes from glibc 2.29 (2019-01-31) and was modified to remove
the #include of <features.h> and to replace the use of __BEGIN_DECLS and
__END_DECLS with the proper conditional extern "C" construct.

<mach-o/loader.h> comes from xnu 4903.221.2 (macOS 10.14.1, 2018-10-30)
and was modified to remove the unused #includes of
<mach/machine/thread_status.h> and <architecture/byte_order.h>. Rather
than taking <mach/machine.h> and <mach/vm_prot.h> with a spider web of
other dependencies from xnu, compat has cut-back versions of these
headers that provide only the required typedefs.

This also includes an update of apple_cf to 1153.18 (OS X 10.10.3,
2015-04-08), the last public release of CF-Lite. The change doesn’t do
much for our purposes, but it restores the file to an Apple-shipped
state, trailing whitespace and all.

This also canonically formats 48ee086ca4c4c didn’t format it.

Change-Id: Ib4f28ad53d9757bd0eed838e148c51172bfe30b1
Reviewed-by: Robert Sesek <>
Commit-Queue: Mark Mentovai <>
16 files changed
tree: bce6b3264c58defd78a6d21cffaee7cda9088172
  1. .clang-format
  2. .gitignore
  3. .gn
  4. .vpython
  8. DEPS
  11. build/
  12. client/
  13. codereview.settings
  14. compat/
  15. crashpad.gyp
  16. doc/
  17. handler/
  18. infra/
  19. minidump/
  21. package.h
  22. snapshot/
  23. test/
  24. third_party/
  25. tools/
  26. util/


Crashpad is a crash-reporting system.


Source Code

Crashpad’s source code is hosted in a Git repository at

Other Links