OLD | NEW |
(Empty) | |
| 1 # Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
| 2 # for details. All rights reserved. Use of this source code is governed by a |
| 3 # BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 config("internal_config") { |
| 6 visibility = [ ":*" ] # Only targets in this file can depend on this. |
| 7 cflags = [ |
| 8 "-Wall", |
| 9 "-Wextra", |
| 10 "-Wno-missing-field-initializers", |
| 11 "-Wno-sign-compare", |
| 12 "-Wno-type-limits", |
| 13 "-Wno-unused-result", |
| 14 "-Wno-unused-parameter", |
| 15 "-Wno-unused-function", |
| 16 "-Wno-vla", |
| 17 "-g3", |
| 18 "-ggdb3", |
| 19 "-fstack-protector", |
| 20 "-Wa,--noexecstack", |
| 21 "-fno-omit-frame-pointer", |
| 22 "-fno-builtin-malloc", |
| 23 "-fno-builtin-free", |
| 24 "-fno-builtin-realloc", |
| 25 "-fno-builtin-calloc", |
| 26 "-fno-builtin-cfree", |
| 27 "-fno-builtin-memalign", |
| 28 "-fno-builtin-posix_memalign", |
| 29 "-fno-builtin-valloc", |
| 30 "-fno-builtin-pvalloc", |
| 31 ] |
| 32 if (is_clang) { |
| 33 cflags += [ |
| 34 "-Wno-unused-const-variable", |
| 35 ] |
| 36 } |
| 37 } |
| 38 |
| 39 config("link_config") { |
| 40 visibility = [ ":*" ] # Only targets in this file can depend on this. |
| 41 ldflags = [ |
| 42 # Don't let linker rip this symbol out, otherwise the heap&cpu |
| 43 # profilers will not initialize properly on startup. |
| 44 "-Wl,-uIsHeapProfilerRunning,-uProfilerStart", |
| 45 ] |
| 46 } |
| 47 |
| 48 source_set("dynamic_annotations") { |
| 49 configs -= [ "//build/config/compiler:chromium_code" ] |
| 50 configs += [ ":internal_config" ] |
| 51 |
| 52 include_dirs = [ |
| 53 "include", |
| 54 "gperftools/src/base", |
| 55 "gperftools/src", |
| 56 ] |
| 57 |
| 58 sources = [ |
| 59 "gperftools/src/base/dynamic_annotations.c", |
| 60 "gperftools/src/base/dynamic_annotations.h", |
| 61 ] |
| 62 } |
| 63 |
| 64 tcmalloc_sources_list = exec_script("../../tools/gypi_to_gn.py", |
| 65 [rebase_path("tcmalloc_sources.gypi")], |
| 66 "scope", |
| 67 ["tcmalloc_sources.gypi"]) |
| 68 |
| 69 |
| 70 source_set("tcmalloc") { |
| 71 configs -= [ "//build/config/compiler:chromium_code" ] |
| 72 configs += [ ":internal_config" ] |
| 73 |
| 74 public_configs = [":link_config"] |
| 75 |
| 76 deps = [ |
| 77 ":dynamic_annotations" |
| 78 ] |
| 79 |
| 80 include_dirs = [ |
| 81 "include", |
| 82 "gperftools/src/base", |
| 83 "gperftools/src", |
| 84 ] |
| 85 |
| 86 # Disable the heap checker in tcmalloc. |
| 87 defines = [ |
| 88 "ENABLE_EMERGENCY_MALLOC", |
| 89 "NO_HEAP_CHECK", |
| 90 # Disable debug even in a Dart Debug build. It is too slow. |
| 91 "NDEBUG", |
| 92 ] |
| 93 |
| 94 # Disable stack sampling for heap profiling in Product builds. |
| 95 if (is_product) { |
| 96 defines += [ |
| 97 "NO_TCMALLOC_SAMPLES", |
| 98 ] |
| 99 } |
| 100 |
| 101 cflags = [ |
| 102 "-Wnon-virtual-dtor", |
| 103 "-Woverloaded-virtual", |
| 104 "-fno-rtti", |
| 105 "-fpermissive", |
| 106 ] |
| 107 |
| 108 set_sources_assignment_filter([ |
| 109 # No debug allocator. |
| 110 "gperftools/src/debugallocation.cc", |
| 111 # Not needed when using emergency malloc. |
| 112 "gperftools/src/fake_stacktrace_scope.cc", |
| 113 # Not using the cpuprofiler |
| 114 "gperftools/src/base/thread_lister.c", |
| 115 "gperftools/src/base/thread_lister.h", |
| 116 "gperftools/src/profile-handler.cc", |
| 117 "gperftools/src/profile-handler.h", |
| 118 "gperftools/src/profiledata.cc", |
| 119 "gperftools/src/profiledata.h", |
| 120 "gperftools/src/profiler.cc", |
| 121 ]) |
| 122 |
| 123 sources = tcmalloc_sources_list.sources |
| 124 } |
OLD | NEW |