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/win/manifest.gni")
6 import("//chrome/version.gni")
7 import("//testing/test.gni")
9 process_version("chrome_elf_resources") {
10 template_file = chrome_version_rc_template
14 output = "$target_gen_dir/chrome_elf_version.rc"
17 # This manifest matches what GYP produces. It may not even be necessary.
18 windows_manifest("chrome_elf_manifest") {
25 shared_library("chrome_elf") {
33 ":chrome_elf_manifest",
35 ":chrome_elf_resources",
36 "//build/config/sanitizers:deps",
38 configs += [ "//build/config/win:windowed" ]
39 configs -= [ "//build/config/win:console" ]
41 "/NODEFAULTLIB:user32.lib",
42 "/DEF:" + rebase_path("chrome_elf.def"),
44 if (current_cpu == "x86") {
45 # Don"t set an x64 base address (to avoid breaking HE-ASLR).
46 ldflags += [ "/BASE:0x01c20000" ]
52 "create_file/chrome_create_file.cc",
53 "create_file/chrome_create_file.h",
64 source_set("constants") {
66 "chrome_elf_constants.cc",
67 "chrome_elf_constants.h",
71 source_set("common") {
84 source_set("breakpad") {
85 include_dirs = [ "$target_gen_dir" ]
92 "//breakpad:breakpad_handler",
93 "//chrome:version_header",
97 if (is_component_build) {
98 shared_library("chrome_redirects") {
100 "chrome_redirects_main.cc",
104 "//build/config/sanitizers:deps",
106 configs += [ "//build/config/win:windowed" ]
107 ldflags = [ "/DEF:" + rebase_path("chrome_redirects.def") ]
109 if (current_cpu == "x86") {
110 # Don't set an x64 base address (to avoid breaking HE-ASLR).
111 ldflags += [ "/BASE:0x01c20000" ]
116 source_set("dll_hash") {
121 "dll_hash/dll_hash.cc",
122 "dll_hash/dll_hash.h",
126 executable("dll_hash_main") {
128 "dll_hash/dll_hash_main.cc",
132 "//build/config/sanitizers:deps",
136 static_library("blacklist") {
138 "blacklist/blacklist.cc",
139 "blacklist/blacklist.h",
140 "blacklist/blacklist_interceptions.cc",
141 "blacklist/blacklist_interceptions.h",
144 # Depend on base_static, but do NOT take a dependency on base.gyp:base
145 # as that would risk pulling in base's link-time dependencies which
146 # chrome_elf cannot do.
149 "//base:base_static",
154 test("chrome_elf_unittests") {
155 output_name = "chrome_elf_unittests"
157 "blacklist/test/blacklist_test.cc",
158 "chrome_elf_util_unittest.cc",
159 "create_file/chrome_create_file_unittest.cc",
160 "elf_imports_unittest.cc",
161 "ntdll_cache_unittest.cc",
163 include_dirs = [ "$target_gen_dir" ]
166 ":blacklist_test_main_dll",
169 "//base/test:run_all_unittests",
170 "//base/test:test_support",
175 ":blacklist_test_dll_1",
176 ":blacklist_test_dll_2",
177 ":blacklist_test_dll_3",
183 shared_library("blacklist_test_main_dll") {
185 "blacklist/test/blacklist_test_main_dll.cc",
190 "//build/config/sanitizers:deps",
193 [ "/DEF:" + rebase_path("blacklist/test/blacklist_test_main_dll.def",
197 shared_library("blacklist_test_dll_1") {
199 "blacklist/test/blacklist_test_dll_1.cc",
201 ldflags = [ "/DEF:" + rebase_path("blacklist/test/blacklist_test_dll_1.def",
204 "//build/config/sanitizers:deps",
208 shared_library("blacklist_test_dll_2") {
210 "blacklist/test/blacklist_test_dll_2.cc",
212 ldflags = [ "/DEF:" + rebase_path("blacklist/test/blacklist_test_dll_2.def",
215 "//build/config/sanitizers:deps",
219 shared_library("blacklist_test_dll_3") {
221 "blacklist/test/blacklist_test_dll_3.cc",
224 "//build/config/sanitizers:deps",