OLD | NEW |
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import("//build/config/android/config.gni") | 5 import("//build/config/android/config.gni") |
6 import("//build/config/chrome_build.gni") | 6 import("//build/config/chrome_build.gni") |
7 import("//build/config/chromecast_build.gni") | 7 import("//build/config/chromecast_build.gni") |
8 import("//build/config/compiler/compiler.gni") | 8 import("//build/config/compiler/compiler.gni") |
9 import("//build/config/nacl/config.gni") | 9 import("//build/config/nacl/config.gni") |
10 import("//build/toolchain/cc_wrapper.gni") | 10 import("//build/toolchain/cc_wrapper.gni") |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 if (is_win) { | 155 if (is_win) { |
156 configs += [ "//build/config/win:compiler" ] | 156 configs += [ "//build/config/win:compiler" ] |
157 } else if (is_android) { | 157 } else if (is_android) { |
158 configs += [ "//build/config/android:compiler" ] | 158 configs += [ "//build/config/android:compiler" ] |
159 } else if (is_linux) { | 159 } else if (is_linux) { |
160 configs += [ "//build/config/linux:compiler" ] | 160 configs += [ "//build/config/linux:compiler" ] |
161 } else if (is_nacl) { | 161 } else if (is_nacl) { |
162 configs += [ "//build/config/nacl:compiler" ] | 162 configs += [ "//build/config/nacl:compiler" ] |
163 } else if (is_ios || is_mac) { | 163 } else if (is_ios || is_mac) { |
164 configs += [ "//build/config/mac:compiler" ] | 164 configs += [ "//build/config/mac:compiler" ] |
| 165 } else if (is_fuchsia) { |
| 166 configs += [ "//build/config/fuchsia:compiler" ] |
165 } | 167 } |
166 | 168 |
167 # See the definitions below. | 169 # See the definitions below. |
168 configs += [ | 170 configs += [ |
169 ":compiler_cpu_abi", | 171 ":compiler_cpu_abi", |
170 ":compiler_codegen", | 172 ":compiler_codegen", |
171 ] | 173 ] |
172 | 174 |
173 # In general, Windows is totally different, but all the other builds share | 175 # In general, Windows is totally different, but all the other builds share |
174 # some common GCC configuration. | 176 # some common GCC configuration. |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 ] | 289 ] |
288 defines += [ "NO_UNWIND_TABLES" ] | 290 defines += [ "NO_UNWIND_TABLES" ] |
289 } else { | 291 } else { |
290 cflags += [ "-funwind-tables" ] | 292 cflags += [ "-funwind-tables" ] |
291 } | 293 } |
292 } | 294 } |
293 } | 295 } |
294 | 296 |
295 # Linux/Android common flags setup. | 297 # Linux/Android common flags setup. |
296 # --------------------------------- | 298 # --------------------------------- |
297 if (is_linux || is_android) { | 299 if (is_linux || is_android || is_fuchsia) { |
298 if (use_pic) { | 300 if (use_pic) { |
299 cflags += [ "-fPIC" ] | 301 cflags += [ "-fPIC" ] |
300 ldflags += [ "-fPIC" ] | 302 ldflags += [ "-fPIC" ] |
301 } | 303 } |
302 | 304 |
303 # Use pipes for communicating between sub-processes. Faster. | 305 # Use pipes for communicating between sub-processes. Faster. |
304 cflags += [ "-pipe" ] | 306 cflags += [ "-pipe" ] |
305 | 307 |
306 ldflags += [ | 308 ldflags += [ |
307 "-Wl,-z,noexecstack", | 309 "-Wl,-z,noexecstack", |
308 "-Wl,-z,now", | 310 "-Wl,-z,now", |
309 "-Wl,-z,relro", | 311 "-Wl,-z,relro", |
310 ] | 312 ] |
311 if (!using_sanitizer) { | 313 if (!using_sanitizer) { |
312 if (!use_cfi_diag) { | 314 if (!use_cfi_diag) { |
313 ldflags += [ "-Wl,-z,defs" ] | 315 ldflags += [ "-Wl,-z,defs" ] |
314 } | 316 } |
315 | 317 |
316 # Functions interposed by the sanitizers can make ld think | 318 # Functions interposed by the sanitizers can make ld think |
317 # that some libraries aren't needed when they actually are, | 319 # that some libraries aren't needed when they actually are, |
318 # http://crbug.com/234010. As workaround, disable --as-needed. | 320 # http://crbug.com/234010. As workaround, disable --as-needed. |
319 if (!is_nacl && !is_android) { | 321 if (!is_nacl && !is_android) { |
320 # TODO(pcc): Fix linker bug which requires us to link pthread | 322 # TODO(pcc): Fix linker bug which requires us to link pthread |
321 # unconditionally here (crbug.com/623236). | 323 # unconditionally here (crbug.com/623236). |
322 ldflags += [ | 324 ldflags += [ |
323 "-Wl,--no-as-needed", | 325 "-Wl,--no-as-needed", |
324 "-lpthread", | 326 "-lpthread", |
325 ] | 327 ] |
326 } | 328 } |
327 ldflags += [ "-Wl,--as-needed" ] | 329 if (!is_fuchsia) { |
| 330 # We need mxio/magenta to get linked in, even if they're not directly |
| 331 # referenced. |
| 332 ldflags += [ "-Wl,--as-needed" ] |
| 333 } |
328 } | 334 } |
329 } | 335 } |
330 | 336 |
331 # Linux-specific compiler flags setup. | 337 # Linux-specific compiler flags setup. |
332 # ------------------------------------ | 338 # ------------------------------------ |
333 if (is_android && is_clang) { | 339 if (is_android && is_clang) { |
334 _rebased_android_toolchain_root = | 340 _rebased_android_toolchain_root = |
335 rebase_path(android_toolchain_root, root_build_dir) | 341 rebase_path(android_toolchain_root, root_build_dir) |
336 | 342 |
337 # Let clang find the linker in the NDK. | 343 # Let clang find the linker in the NDK. |
(...skipping 1377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1715 | 1721 |
1716 if (is_ios || is_mac) { | 1722 if (is_ios || is_mac) { |
1717 # On Mac and iOS, this enables support for ARC (automatic ref-counting). | 1723 # On Mac and iOS, this enables support for ARC (automatic ref-counting). |
1718 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. | 1724 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. |
1719 config("enable_arc") { | 1725 config("enable_arc") { |
1720 common_flags = [ "-fobjc-arc" ] | 1726 common_flags = [ "-fobjc-arc" ] |
1721 cflags_objc = common_flags | 1727 cflags_objc = common_flags |
1722 cflags_objcc = common_flags | 1728 cflags_objcc = common_flags |
1723 } | 1729 } |
1724 } | 1730 } |
OLD | NEW |