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 if (current_cpu == "arm") { | 7 if (current_cpu == "arm") { |
7 import("//build/config/arm.gni") | 8 import("//build/config/arm.gni") |
8 } | 9 } |
9 if (current_cpu == "mipsel" || current_cpu == "mips64el") { | 10 if (current_cpu == "mipsel" || current_cpu == "mips64el") { |
10 import("//build/config/mips.gni") | 11 import("//build/config/mips.gni") |
11 } | 12 } |
12 if (is_posix) { | 13 if (is_posix) { |
13 import("//build/config/gcc/gcc_version.gni") | 14 import("//build/config/gcc/gcc_version.gni") |
14 } | 15 } |
15 | 16 |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 if (is_clang) { | 455 if (is_clang) { |
455 # Let clang find the ld.gold in the NDK. | 456 # Let clang find the ld.gold in the NDK. |
456 ldflags += [ "--gcc-toolchain=" + | 457 ldflags += [ "--gcc-toolchain=" + |
457 rebase_path(android_toolchain_root, root_build_dir) ] | 458 rebase_path(android_toolchain_root, root_build_dir) ] |
458 } | 459 } |
459 } | 460 } |
460 | 461 |
461 ldflags += [ | 462 ldflags += [ |
462 "-Wl,--no-undefined", | 463 "-Wl,--no-undefined", |
463 | 464 |
464 # Don't allow visible symbols from libgcc or stlport to be | 465 # Don't allow visible symbols from libgcc or libc++ to be |
465 # re-exported. | 466 # re-exported. |
466 "-Wl,--exclude-libs=libgcc.a", | 467 "-Wl,--exclude-libs=libgcc.a", |
467 "-Wl,--exclude-libs=libstlport_static.a", | 468 "-Wl,--exclude-libs=libc++_static.a", |
468 | 469 |
469 # Don't allow visible symbols from libraries that contain | 470 # Don't allow visible symbols from libraries that contain |
470 # assembly code with symbols that aren't hidden properly. | 471 # assembly code with symbols that aren't hidden properly. |
471 # http://crbug.com/448386 | 472 # http://crbug.com/448386 |
472 "-Wl,--exclude-libs=libvpx_assembly_arm.a", | 473 "-Wl,--exclude-libs=libvpx_assembly_arm.a", |
473 ] | 474 ] |
474 if (current_cpu == "arm") { | 475 if (current_cpu == "arm") { |
475 ldflags += [ | 476 ldflags += [ |
476 # Enable identical code folding to reduce size. | 477 # Enable identical code folding to reduce size. |
477 "-Wl,--icf=safe", | 478 "-Wl,--icf=safe", |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 if (is_win) { | 540 if (is_win) { |
540 defines += [ | 541 defines += [ |
541 "__STD_C", | 542 "__STD_C", |
542 "_CRT_RAND_S", | 543 "_CRT_RAND_S", |
543 "_CRT_SECURE_NO_DEPRECATE", | 544 "_CRT_SECURE_NO_DEPRECATE", |
544 "_HAS_EXCEPTIONS=0", | 545 "_HAS_EXCEPTIONS=0", |
545 "_SCL_SECURE_NO_DEPRECATE", | 546 "_SCL_SECURE_NO_DEPRECATE", |
546 ] | 547 ] |
547 } | 548 } |
548 | 549 |
549 # Stlport setup. Android uses a different (smaller) version of the STL. | 550 # Android standard library setup. |
550 if (is_android) { | 551 if (is_android) { |
551 if (is_clang) { | 552 if (is_clang) { |
552 # Work around incompatibilities between bionic and clang headers. | 553 # Work around incompatibilities between bionic and clang headers. |
553 defines += [ | 554 defines += [ |
554 "__compiler_offsetof=__builtin_offsetof", | 555 "__compiler_offsetof=__builtin_offsetof", |
555 "nan=__builtin_nan", | 556 "nan=__builtin_nan", |
556 ] | 557 ] |
557 } | 558 } |
558 | 559 |
559 defines += [ | 560 defines += [ "__GNU_SOURCE=1" ] # Necessary for clone(). |
560 "USE_STLPORT=1", | |
561 "_STLP_USE_PTR_SPECIALIZATIONS=1", | |
562 "__GNU_SOURCE=1", # Necessary for clone(). | |
563 ] | |
564 | 561 |
565 # TODO(jdduke) Re-enable on mips after resolving linking | 562 # TODO(jdduke) Re-enable on mips after resolving linking |
566 # issues with libc++ (crbug.com/456380). | 563 # issues with libc++ (crbug.com/456380). |
567 if (current_cpu != "mipsel" && current_cpu != "mips64el") { | 564 if (current_cpu != "mipsel" && current_cpu != "mips64el") { |
568 ldflags += [ "-Wl,--warn-shared-textrel" ] | 565 ldflags += [ "-Wl,--warn-shared-textrel" ] |
569 } | 566 } |
570 ldflags += [ "-nostdlib" ] | 567 ldflags += [ "-nostdlib" ] |
571 | 568 |
572 # NOTE: The stlport header include paths below are specified in cflags | 569 # NOTE: The libc++ header include paths below are specified in cflags |
573 # rather than include_dirs because they need to come after include_dirs. | 570 # rather than include_dirs because they need to come after include_dirs. |
574 # Think of them like system headers, but don't use '-isystem' because the | 571 # Think of them like system headers, but don't use '-isystem' because the |
575 # arm-linux-androideabi-4.4.3 toolchain (circa Gingerbread) will exhibit | 572 # arm-linux-androideabi-4.4.3 toolchain (circa Gingerbread) will exhibit |
576 # strange errors. The include ordering here is important; change with | 573 # strange errors. The include ordering here is important; change with |
577 # caution. | 574 # caution. |
578 android_stlport_root = "$android_ndk_root/sources/cxx-stl/stlport" | 575 android_libcpp_root = "$android_ndk_root/sources/cxx-stl/llvm-libc++" |
579 | 576 |
580 cflags += [ "-isystem" + | 577 cflags += [ |
581 rebase_path("$android_stlport_root/stlport", root_build_dir) ] | 578 "-isystem" + |
582 lib_dirs += [ "$android_stlport_root/libs/$android_app_abi" ] | 579 rebase_path("$android_libcpp_root/libcxx/include", root_build_dir), |
| 580 "-isystem" + rebase_path( |
| 581 "$android_ndk_root/sources/cxx-stl/llvm-libc++abi/libcxxabi/includ
e", |
| 582 root_build_dir), |
| 583 "-isystem" + |
| 584 rebase_path("$android_ndk_root/sources/android/support/include", |
| 585 root_build_dir), |
| 586 ] |
| 587 |
| 588 lib_dirs += [ "$android_libcpp_root/libs/$android_app_abi" ] |
583 | 589 |
584 if (component_mode == "shared_library") { | 590 if (component_mode == "shared_library") { |
585 libs += [ "stlport_shared" ] | 591 android_libcpp_library = "c++_shared" |
586 } else { | 592 } else { |
587 libs += [ "stlport_static" ] | 593 android_libcpp_library = "c++_static" |
588 } | |
589 | |
590 if (current_cpu == "mipsel") { | |
591 libs += [ | |
592 # ld linker is used for mips Android, and ld does not accept library | |
593 # absolute path prefixed by "-l"; Since libgcc does not exist in mips | |
594 # sysroot the proper library will be linked. | |
595 # TODO(gordanac): Remove once gold linker is used for mips Android. | |
596 "gcc", | |
597 ] | |
598 } else { | |
599 libs += [ | |
600 # Manually link the libgcc.a that the cross compiler uses. This is | |
601 # absolute because the linker will look inside the sysroot if it's not. | |
602 rebase_path(android_libgcc_file), | |
603 ] | |
604 } | 594 } |
605 | 595 |
606 libs += [ | 596 libs += [ |
| 597 "$android_libcpp_library", |
| 598 |
| 599 # Manually link the libgcc.a that the cross compiler uses. This is |
| 600 # absolute because the linker will look inside the sysroot if it's not. |
| 601 rebase_path(android_libgcc_file), |
607 "c", | 602 "c", |
608 "dl", | 603 "dl", |
609 "m", | 604 "m", |
610 ] | 605 ] |
| 606 |
| 607 # Clang with libc++ does not require an explicit atomic library reference. |
| 608 if (!is_clang) { |
| 609 libs += [ "atomic" ] |
| 610 } |
611 } | 611 } |
612 } | 612 } |
613 | 613 |
614 # chromium_code --------------------------------------------------------------- | 614 # chromium_code --------------------------------------------------------------- |
615 # | 615 # |
616 # Toggles between higher and lower warnings for code that is (or isn't) | 616 # Toggles between higher and lower warnings for code that is (or isn't) |
617 # part of Chromium. | 617 # part of Chromium. |
618 | 618 |
619 config("chromium_code") { | 619 config("chromium_code") { |
620 if (is_win) { | 620 if (is_win) { |
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1087 cflags += [ "-gsplit-dwarf" ] | 1087 cflags += [ "-gsplit-dwarf" ] |
1088 } | 1088 } |
1089 } | 1089 } |
1090 } | 1090 } |
1091 | 1091 |
1092 config("no_symbols") { | 1092 config("no_symbols") { |
1093 if (!is_win) { | 1093 if (!is_win) { |
1094 cflags = [ "-g0" ] | 1094 cflags = [ "-g0" ] |
1095 } | 1095 } |
1096 } | 1096 } |
OLD | NEW |