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/compiler/compiler.gni") | 7 import("//build/config/compiler/compiler.gni") |
8 import("//build/config/nacl/config.gni") | 8 import("//build/config/nacl/config.gni") |
9 import("//build/toolchain/cc_wrapper.gni") | 9 import("//build/toolchain/cc_wrapper.gni") |
10 import("//build/toolchain/toolchain.gni") | 10 import("//build/toolchain/toolchain.gni") |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 _rebased_android_toolchain_root = | 349 _rebased_android_toolchain_root = |
350 rebase_path(android_toolchain_root, root_build_dir) | 350 rebase_path(android_toolchain_root, root_build_dir) |
351 ldflags += [ "--gcc-toolchain=$_rebased_android_toolchain_root" ] | 351 ldflags += [ "--gcc-toolchain=$_rebased_android_toolchain_root" ] |
352 } | 352 } |
353 | 353 |
354 if (is_posix && (use_gold || (use_lld && !is_nacl)) && !using_sanitizer && | 354 if (is_posix && (use_gold || (use_lld && !is_nacl)) && !using_sanitizer && |
355 !(is_android && use_order_profiling)) { | 355 !(is_android && use_order_profiling)) { |
356 # TODO(crbug.com/576197) - gcc on x86 platforms + gold + icf=all | 356 # TODO(crbug.com/576197) - gcc on x86 platforms + gold + icf=all |
357 # doesn't currently work. Once it does, use icf=all everywhere. | 357 # doesn't currently work. Once it does, use icf=all everywhere. |
358 # Additionally, on Android x86 --icf=safe seems to cause issues as well. | 358 # Additionally, on Android x86 --icf=safe seems to cause issues as well. |
359 if (is_clang || (target_cpu != "x86" && target_cpu != "x64")) { | 359 if (is_clang || (current_cpu != "x86" && current_cpu != "x64")) { |
360 ldflags += [ "-Wl,--icf=all" ] | 360 ldflags += [ "-Wl,--icf=all" ] |
361 } else if (!is_android) { | 361 } else if (!is_android) { |
362 ldflags += [ "-Wl,--icf=safe" ] | 362 ldflags += [ "-Wl,--icf=safe" ] |
363 } | 363 } |
364 } | 364 } |
365 | 365 |
366 if (linux_use_bundled_binutils) { | 366 if (linux_use_bundled_binutils) { |
367 cflags += [ "-B$binutils_path" ] | 367 cflags += [ "-B$binutils_path" ] |
368 } | 368 } |
369 | 369 |
(...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1220 # can be removed at link time with --gc-sections. | 1220 # can be removed at link time with --gc-sections. |
1221 "-fdata-sections", | 1221 "-fdata-sections", |
1222 "-ffunction-sections", | 1222 "-ffunction-sections", |
1223 ] | 1223 ] |
1224 common_optimize_on_ldflags = [] | 1224 common_optimize_on_ldflags = [] |
1225 | 1225 |
1226 if (is_android) { | 1226 if (is_android) { |
1227 # We don't omit frame pointers on arm64 since they are required | 1227 # We don't omit frame pointers on arm64 since they are required |
1228 # to correctly unwind stackframes which contain system library | 1228 # to correctly unwind stackframes which contain system library |
1229 # function frames (crbug.com/391706). | 1229 # function frames (crbug.com/391706). |
1230 if (!using_sanitizer && !enable_profiling && target_cpu != "arm64") { | 1230 if (!using_sanitizer && !enable_profiling && current_cpu != "arm64") { |
1231 common_optimize_on_cflags += [ "-fomit-frame-pointer" ] | 1231 common_optimize_on_cflags += [ "-fomit-frame-pointer" ] |
1232 } | 1232 } |
1233 | 1233 |
1234 # TODO(jdduke) Re-enable on mips after resolving linking | 1234 # TODO(jdduke) Re-enable on mips after resolving linking |
1235 # issues with libc++ (crbug.com/456380). | 1235 # issues with libc++ (crbug.com/456380). |
1236 if (current_cpu != "mipsel" && current_cpu != "mips64el") { | 1236 if (current_cpu != "mipsel" && current_cpu != "mips64el") { |
1237 common_optimize_on_ldflags += [ | 1237 common_optimize_on_ldflags += [ |
1238 # Warn in case of text relocations. | 1238 # Warn in case of text relocations. |
1239 "-Wl,--warn-shared-textrel", | 1239 "-Wl,--warn-shared-textrel", |
1240 ] | 1240 ] |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1319 # much even when optimization is disabled to get the binary size down. | 1319 # much even when optimization is disabled to get the binary size down. |
1320 cflags = [ | 1320 cflags = [ |
1321 "-Os", | 1321 "-Os", |
1322 "-fdata-sections", | 1322 "-fdata-sections", |
1323 "-ffunction-sections", | 1323 "-ffunction-sections", |
1324 ] | 1324 ] |
1325 | 1325 |
1326 # We don't omit frame pointers on arm64 since they are required | 1326 # We don't omit frame pointers on arm64 since they are required |
1327 # to correctly unwind stackframes which contain system library | 1327 # to correctly unwind stackframes which contain system library |
1328 # function frames (crbug.com/391706). | 1328 # function frames (crbug.com/391706). |
1329 if (!using_sanitizer && !enable_profiling && target_cpu != "arm64") { | 1329 if (!using_sanitizer && !enable_profiling && current_cpu != "arm64") { |
1330 cflags += [ "-fomit-frame-pointer" ] | 1330 cflags += [ "-fomit-frame-pointer" ] |
1331 } | 1331 } |
1332 | 1332 |
1333 # Don't use gc-sections since it can cause links to succeed when they | 1333 # Don't use gc-sections since it can cause links to succeed when they |
1334 # actually shouldn't. http://crbug.com/159847 | 1334 # actually shouldn't. http://crbug.com/159847 |
1335 ldflags = common_optimize_on_ldflags - [ "-Wl,--gc-sections" ] | 1335 ldflags = common_optimize_on_ldflags - [ "-Wl,--gc-sections" ] |
1336 } else { | 1336 } else { |
1337 cflags = [ "-O0" ] | 1337 cflags = [ "-O0" ] |
1338 ldflags = [] | 1338 ldflags = [] |
1339 } | 1339 } |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1480 | 1480 |
1481 if (is_ios || is_mac) { | 1481 if (is_ios || is_mac) { |
1482 # On Mac and iOS, this enables support for ARC (automatic ref-counting). | 1482 # On Mac and iOS, this enables support for ARC (automatic ref-counting). |
1483 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. | 1483 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. |
1484 config("enable_arc") { | 1484 config("enable_arc") { |
1485 common_flags = [ "-fobjc-arc" ] | 1485 common_flags = [ "-fobjc-arc" ] |
1486 cflags_objc = common_flags | 1486 cflags_objc = common_flags |
1487 cflags_objcc = common_flags | 1487 cflags_objcc = common_flags |
1488 } | 1488 } |
1489 } | 1489 } |
OLD | NEW |