Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Side by Side Diff: third_party/instrumented_libraries/BUILD.gn

Issue 1150193002: GN: Add support for prebuilt instrumented libraries. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import("//build/config/sanitizers/sanitizers.gni")
6
7 prebuilt_available =
8 is_msan && (msan_track_origins == 0 || msan_track_origins == 2)
9
10 group("deps") {
11 if (use_prebuilt_instrumented_libraries) {
12 assert(prebuilt_available,
13 "Prebuilt instrumented libraries are only available when " +
14 "is_msan = true and msan_track_origins = {0, 2}")
15 deps = [
16 ":prebuilt",
17 ]
18 }
19 }
20
21 if (prebuilt_available) {
22 group("prebuilt") {
23 visibility = [ ":deps" ]
24 public_configs = [ ":prebuilt_link_helper" ]
25 deps = [
26 ":extract_prebuilt_instrumented_libraries",
27 ]
28 }
29
30 if (is_msan) {
31 sanitizer_type = "msan"
32 if (msan_track_origins == 0) {
33 archive_prefix = "msan-no-origins"
34 } else if (msan_track_origins == 2) {
35 archive_prefix = "msan-chained-origins"
36 }
37 }
38
39 # TODO(GYP): scripts/download_binaries.py uses GYP_DEFINES to decide whether
40 # to download the archives extracted here.
41 # Note: This requires a clobber whenever Ubuntu version changes.
42 action("extract_prebuilt_instrumented_libraries") {
43 visibility = [ ":prebuilt" ]
44 script = "scripts/unpack_binaries.py"
45 depfile = "$target_out_dir/$archive_prefix.d"
46 args = [
47 archive_prefix,
48 rebase_path("binaries"),
49 rebase_path(root_build_dir + "/instrumented_libraries_prebuilt"),
50 rebase_path(target_out_dir, root_build_dir),
51 ]
52 outputs = [
53 "$target_out_dir/$archive_prefix.txt",
54 ]
55 }
56
57 config("prebuilt_link_helper") {
58 visibility = [ ":prebuilt" ]
59 ldflags = [
60 # Add a relative RPATH entry to Chromium binaries. This puts instrumented
61 # DSOs before system-installed versions in library search path.
62 "-Wl,-R,\$ORIGIN/instrumented_libraries_prebuilt/$sanitizer_type/lib",
63 "-Wl,-z,origin",
64 ]
65 }
66 }
67 # TODO(GYP): Support building instrumented libraries from source.
OLDNEW
« no previous file with comments | « build/config/sanitizers/sanitizers.gni ('k') | third_party/instrumented_libraries/instrumented_libraries.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698