Chromium Code Reviews| OLD | NEW |
|---|---|
| (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", | |
|
earthdok
2015/05/28 18:27:46
You have to download the archive before you can ex
Sam McNally
2015/05/29 08:33:00
This assumes that hook would still download the ar
earthdok
2015/05/29 15:28:03
You're probably aware of this, but just in case, I
| |
| 27 ] | |
| 28 } | |
| 29 | |
| 30 if (is_msan) { | |
| 31 sanitizer_type = "msan" | |
| 32 if (msan_track_origins == 0) { | |
| 33 archive_name = "msan-no-origins" | |
| 34 } else if (msan_track_origins == 2) { | |
| 35 archive_name = "msan-chained-origins" | |
| 36 } | |
| 37 } | |
| 38 | |
| 39 action("extract_prebuilt_instrumented_libraries") { | |
| 40 visibility = [ ":prebuilt" ] | |
| 41 script = "scripts/unpack_binaries.py" | |
| 42 depfile = "$target_out_dir/$archive_name.d" | |
| 43 args = [ | |
| 44 archive_name, | |
| 45 rebase_path("binaries"), | |
| 46 rebase_path(root_build_dir + "/instrumented_libraries_prebuilt"), | |
| 47 rebase_path(target_out_dir, root_build_dir), | |
| 48 ] | |
| 49 outputs = [ | |
| 50 "$target_out_dir/$archive_name.txt", | |
|
earthdok
2015/05/28 18:27:46
The stamp file no longer references the Ubuntu rel
Sam McNally
2015/05/29 08:33:00
I don't think we can detect this unless ninja can
earthdok
2015/05/29 15:28:03
Ninja doesn't rerun GYP either, but GYP would at l
Sam McNally
2015/06/01 01:05:15
Done.
| |
| 51 ] | |
| 52 } | |
| 53 | |
| 54 config("prebuilt_link_helper") { | |
| 55 visibility = [ ":prebuilt" ] | |
| 56 ldflags = [ | |
| 57 # Add a relative RPATH entry to Chromium binaries. This puts instrumented | |
| 58 # DSOs before system-installed versions in library search path. | |
| 59 "-Wl,-R,\$ORIGIN/instrumented_libraries_prebuilt/$sanitizer_type/lib", | |
| 60 "-Wl,-z,origin", | |
| 61 ] | |
| 62 } | |
| 63 } | |
| OLD | NEW |