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.
5 import("//build/config/sanitizers/sanitizers.gni")
8 is_msan && (msan_track_origins == 0 || msan_track_origins == 2)
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}")
21 if (prebuilt_available) {
23 visibility = [ ":deps" ]
24 public_configs = [ ":prebuilt_link_helper" ]
26 ":extract_prebuilt_instrumented_libraries",
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"
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"
48 rebase_path("binaries"),
49 rebase_path(root_build_dir + "/instrumented_libraries_prebuilt"),
50 rebase_path(target_out_dir, root_build_dir),
53 "$target_out_dir/$archive_prefix.txt",
57 config("prebuilt_link_helper") {
58 visibility = [ ":prebuilt" ]
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",
67 # TODO(GYP): Support building instrumented libraries from source.