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

Side by Side Diff: build/standalone.gypi

Issue 1267773004: Port cfi configuration from chromium. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 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
« build/download_gold_plugin.py ('K') | « build/download_gold_plugin.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2012 the V8 project authors. All rights reserved. 1 # Copyright 2012 the V8 project authors. All rights reserved.
2 # Redistribution and use in source and binary forms, with or without 2 # Redistribution and use in source and binary forms, with or without
3 # modification, are permitted provided that the following conditions are 3 # modification, are permitted provided that the following conditions are
4 # met: 4 # met:
5 # 5 #
6 # * Redistributions of source code must retain the above copyright 6 # * Redistributions of source code must retain the above copyright
7 # notice, this list of conditions and the following disclaimer. 7 # notice, this list of conditions and the following disclaimer.
8 # * Redistributions in binary form must reproduce the above 8 # * Redistributions in binary form must reproduce the above
9 # copyright notice, this list of conditions and the following 9 # copyright notice, this list of conditions and the following
10 # disclaimer in the documentation and/or other materials provided 10 # disclaimer in the documentation and/or other materials provided
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 # also controls coverage granularity (1 for function-level, 2 for 81 # also controls coverage granularity (1 for function-level, 2 for
82 # block-level, 3 for edge-level). 82 # block-level, 3 for edge-level).
83 'sanitizer_coverage%': 0, 83 'sanitizer_coverage%': 0,
84 # Use libc++ (buildtools/third_party/libc++ and 84 # Use libc++ (buildtools/third_party/libc++ and
85 # buildtools/third_party/libc++abi) instead of stdlibc++ as standard 85 # buildtools/third_party/libc++abi) instead of stdlibc++ as standard
86 # library. This is intended to be used for instrumented builds. 86 # library. This is intended to be used for instrumented builds.
87 'use_custom_libcxx%': 0, 87 'use_custom_libcxx%': 0,
88 88
89 'clang_dir%': '<(base_dir)/third_party/llvm-build/Release+Asserts', 89 'clang_dir%': '<(base_dir)/third_party/llvm-build/Release+Asserts',
90 90
91 'use_lto%': 0,
92
93 # Control Flow Integrity for virtual calls and casts.
94 # See http://clang.llvm.org/docs/ControlFlowIntegrity.html
95 'cfi_vptr%': 0,
96 'cfi_diag%': 0,
97
91 # goma settings. 98 # goma settings.
92 # 1 to use goma. 99 # 1 to use goma.
93 # If no gomadir is set, it uses the default gomadir. 100 # If no gomadir is set, it uses the default gomadir.
94 'use_goma%': 0, 101 'use_goma%': 0,
95 'gomadir%': '', 102 'gomadir%': '',
96 'conditions': [ 103 'conditions': [
97 # Set default gomadir. 104 # Set default gomadir.
98 ['OS=="win"', { 105 ['OS=="win"', {
99 'gomadir': 'c:\\goma\\goma-win', 106 'gomadir': 'c:\\goma\\goma-win',
100 }, { 107 }, {
101 'gomadir': '<!(/bin/echo -n ${HOME}/goma)', 108 'gomadir': '<!(/bin/echo -n ${HOME}/goma)',
102 }], 109 }],
103 ['host_arch!="ppc" and host_arch!="ppc64" and host_arch!="ppc64le"', { 110 ['host_arch!="ppc" and host_arch!="ppc64" and host_arch!="ppc64le"', {
104 'host_clang%': '1', 111 'host_clang%': '1',
105 }, { 112 }, {
106 'host_clang%': '0', 113 'host_clang%': '0',
107 }], 114 }],
115 # linux_use_bundled_gold: whether to use the gold linker binary checked
116 # into third_party/binutils. Force this off via GYP_DEFINES when you
117 # are using a custom toolchain and need to control -B in ldflags.
118 # Do not use 32-bit gold on 32-bit hosts as it runs out address space
119 # for component=static_library builds.
120 ['(OS=="linux" or OS=="android") and (target_arch=="x64" or target_arch= ="arm" or (target_arch=="ia32" and host_arch=="x64"))', {
121 'linux_use_bundled_gold%': 1,
122 }, {
123 'linux_use_bundled_gold%': 0,
124 }],
108 ], 125 ],
109 }, 126 },
110 'base_dir%': '<(base_dir)', 127 'base_dir%': '<(base_dir)',
111 'clang_dir%': '<(clang_dir)', 128 'clang_dir%': '<(clang_dir)',
112 'host_arch%': '<(host_arch)', 129 'host_arch%': '<(host_arch)',
113 'host_clang%': '<(host_clang)', 130 'host_clang%': '<(host_clang)',
114 'target_arch%': '<(target_arch)', 131 'target_arch%': '<(target_arch)',
115 'v8_target_arch%': '<(v8_target_arch)', 132 'v8_target_arch%': '<(v8_target_arch)',
116 'werror%': '-Werror', 133 'werror%': '-Werror',
117 'use_goma%': '<(use_goma)', 134 'use_goma%': '<(use_goma)',
118 'gomadir%': '<(gomadir)', 135 'gomadir%': '<(gomadir)',
119 'asan%': '<(asan)', 136 'asan%': '<(asan)',
120 'lsan%': '<(lsan)', 137 'lsan%': '<(lsan)',
121 'msan%': '<(msan)', 138 'msan%': '<(msan)',
122 'tsan%': '<(tsan)', 139 'tsan%': '<(tsan)',
123 'sanitizer_coverage%': '<(sanitizer_coverage)', 140 'sanitizer_coverage%': '<(sanitizer_coverage)',
124 'use_custom_libcxx%': '<(use_custom_libcxx)', 141 'use_custom_libcxx%': '<(use_custom_libcxx)',
142 'linux_use_bundled_gold%': '<(linux_use_bundled_gold)',
143 'use_lto%': '<(use_lto)',
144 'cfi_vptr%': '<(cfi_vptr)',
145 'cfi_diag%': '<(cfi_diag)',
125 146
126 # Add a simple extra solely for the purpose of the cctests 147 # Add a simple extra solely for the purpose of the cctests
127 'v8_extra_library_files': ['../test/cctest/test-extra.js'], 148 'v8_extra_library_files': ['../test/cctest/test-extra.js'],
128 149
129 # .gyp files or targets should set v8_code to 1 if they build V8 specific 150 # .gyp files or targets should set v8_code to 1 if they build V8 specific
130 # code, as opposed to external code. This variable is used to control such 151 # code, as opposed to external code. This variable is used to control such
131 # things as the set of warnings to enable, and whether warnings are treated 152 # things as the set of warnings to enable, and whether warnings are treated
132 # as errors. 153 # as errors.
133 'v8_code%': 0, 154 'v8_code%': 0,
134 155
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 }], 221 }],
201 ['tsan==1', { 222 ['tsan==1', {
202 'use_custom_libcxx%': 1, 223 'use_custom_libcxx%': 1,
203 }], 224 }],
204 ['msan==1', { 225 ['msan==1', {
205 # Use a just-built, MSan-instrumented libc++ instead of the system-wide 226 # Use a just-built, MSan-instrumented libc++ instead of the system-wide
206 # libstdc++. This is required to avoid false positive reports whenever 227 # libstdc++. This is required to avoid false positive reports whenever
207 # the C++ standard library is used. 228 # the C++ standard library is used.
208 'use_custom_libcxx%': 1, 229 'use_custom_libcxx%': 1,
209 }], 230 }],
231 ['cfi_vptr==1', {
232 'use_lto%': 1,
233 }],
210 ['OS=="linux"', { 234 ['OS=="linux"', {
211 # Gradually roll out v8_use_external_startup_data. 235 # Gradually roll out v8_use_external_startup_data.
212 # Should eventually be default enabled on all platforms. 236 # Should eventually be default enabled on all platforms.
213 'v8_use_external_startup_data%': 1, 237 'v8_use_external_startup_data%': 1,
214 }], 238 }],
215 ['OS=="android"', { 239 ['OS=="android"', {
216 # Location of Android NDK. 240 # Location of Android NDK.
217 'variables': { 241 'variables': {
218 'variables': { 242 'variables': {
219 # The Android toolchain needs to use the absolute path to the NDK 243 # The Android toolchain needs to use the absolute path to the NDK
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 ['_toolset=="target"', { 552 ['_toolset=="target"', {
529 'cflags': [ 553 'cflags': [
530 '-fsanitize-coverage=<(sanitizer_coverage)', 554 '-fsanitize-coverage=<(sanitizer_coverage)',
531 ], 555 ],
532 'defines': [ 556 'defines': [
533 'SANITIZER_COVERAGE', 557 'SANITIZER_COVERAGE',
534 ], 558 ],
535 }], 559 }],
536 ], 560 ],
537 }], 561 }],
562 ['linux_use_bundled_gold==1 and not (clang==0 and use_lto==1)', {
563 # Put our binutils, which contains gold in the search path. We pass
564 # the path to gold to the compiler. gyp leaves unspecified what the
565 # cwd is when running the compiler, so the normal gyp path-munging
566 # fails us. This hack gets the right path.
567 #
568 # Disabled when using GCC LTO because GCC also uses the -B search
569 # path at link time to find "as", and our bundled "as" can only
570 # target x86.
571 'ldflags': [
572 # Note, Chromium allows ia32 host arch as well, we limit this to
573 # x64 in v8.
574 '-B<(base_dir)/third_party/binutils/Linux_x64/Release/bin',
575 ],
576 }],
538 ], 577 ],
539 }, 578 },
540 }], 579 }],
541 ['OS=="mac"', { 580 ['OS=="mac"', {
542 'target_defaults': { 581 'target_defaults': {
543 'conditions': [ 582 'conditions': [
544 ['asan==1', { 583 ['asan==1', {
545 'xcode_settings': { 584 'xcode_settings': {
546 # FIXME(machenbach): This is outdated compared to common.gypi. 585 # FIXME(machenbach): This is outdated compared to common.gypi.
547 'OTHER_CFLAGS+': [ 586 'OTHER_CFLAGS+': [
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after
1137 # make generator doesn't support CC_wrapper without CC 1176 # make generator doesn't support CC_wrapper without CC
1138 # in make_global_settings yet. 1177 # in make_global_settings yet.
1139 ['use_goma==1 and ("<(GENERATOR)"=="ninja" or clang==1)', { 1178 ['use_goma==1 and ("<(GENERATOR)"=="ninja" or clang==1)', {
1140 'make_global_settings': [ 1179 'make_global_settings': [
1141 ['CC_wrapper', '<(gomadir)/gomacc'], 1180 ['CC_wrapper', '<(gomadir)/gomacc'],
1142 ['CXX_wrapper', '<(gomadir)/gomacc'], 1181 ['CXX_wrapper', '<(gomadir)/gomacc'],
1143 ['CC.host_wrapper', '<(gomadir)/gomacc'], 1182 ['CC.host_wrapper', '<(gomadir)/gomacc'],
1144 ['CXX.host_wrapper', '<(gomadir)/gomacc'], 1183 ['CXX.host_wrapper', '<(gomadir)/gomacc'],
1145 ], 1184 ],
1146 }], 1185 }],
1186 ['use_lto==1', {
1187 'target_defaults': {
1188 'target_conditions': [
1189 ['_toolset=="target"', {
1190 'cflags': [
1191 '-flto',
1192 ],
1193 }],
1194 ],
1195 },
1196 }],
1197 ['use_lto==1 and clang==0', {
1198 'target_defaults': {
1199 'target_conditions': [
1200 ['_toolset=="target"', {
1201 'cflags': [
1202 '-ffat-lto-objects',
1203 ],
1204 }],
1205 ],
1206 },
1207 }],
1208 ['use_lto==1 and clang==1', {
1209 'target_defaults': {
1210 'target_conditions': [
1211 ['_toolset=="target"', {
1212 'arflags': [
1213 '--plugin', '<(clang_dir)/lib/LLVMgold.so',
1214 ],
1215 # Apply a lower optimization level with lto. Chromium does this
1216 # for non-official builds only - a differentiation that doesn't
1217 # exist in v8.
1218 'ldflags': [
1219 '-Wl,--plugin-opt,O1',
1220 ],
1221 }],
1222 ],
1223 },
1224 }],
1225 ['use_lto==1 and clang==0', {
1226 'target_defaults': {
1227 'target_conditions': [
1228 ['_toolset=="target"', {
1229 'ldflags': [
1230 '-flto=32',
1231 ],
1232 }],
1233 ],
1234 },
1235 }],
1236 ['use_lto==1 and clang==1', {
1237 'target_defaults': {
1238 'target_conditions': [
1239 ['_toolset=="target"', {
1240 'ldflags': [
1241 '-flto',
1242 ],
1243 }],
1244 ],
1245 },
1246 }],
1247 ['cfi_diag==1', {
1248 'target_defaults': {
1249 'target_conditions': [
1250 ['_toolset=="target"', {
1251 'cflags': [
1252 '-fno-sanitize-trap=cfi',
1253 '-fsanitize-recover=cfi',
1254 ],
1255 'ldflags': [
1256 '-fno-sanitize-trap=cfi',
1257 '-fsanitize-recover=cfi',
1258 ],
1259 }],
1260 ],
1261 },
1262 }],
1263 ['cfi_vptr==1', {
1264 'target_defaults': {
1265 'target_conditions': [
1266 ['_toolset=="target"', {
1267 'cflags': [
1268 '-fsanitize=cfi-vcall',
1269 '-fsanitize=cfi-derived-cast',
1270 '-fsanitize=cfi-unrelated-cast',
1271 ],
1272 'ldflags': [
1273 '-fsanitize=cfi-vcall',
1274 '-fsanitize=cfi-derived-cast',
1275 '-fsanitize=cfi-unrelated-cast',
1276 ],
1277 }],
1278 ],
1279 },
1280 }],
1147 ], 1281 ],
1148 } 1282 }
OLDNEW
« build/download_gold_plugin.py ('K') | « build/download_gold_plugin.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698