17 Commits

Author SHA1 Message Date
Hzj_jie
25c079d731 [Fuchsia] Run fuchsia-gn-sdk from chromium
The latest build rules have the ffuchsia-api-level.
Need https://crrev.com/c/5586319.

Bug: fuchsia:42085580, fuchsia:327691011
Change-Id: I21383e02f9fff3db9405c0dbe42051122a325003
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5585353
Commit-Queue: Zijie He <zijiehe@google.com>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2024-06-05 23:10:01 +00:00
Mark Mentovai
6278690abe Update copyright boilerplate, 2022 edition (Crashpad)
sed -i '' -E -e 's/Copyright (.+) The Crashpad Authors\. All rights reserved\.$/Copyright \1 The Crashpad Authors/' $(git grep -El 'Copyright (.+) The Crashpad Authors\. All rights reserved\.$')

Bug: chromium:1098010
Change-Id: I8d6138469ddbe3d281a5d83f64cf918ec2491611
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3878262
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
2022-09-06 23:54:07 +00:00
Scott Graham
e6b525a4be Update config adjustments for moved build config in mini_chromium
Includes DEPS roll of mini_chromium:
f0bd14b Pull build_config.h source set into separate build file
65fb5c9 Update path to win_helper after moving to build/config

Change-Id: Ic9f5c68e2cebd8bf86492766684bdb422da1aa9e
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2426989
Reviewed-by: Mark Mentovai <mark@chromium.org>
2020-09-23 22:12:16 +00:00
Mark Mentovai
fd001f792e build: Make crashpad_dependencies="external" work in the GN build
…for macOS, at least.

Change-Id: Iba45328d957de17198180d171677a45468c9adc2
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2290842
Reviewed-by: Eric Astor <epastor@google.com>
Commit-Queue: Mark Mentovai <mark@chromium.org>
2020-07-11 03:33:33 +00:00
Scott Graham
50aa576622 Disable implicit fallthrough warning for zlib
https://logs.chromium.org/logs/crashpad/buildbucket/cr-buildbucket.appspot.com/8903960674082840512/+/steps/compile_with_ninja/0/stdout

I don't understand how this lingered for so long as I can't see what
changed. mini_chromium has had -Wimplicit-fallthough enabled for a long
time (https://chromium-review.googlesource.com/899847), and zlib DEPS
hasn't changed in a long time either
(https://chromium-review.googlesource.com/438585).

The most likely would presumably be that the compiler started
not-ignoring the enabling of the warning? But that doesn't seem too
likely either.

Bug: crashpad:309
Change-Id: I57480cc3f669ef94d0234afaf980281b7ddf8c51
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1772205
Commit-Queue: Scott Graham <scottmg@chromium.org>
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2019-08-27 19:18:05 +00:00
Scott Graham
9a97daff39 Add libfuzzer support
Adds the build support for using libfuzzer controlled by setting
`crashpad_use_libfuzzer=true`.

Also adds a first fuzzer (for ElfImageReader). Currently only runs on
Linux, but should work on Fuchsia too with some minor fixes (not sure
yet whether the fixes required are toolchain or in our build setup).

Run as:
  out/lin/elf_image_reader_fuzzer snapshot/elf/elf_image_reader_fuzzer_corpus/
hits an OOM pretty quickly in trying to allocate a giant buffer.

Bug: crashpad:30, crashpad:196, crashpad:233
Change-Id: Idd3ca11fe00319b8b29e029d5e13b17bfd518ea0
Reviewed-on: https://chromium-review.googlesource.com/1083451
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
2018-06-07 21:09:53 +00:00
Scott Graham
798f654043 gn win: Use new toolchain names to support both x86 and x64
Rolls mini_chromium to include:
75b5697 gn win: Template toolchain to support x86 and x64
428a555 gn win: Automatically find location of Visual Studio

Bug: crashpad:79
Change-Id: Ie7ff10f8b4853071028e3a9580e5be8e5ca5c0ec
Reviewed-on: https://chromium-review.googlesource.com/905625
Commit-Queue: Scott Graham <scottmg@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2018-02-06 23:35:49 +00:00
Scott Graham
14dbd3531d gn win: Get main test binaries building
- default to subsystem:console
- don't build posix/timezone.*
- add some missing libs

This gets all the main binaries building and running. Most configs pass,
but there's some offsets that seem different in some builds; need to
investigate more. Additionally, the binaries used by end_to_end_test.py
aren't yet built, so that script fails.

Includes mini_chromium roll to 46eeaf9:
46eea49 gn win: Add debug info and pdb to cc/cxx
902a29f gn win: Various fixes towards making GN build work

Bug: crashpad:79
Change-Id: Ie56a469b84bed7b0330172cec9f1a8aeb95f702e
Reviewed-on: https://chromium-review.googlesource.com/902403
Commit-Queue: Scott Graham <scottmg@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2018-02-06 19:12:18 +00:00
Scott Graham
ab153f7e1b gn: Avoid depending on BUILDCONFIG.gn globals
Goes with https://chromium-review.googlesource.com/c/chromium/mini_chromium/+/834648.

Includes mini_chromium DEPS roll to pull in edfe51ce81

Bug: crashpad:79, crashpad:196
Change-Id: Ib45cc738aecf9ae727f8faeff81f3b71e2dc9de8
Reviewed-on: https://chromium-review.googlesource.com/834543
Commit-Queue: Scott Graham <scottmg@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2017-12-19 23:38:36 +00:00
Mark Mentovai
99b0030616 gn, linux: Build for Linux with GN
This is sufficient for a native Linux build using GN. Android is not yet
supported.

mini_chromium side: https://crrev.com/c/833407

This also updates mini_chromium to 404f6dbf9928.

c913ef97a236 gn, linux: Build for Linux with GN
404f6dbf9928 gn: Don’t use .rsp files; rationalize descriptions and
             output dirs

Bug: crashpad:79
Change-Id: I4f3b72fd02884d77812e520fb95231b35815677d
Reviewed-on: https://chromium-review.googlesource.com/833408
Commit-Queue: Mark Mentovai <mark@chromium.org>
Reviewed-by: Scott Graham <scottmg@chromium.org>
2017-12-19 19:31:20 +00:00
Scott Graham
1bc07b76ed gn: Use mini_chromium_is_posix in preference to global is_posix
Goes with
https://chromium-review.googlesource.com/c/chromium/mini_chromium/+/833328.

Also roll mini_chromium:

scottmg@around:/work/crashpad/crashpad/third_party/mini_chromium/mini_chromium$ git log 20182dd263312db9fad52042fc92c33331ec6904..e182031 --oneline
e182031 gn: Add is_posix.gni to define local is_posix variable
4cb1344 gn: Enable proper release-mode optimizations for POSIX-non-Mac
9c0eb0c Remove reference to ptr_util.h
c5ae5aa gn: Configure the sysroot in target_sysroot, not sysroot
f7e5654 gn, mac: Honor mac_sdk_min, sysroot, and mac_deployment_target
7701901 Remove the deprecated sparse_histogram.h header.
e2f0160 Use Chromium copyright notice and BSD license in mini_chromium


Bug: crashpad:79, crashpad:196
Change-Id: Ie41d971e0e769db2ed18861da07021c071f6c650
Reviewed-on: https://chromium-review.googlesource.com/833329
Commit-Queue: Scott Graham <scottmg@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2017-12-19 00:07:06 +00:00
Scott Graham
457cc6a34f gn: Refactor build files to avoid build/secondary
In doing standalone bringup of Crashpad targeting Fuchsia, it seemed
tidy to keep the same literal paths to the dependencies that Chromium
needed and add stubs/forwarding to build/secondary in the Crashpad tree
as required to make those work.

However, when trying to build Crashpad in the Fuchsia tree itself, that
would require adding forwarding files to the Fuchsia tree to match the
Chromium directory structure, which would be awkward. Instead, have
explicit dependencies in the Crashpad tree that select the locations
for various dependencies.

Bug: crashpad:79, crashpad:196
Change-Id: Ib506839f9c97d8ef823663cdc733cbdcfa126139
Reviewed-on: https://chromium-review.googlesource.com/826025
Commit-Queue: Scott Graham <scottmg@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2017-12-18 22:53:58 +00:00
Mark Mentovai
3650d56570 gn: Build gtest and gmock tests
Bug: crashpad:79
Change-Id: Iea78fcb6a758f57d2b550b214b947ca5aabad036
Reviewed-on: https://chromium-review.googlesource.com/827732
Commit-Queue: Mark Mentovai <mark@chromium.org>
Reviewed-by: Scott Graham <scottmg@chromium.org>
2017-12-15 23:10:52 +00:00
Scott Graham
a4fc880278 gn, mac: Get basic generation working
A couple targets compile, but not linking yet.

Requires https://chromium-review.googlesource.com/c/chromium/mini_chromium/+/812410

Bug: crashpad:79
Change-Id: Ifc472628ec5233fc88c746e74a1f7b3ce0637f91
Reviewed-on: https://chromium-review.googlesource.com/811884
Commit-Queue: Scott Graham <scottmg@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2017-12-07 00:19:36 +00:00
Scott Graham
eeb31321f7 gn, fuchsia: Add //testing forwarding and GN build file
third_party/gtest/BUILD.gn mostly written by rsesek.

Also includes DEPS roll of mini_chromium for Wexit_time_destructors config.

$ git log --oneline dd0c3e96..fa146c12
fa146c1 (HEAD, origin/master, origin/HEAD) gn: Extract Wexit-time-destructors into separate config
95bfddb fuchsia: Fix base::RandBytes() after 5a1c5f82ce75
b79608a fuchsia: Use llvm-ar from the Fuchsia clang package
c34725b fuchsia: Look for the toolchain and SDK in per-build-host directories
e8e1ee4 fuchsia: Don't assume that kernel will provide all requested rand bytes
5a1c5f8 fuchsia: Implement RandBytes()
df359ca fuchsia: Enable -fPIC
bd50c95 Restore accidentally changed license
a70db15 Improvements to GN build config
7de4d23 fuchsia: Fix compile of base/logging.cc
25a8b57 Add link GN rules to non-win build, set c++14 in CC flags.
7d15806 fuchsia: The very basics of compiling mini_chromium/base with GN

Bug: crashpad:79, crashpad:196
Change-Id: I3e741f185b028a96705eefc1f993037830d97448
Reviewed-on: https://chromium-review.googlesource.com/797414
Commit-Queue: Scott Graham <scottmg@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
2017-11-30 20:58:46 +00:00
Scott Graham
3f5c939c84 gn: Next step in getting compilation working
- Correctly sets target_cpu and current_cpu so correct toolchain
  can be used on Fuchsia.
- Introduces GN argument "crashpad_in_chromium" which defaults to
  false. Used to set CRASHPAD_IN_CHROMIUM define, determine which
  zlib path to use, and how to package the test targets into
  binaries (one big one in Chromium, separate in Crashpad).

Bug: crashpad:79, crashpad:196
Change-Id: If6560dc064308ed6f8bf7c75cf74f684a3522e8b
Reviewed-on: https://chromium-review.googlesource.com/797354
Reviewed-by: Mark Mentovai <mark@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
2017-11-29 19:46:08 +00:00
Scott Graham
2bb56fafe3 Rework GN files to start to support building standalone, and also in Chromium
- Adds a .gn and a build/BUILDCONFIG.gn that uses mini_chromium's
  build/BUILD.gn.
- Adds some stub BUILD.gn files in locations where Chromium expects them
  (in //build, //testing, //third_party) containing empty targets/configs.
  These are no-ops in standalone builds, but add functionality when
  building in Chromium.  This is in preference to having a global bool
  that conditionally does Chromium-y things in the Crashpad build files.
  These stub files are all contained in a secondary source root in
  build/chromium_compatibility, referred to by //.gn.
- Adds //base/BUILD.gn which forwards to mini_chromium/base. This is
  only used when building standalone so that both Chromium and Crashpad
  can refer to it as "//base".
- Changes references to other Crashpad targets to be relatively
  specified so that they work when the root of the project is //, and also
  when it's //third_party/crashpad/crashpad as it is in Chromium.
- Moves any error-causing Mac/Win-specific files into explicit if (is_mac)
  or if (is_win) blocks as part of removing the dependency on
  set_sources_assignment_filter().

As yet unresolved:
- CRASHPAD_IN_CHROMIUM needs to be removed when standalone; to be tackled
  in a follow up.
- Not sure what to do with zlib yet, the build file currently assumes
  "in Chromium" too, and similarly having Crashpad //third_party/zlib:zlib
  pointing at itself doesn't work.

Bug: crashpad:79
Change-Id: I6a7dda214e4b3b14a60c1ed285267ab97432a1a8
Reviewed-on: https://chromium-review.googlesource.com/777410
Reviewed-by: Mark Mentovai <mark@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
2017-11-28 20:29:35 +00:00