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 if (cpu_arch == "arm") { | 6 if (cpu_arch == "arm") { |
7 import("//build/config/arm.gni") | 7 import("//build/config/arm.gni") |
8 } | 8 } |
9 if (cpu_arch == "mipsel" || cpu_arch == "mips64el") { | 9 if (cpu_arch == "mipsel" || cpu_arch == "mips64el") { |
10 import("//build/config/mips.gni") | 10 import("//build/config/mips.gni") |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 "-fuse-ld=gold", | 373 "-fuse-ld=gold", |
374 | 374 |
375 # TODO(brettw) common.gypi has this only for target toolset. | 375 # TODO(brettw) common.gypi has this only for target toolset. |
376 "-Wl,--icf=safe", | 376 "-Wl,--icf=safe", |
377 | 377 |
378 # Experimentation found that using four linking threads | 378 # Experimentation found that using four linking threads |
379 # saved ~20% of link time. | 379 # saved ~20% of link time. |
380 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_threa
d/thread/281527606915bb36 | 380 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_threa
d/thread/281527606915bb36 |
381 # Only apply this to the target linker, since the host | 381 # Only apply this to the target linker, since the host |
382 # linker might not be gold, but isn't used much anyway. | 382 # linker might not be gold, but isn't used much anyway. |
383 # TODO(raymes): Disable threading because gold is frequently | 383 "-Wl,--threads", |
384 # crashing on the bots: crbug.com/161942. | 384 "-Wl,--thread-count=4", |
385 #"-Wl,--threads", | |
386 #"-Wl,--thread-count=4", | |
387 ] | 385 ] |
388 } | 386 } |
389 | 387 |
390 if (linux_use_bundled_binutils) { | 388 if (linux_use_bundled_binutils) { |
391 binutils_path = rebase_path("//third_party/binutils/Linux_x64/Release/bin", | 389 binutils_path = rebase_path("//third_party/binutils/Linux_x64/Release/bin", |
392 root_build_dir) | 390 root_build_dir) |
393 cflags += [ "-B$binutils_path" ] | 391 cflags += [ "-B$binutils_path" ] |
394 } | 392 } |
395 | 393 |
396 # Clang-specific compiler flags setup. | 394 # Clang-specific compiler flags setup. |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 defines += [ | 522 defines += [ |
525 "__STD_C", | 523 "__STD_C", |
526 "__STDC_CONSTANT_MACROS", | 524 "__STDC_CONSTANT_MACROS", |
527 "__STDC_FORMAT_MACROS", | 525 "__STDC_FORMAT_MACROS", |
528 "_CRT_RAND_S", | 526 "_CRT_RAND_S", |
529 "_CRT_SECURE_NO_DEPRECATE", | 527 "_CRT_SECURE_NO_DEPRECATE", |
530 "_SCL_SECURE_NO_DEPRECATE", | 528 "_SCL_SECURE_NO_DEPRECATE", |
531 ] | 529 ] |
532 } | 530 } |
533 | 531 |
534 # Stlport setup. Android uses a different (smaller) version of the STL. | 532 # Android standard library setup. |
535 if (is_android) { | 533 if (is_android) { |
536 if (is_clang) { | 534 if (is_clang) { |
537 # Work around incompatibilities between bionic and clang headers. | 535 # Work around incompatibilities between bionic and clang headers. |
538 defines += [ | 536 defines += [ |
539 "__compiler_offsetof=__builtin_offsetof", | 537 "__compiler_offsetof=__builtin_offsetof", |
540 "nan=__builtin_nan", | 538 "nan=__builtin_nan", |
541 ] | 539 ] |
542 } | 540 } |
543 | 541 |
544 defines += [ | 542 defines += [ "__GNU_SOURCE=1" ] # Necessary for clone(). |
545 "USE_STLPORT=1", | |
546 "_STLP_USE_PTR_SPECIALIZATIONS=1", | |
547 "__GNU_SOURCE=1", # Necessary for clone(). | |
548 ] | |
549 | 543 |
550 ldflags += [ | 544 ldflags += [ |
551 "-Wl,--warn-shared-textrel", | 545 "-Wl,--warn-shared-textrel", |
552 "-nostdlib", | 546 "-nostdlib", |
553 ] | 547 ] |
554 | 548 |
555 # NOTE: The stlport header include paths below are specified in cflags | 549 android_libcpp_root = "$android_ndk_root/sources/cxx-stl/llvm-libc++" |
556 # rather than include_dirs because they need to come after include_dirs. | |
557 # Think of them like system headers, but don't use '-isystem' because the | |
558 # arm-linux-androideabi-4.4.3 toolchain (circa Gingerbread) will exhibit | |
559 # strange errors. The include ordering here is important; change with | |
560 # caution. | |
561 android_stlport_root = "$android_ndk_root/sources/cxx-stl/stlport" | |
562 | 550 |
563 cflags += [ "-isystem" + | 551 cflags += [ |
564 rebase_path("$android_stlport_root/stlport", root_build_dir) ] | 552 "-isystem" + |
565 lib_dirs += [ "$android_stlport_root/libs/$android_app_abi" ] | 553 rebase_path("$android_libcpp_root/libcxx/include", root_build_dir), |
| 554 "-isystem" + rebase_path( |
| 555 "$android_ndk_root/sources/cxx-stl/llvm-libc++abi/libcxxabi/includ
e", |
| 556 root_build_dir), |
| 557 "-isystem" + |
| 558 rebase_path("$android_ndk_root/sources/android/support/include", |
| 559 root_build_dir), |
| 560 ] |
| 561 |
| 562 lib_dirs += [ "$android_libcpp_root/libs/$android_app_abi" ] |
566 | 563 |
567 if (component_mode == "shared_library") { | 564 if (component_mode == "shared_library") { |
568 libs += [ "stlport_shared" ] | 565 android_libcpp_library = "c++_shared" |
569 } else { | 566 } else { |
570 libs += [ "stlport_static" ] | 567 android_libcpp_library = "c++_static" |
571 } | |
572 | |
573 if (cpu_arch == "mipsel") { | |
574 libs += [ | |
575 # ld linker is used for mips Android, and ld does not accept library | |
576 # absolute path prefixed by "-l"; Since libgcc does not exist in mips | |
577 # sysroot the proper library will be linked. | |
578 # TODO(gordanac): Remove once gold linker is used for mips Android. | |
579 "gcc", | |
580 ] | |
581 } else { | |
582 libs += [ | |
583 # Manually link the libgcc.a that the cross compiler uses. This is | |
584 # absolute because the linker will look inside the sysroot if it's not. | |
585 rebase_path(android_libgcc_file), | |
586 ] | |
587 } | 568 } |
588 | 569 |
589 libs += [ | 570 libs += [ |
| 571 "$android_libcpp_library", |
| 572 "atomic", |
| 573 |
| 574 # Manually link the libgcc.a that the cross compiler uses. This is |
| 575 # absolute because the linker will look inside the sysroot if it's not. |
| 576 rebase_path(android_libgcc_file), |
| 577 "m", |
590 "c", | 578 "c", |
591 "dl", | 579 "dl", |
592 "m", | |
593 ] | 580 ] |
594 } | 581 } |
595 } | 582 } |
596 | 583 |
597 # chromium_code --------------------------------------------------------------- | 584 # chromium_code --------------------------------------------------------------- |
598 # | 585 # |
599 # Toggles between higher and lower warnings for code that is (or isn't) | 586 # Toggles between higher and lower warnings for code that is (or isn't) |
600 # part of Chromium. | 587 # part of Chromium. |
601 | 588 |
602 config("chromium_code") { | 589 config("chromium_code") { |
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1053 cflags += [ "-gsplit-dwarf" ] | 1040 cflags += [ "-gsplit-dwarf" ] |
1054 } | 1041 } |
1055 } | 1042 } |
1056 } | 1043 } |
1057 | 1044 |
1058 config("no_symbols") { | 1045 config("no_symbols") { |
1059 if (!is_win) { | 1046 if (!is_win) { |
1060 cflags = [ "-g0" ] | 1047 cflags = [ "-g0" ] |
1061 } | 1048 } |
1062 } | 1049 } |
OLD | NEW |