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 "-Wl,--threads", | 383 # TODO(raymes): Disable threading because gold is frequently |
384 "-Wl,--thread-count=4", | 384 # crashing on the bots: crbug.com/161942. |
| 385 #"-Wl,--threads", |
| 386 #"-Wl,--thread-count=4", |
385 ] | 387 ] |
386 } | 388 } |
387 | 389 |
388 if (linux_use_bundled_binutils) { | 390 if (linux_use_bundled_binutils) { |
389 binutils_path = rebase_path("//third_party/binutils/Linux_x64/Release/bin", | 391 binutils_path = rebase_path("//third_party/binutils/Linux_x64/Release/bin", |
390 root_build_dir) | 392 root_build_dir) |
391 cflags += [ "-B$binutils_path" ] | 393 cflags += [ "-B$binutils_path" ] |
392 } | 394 } |
393 | 395 |
394 # Clang-specific compiler flags setup. | 396 # Clang-specific compiler flags setup. |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 defines += [ | 524 defines += [ |
523 "__STD_C", | 525 "__STD_C", |
524 "__STDC_CONSTANT_MACROS", | 526 "__STDC_CONSTANT_MACROS", |
525 "__STDC_FORMAT_MACROS", | 527 "__STDC_FORMAT_MACROS", |
526 "_CRT_RAND_S", | 528 "_CRT_RAND_S", |
527 "_CRT_SECURE_NO_DEPRECATE", | 529 "_CRT_SECURE_NO_DEPRECATE", |
528 "_SCL_SECURE_NO_DEPRECATE", | 530 "_SCL_SECURE_NO_DEPRECATE", |
529 ] | 531 ] |
530 } | 532 } |
531 | 533 |
532 # Android standard library setup. | 534 # Stlport setup. Android uses a different (smaller) version of the STL. |
533 if (is_android) { | 535 if (is_android) { |
534 if (is_clang) { | 536 if (is_clang) { |
535 # Work around incompatibilities between bionic and clang headers. | 537 # Work around incompatibilities between bionic and clang headers. |
536 defines += [ | 538 defines += [ |
537 "__compiler_offsetof=__builtin_offsetof", | 539 "__compiler_offsetof=__builtin_offsetof", |
538 "nan=__builtin_nan", | 540 "nan=__builtin_nan", |
539 ] | 541 ] |
540 } | 542 } |
541 | 543 |
542 defines += [ "__GNU_SOURCE=1" ] # Necessary for clone(). | 544 defines += [ |
| 545 "USE_STLPORT=1", |
| 546 "_STLP_USE_PTR_SPECIALIZATIONS=1", |
| 547 "__GNU_SOURCE=1", # Necessary for clone(). |
| 548 ] |
543 | 549 |
544 ldflags += [ | 550 ldflags += [ |
545 "-Wl,--warn-shared-textrel", | 551 "-Wl,--warn-shared-textrel", |
546 "-nostdlib", | 552 "-nostdlib", |
547 ] | 553 ] |
548 | 554 |
549 android_libcpp_root = "$android_ndk_root/sources/cxx-stl/llvm-libc++" | 555 # NOTE: The stlport header include paths below are specified in cflags |
| 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" |
550 | 562 |
551 cflags += [ | 563 cflags += [ "-isystem" + |
552 "-isystem" + | 564 rebase_path("$android_stlport_root/stlport", root_build_dir) ] |
553 rebase_path("$android_libcpp_root/libcxx/include", root_build_dir), | 565 lib_dirs += [ "$android_stlport_root/libs/$android_app_abi" ] |
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" ] | |
563 | 566 |
564 if (component_mode == "shared_library") { | 567 if (component_mode == "shared_library") { |
565 android_libcpp_library = "c++_shared" | 568 libs += [ "stlport_shared" ] |
566 } else { | 569 } else { |
567 android_libcpp_library = "c++_static" | 570 libs += [ "stlport_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 ] |
568 } | 587 } |
569 | 588 |
570 libs += [ | 589 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", | |
578 "c", | 590 "c", |
579 "dl", | 591 "dl", |
| 592 "m", |
580 ] | 593 ] |
581 } | 594 } |
582 } | 595 } |
583 | 596 |
584 # chromium_code --------------------------------------------------------------- | 597 # chromium_code --------------------------------------------------------------- |
585 # | 598 # |
586 # Toggles between higher and lower warnings for code that is (or isn't) | 599 # Toggles between higher and lower warnings for code that is (or isn't) |
587 # part of Chromium. | 600 # part of Chromium. |
588 | 601 |
589 config("chromium_code") { | 602 config("chromium_code") { |
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1040 cflags += [ "-gsplit-dwarf" ] | 1053 cflags += [ "-gsplit-dwarf" ] |
1041 } | 1054 } |
1042 } | 1055 } |
1043 } | 1056 } |
1044 | 1057 |
1045 config("no_symbols") { | 1058 config("no_symbols") { |
1046 if (!is_win) { | 1059 if (!is_win) { |
1047 cflags = [ "-g0" ] | 1060 cflags = [ "-g0" ] |
1048 } | 1061 } |
1049 } | 1062 } |
OLD | NEW |