Chromium Code Reviews| 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 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 487 # without using everything that "compiler" brings in. Options that | 487 # without using everything that "compiler" brings in. Options that |
| 488 # tweak code generation for a particular CPU do not belong here! | 488 # tweak code generation for a particular CPU do not belong here! |
| 489 # See "compiler_codegen", below. | 489 # See "compiler_codegen", below. |
| 490 config("compiler_cpu_abi") { | 490 config("compiler_cpu_abi") { |
| 491 cflags = [] | 491 cflags = [] |
| 492 ldflags = [] | 492 ldflags = [] |
| 493 | 493 |
| 494 if (is_posix && !(is_mac || is_ios)) { | 494 if (is_posix && !(is_mac || is_ios)) { |
| 495 # CPU architecture. We may or may not be doing a cross compile now, so for | 495 # CPU architecture. We may or may not be doing a cross compile now, so for |
| 496 # simplicity we always explicitly set the architecture. | 496 # simplicity we always explicitly set the architecture. |
| 497 if (current_cpu == "x64") { | 497 if (target_cpu == "x64") { |
|
Dirk Pranke
2016/06/23 16:22:43
I think these changes are wrong and the existing c
| |
| 498 cflags += [ | 498 cflags += [ |
| 499 "-m64", | 499 "-m64", |
| 500 "-march=x86-64", | 500 "-march=x86-64", |
| 501 ] | 501 ] |
| 502 ldflags += [ "-m64" ] | 502 ldflags += [ "-m64" ] |
| 503 } else if (current_cpu == "x86") { | 503 } else if (target_cpu == "x86") { |
| 504 cflags += [ "-m32" ] | 504 cflags += [ "-m32" ] |
| 505 ldflags += [ "-m32" ] | 505 ldflags += [ "-m32" ] |
| 506 if (!is_nacl) { | 506 if (!is_nacl) { |
| 507 cflags += [ | 507 cflags += [ |
| 508 "-msse2", | 508 "-msse2", |
| 509 "-mfpmath=sse", | 509 "-mfpmath=sse", |
| 510 "-mmmx", | 510 "-mmmx", |
| 511 ] | 511 ] |
| 512 } | 512 } |
| 513 } else if (current_cpu == "arm") { | 513 } else if (target_cpu == "arm") { |
| 514 if (is_clang && !is_android && !is_nacl) { | 514 if (is_clang && !is_android && !is_nacl) { |
| 515 cflags += [ "--target=arm-linux-gnueabihf" ] | 515 cflags += [ "--target=arm-linux-gnueabihf" ] |
| 516 ldflags += [ "--target=arm-linux-gnueabihf" ] | 516 ldflags += [ "--target=arm-linux-gnueabihf" ] |
| 517 } | 517 } |
| 518 if (!is_nacl) { | 518 if (!is_nacl) { |
| 519 cflags += [ | 519 cflags += [ |
| 520 "-march=$arm_arch", | 520 "-march=$arm_arch", |
| 521 "-mfloat-abi=$arm_float_abi", | 521 "-mfloat-abi=$arm_float_abi", |
| 522 ] | 522 ] |
| 523 if (arm_use_thumb) { | 523 if (arm_use_thumb) { |
| 524 cflags += [ "-mthumb" ] | 524 cflags += [ "-mthumb" ] |
| 525 if (is_android && !is_clang) { | 525 if (is_android && !is_clang) { |
| 526 # Clang doesn't support this option. | 526 # Clang doesn't support this option. |
| 527 cflags += [ "-mthumb-interwork" ] | 527 cflags += [ "-mthumb-interwork" ] |
| 528 } | 528 } |
| 529 } | 529 } |
| 530 } | 530 } |
| 531 if (arm_tune != "") { | 531 if (arm_tune != "") { |
| 532 cflags += [ "-mtune=$arm_tune" ] | 532 cflags += [ "-mtune=$arm_tune" ] |
| 533 } | 533 } |
| 534 } else if (current_cpu == "arm64") { | 534 } else if (target_cpu == "arm64") { |
| 535 if (is_clang && !is_android && !is_nacl) { | 535 if (is_clang && !is_android && !is_nacl) { |
| 536 cflags += [ "--target=aarch64-linux-gnu" ] | 536 cflags += [ "--target=aarch64-linux-gnu" ] |
| 537 ldflags += [ "--target=aarch64-linux-gnu" ] | 537 ldflags += [ "--target=aarch64-linux-gnu" ] |
| 538 } | 538 } |
| 539 } else if (current_cpu == "mipsel") { | 539 } else if (target_cpu == "mipsel") { |
| 540 if (is_clang) { | 540 if (is_clang) { |
| 541 # Temporarily needed due to unsupported MIPS macro instructions | 541 # Temporarily needed due to unsupported MIPS macro instructions |
| 542 # in inline asm code in third_party projects (libwebp and webrtc). | 542 # in inline asm code in third_party projects (libwebp and webrtc). |
| 543 # TODO(lmilko) Enable integrated-as. | 543 # TODO(lmilko) Enable integrated-as. |
| 544 cflags += [ "-fno-integrated-as" ] | 544 cflags += [ "-fno-integrated-as" ] |
| 545 } | 545 } |
| 546 if (mips_arch_variant == "r6") { | 546 if (mips_arch_variant == "r6") { |
| 547 if (is_clang) { | 547 if (is_clang) { |
| 548 cflags += [ | 548 cflags += [ |
| 549 "--target=mipsel-linux-gnu", | 549 "--target=mipsel-linux-gnu", |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 613 } | 613 } |
| 614 } | 614 } |
| 615 | 615 |
| 616 if (mips_dsp_rev == 1) { | 616 if (mips_dsp_rev == 1) { |
| 617 cflags += [ "-mdsp" ] | 617 cflags += [ "-mdsp" ] |
| 618 } else if (mips_dsp_rev == 2) { | 618 } else if (mips_dsp_rev == 2) { |
| 619 cflags += [ "-mdspr2" ] | 619 cflags += [ "-mdspr2" ] |
| 620 } | 620 } |
| 621 | 621 |
| 622 cflags += [ "-m${mips_float_abi}-float" ] | 622 cflags += [ "-m${mips_float_abi}-float" ] |
| 623 } else if (current_cpu == "mips64el") { | 623 } else if (target_cpu == "mips64el") { |
| 624 if (mips_arch_variant == "r6") { | 624 if (mips_arch_variant == "r6") { |
| 625 if (is_clang) { | 625 if (is_clang) { |
| 626 if (is_android) { | 626 if (is_android) { |
| 627 cflags += [ | 627 cflags += [ |
| 628 "--target=mips64el-linux-android", | 628 "--target=mips64el-linux-android", |
| 629 "-march=mips64el", | 629 "-march=mips64el", |
| 630 "-mcpu=mips64r6", | 630 "-mcpu=mips64r6", |
| 631 ] | 631 ] |
| 632 ldflags += [ "--target=mips64el-linux-android" ] | 632 ldflags += [ "--target=mips64el-linux-android" ] |
| 633 } | 633 } |
| 634 } else { | 634 } else { |
| 635 cflags += [ | 635 cflags += [ |
| 636 "-mips64r6", | 636 "-mips64r6", |
| 637 "-Wa,-mips64r6", | 637 "-Wa,-mips64r6", |
| 638 ] | 638 ] |
| 639 ldflags += [ "-mips64r6" ] | 639 ldflags += [ "-mips64r6" ] |
| 640 } | 640 } |
| 641 } else if (mips_arch_variant == "r2") { | 641 } else if (mips_arch_variant == "r2") { |
| 642 cflags += [ | 642 cflags += [ |
| 643 "-mips64r2", | 643 "-mips64r2", |
| 644 "-Wa,-mips64r2", | 644 "-Wa,-mips64r2", |
| 645 ] | 645 ] |
| 646 ldflags += [ "-mips64r2" ] | 646 ldflags += [ "-mips64r2" ] |
| 647 } | 647 } |
| 648 } else if (current_cpu == "pnacl" && is_nacl_nonsfi) { | 648 } else if (target_cpu == "pnacl" && is_nacl_nonsfi) { |
| 649 if (target_cpu == "x86" || target_cpu == "x64") { | 649 if (target_cpu == "x86" || target_cpu == "x64") { |
| 650 cflags += [ | 650 cflags += [ |
| 651 "-arch", | 651 "-arch", |
| 652 "x86-32-nonsfi", | 652 "x86-32-nonsfi", |
| 653 "--pnacl-bias=x86-32-nonsfi", | 653 "--pnacl-bias=x86-32-nonsfi", |
| 654 "--target=i686-unknown-nacl", | 654 "--target=i686-unknown-nacl", |
| 655 ] | 655 ] |
| 656 ldflags += [ | 656 ldflags += [ |
| 657 "-arch", | 657 "-arch", |
| 658 "x86-32-nonsfi", | 658 "x86-32-nonsfi", |
| (...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1538 | 1538 |
| 1539 if (is_ios || is_mac) { | 1539 if (is_ios || is_mac) { |
| 1540 # On Mac and iOS, this enables support for ARC (automatic ref-counting). | 1540 # On Mac and iOS, this enables support for ARC (automatic ref-counting). |
| 1541 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. | 1541 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. |
| 1542 config("enable_arc") { | 1542 config("enable_arc") { |
| 1543 common_flags = [ "-fobjc-arc" ] | 1543 common_flags = [ "-fobjc-arc" ] |
| 1544 cflags_objc = common_flags | 1544 cflags_objc = common_flags |
| 1545 cflags_objcc = common_flags | 1545 cflags_objcc = common_flags |
| 1546 } | 1546 } |
| 1547 } | 1547 } |
| OLD | NEW |