Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Side by Side Diff: build/config/compiler/BUILD.gn

Issue 951983002: Reland "Enable libc++ on Android" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix clang+mesa Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « build/config/android/config.gni ('k') | net/base/net_util_linux.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 if (current_cpu == "arm") { 7 if (current_cpu == "arm") {
8 import("//build/config/arm.gni") 8 import("//build/config/arm.gni")
9 } 9 }
10 if (current_cpu == "mipsel" || current_cpu == "mips64el") { 10 if (current_cpu == "mipsel" || current_cpu == "mips64el") {
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 if (is_clang) { 455 if (is_clang) {
456 # Let clang find the ld.gold in the NDK. 456 # Let clang find the ld.gold in the NDK.
457 ldflags += [ "--gcc-toolchain=" + 457 ldflags += [ "--gcc-toolchain=" +
458 rebase_path(android_toolchain_root, root_build_dir) ] 458 rebase_path(android_toolchain_root, root_build_dir) ]
459 } 459 }
460 } 460 }
461 461
462 ldflags += [ 462 ldflags += [
463 "-Wl,--no-undefined", 463 "-Wl,--no-undefined",
464 464
465 # Don't allow visible symbols from libgcc or stlport to be 465 # Don't allow visible symbols from libgcc or libc++ to be
466 # re-exported. 466 # re-exported.
467 "-Wl,--exclude-libs=libgcc.a", 467 "-Wl,--exclude-libs=libgcc.a",
468 "-Wl,--exclude-libs=libstlport_static.a", 468 "-Wl,--exclude-libs=libc++_static.a",
469 469
470 # Don't allow visible symbols from libraries that contain 470 # Don't allow visible symbols from libraries that contain
471 # assembly code with symbols that aren't hidden properly. 471 # assembly code with symbols that aren't hidden properly.
472 # http://crbug.com/448386 472 # http://crbug.com/448386
473 "-Wl,--exclude-libs=libvpx_assembly_arm.a", 473 "-Wl,--exclude-libs=libvpx_assembly_arm.a",
474 ] 474 ]
475 if (current_cpu == "arm") { 475 if (current_cpu == "arm") {
476 ldflags += [ 476 ldflags += [
477 # Enable identical code folding to reduce size. 477 # Enable identical code folding to reduce size.
478 "-Wl,--icf=safe", 478 "-Wl,--icf=safe",
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 if (is_win) { 540 if (is_win) {
541 defines += [ 541 defines += [
542 "__STD_C", 542 "__STD_C",
543 "_CRT_RAND_S", 543 "_CRT_RAND_S",
544 "_CRT_SECURE_NO_DEPRECATE", 544 "_CRT_SECURE_NO_DEPRECATE",
545 "_HAS_EXCEPTIONS=0", 545 "_HAS_EXCEPTIONS=0",
546 "_SCL_SECURE_NO_DEPRECATE", 546 "_SCL_SECURE_NO_DEPRECATE",
547 ] 547 ]
548 } 548 }
549 549
550 # Stlport setup. Android uses a different (smaller) version of the STL. 550 # Android standard library setup.
551 if (is_android) { 551 if (is_android) {
552 if (is_clang) { 552 if (is_clang) {
553 # Work around incompatibilities between bionic and clang headers. 553 # Work around incompatibilities between bionic and clang headers.
554 defines += [ 554 defines += [
555 "__compiler_offsetof=__builtin_offsetof", 555 "__compiler_offsetof=__builtin_offsetof",
556 "nan=__builtin_nan", 556 "nan=__builtin_nan",
557 ] 557 ]
558 } 558 }
559 559
560 defines += [ 560 defines += [ "__GNU_SOURCE=1" ] # Necessary for clone().
561 "USE_STLPORT=1",
562 "_STLP_USE_PTR_SPECIALIZATIONS=1",
563 "__GNU_SOURCE=1", # Necessary for clone().
564 ]
565 561
566 # TODO(jdduke) Re-enable on mips after resolving linking 562 # TODO(jdduke) Re-enable on mips after resolving linking
567 # issues with libc++ (crbug.com/456380). 563 # issues with libc++ (crbug.com/456380).
568 if (current_cpu != "mipsel" && current_cpu != "mips64el") { 564 if (current_cpu != "mipsel" && current_cpu != "mips64el") {
569 ldflags += [ "-Wl,--warn-shared-textrel" ] 565 ldflags += [ "-Wl,--warn-shared-textrel" ]
570 } 566 }
571 ldflags += [ "-nostdlib" ] 567 ldflags += [ "-nostdlib" ]
572 568
573 # NOTE: The stlport header include paths below are specified in cflags 569 # NOTE: The libc++ header include paths below are specified in cflags
574 # 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.
575 # 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
576 # arm-linux-androideabi-4.4.3 toolchain (circa Gingerbread) will exhibit 572 # arm-linux-androideabi-4.4.3 toolchain (circa Gingerbread) will exhibit
577 # strange errors. The include ordering here is important; change with 573 # strange errors. The include ordering here is important; change with
578 # caution. 574 # caution.
579 android_stlport_root = "$android_ndk_root/sources/cxx-stl/stlport" 575 android_libcpp_root = "$android_ndk_root/sources/cxx-stl/llvm-libc++"
580 576
581 cflags += [ "-isystem" + 577 cflags += [
582 rebase_path("$android_stlport_root/stlport", root_build_dir) ] 578 "-isystem" +
583 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" ]
584 589
585 if (component_mode == "shared_library") { 590 if (component_mode == "shared_library") {
586 libs += [ "stlport_shared" ] 591 android_libcpp_library = "c++_shared"
587 } else { 592 } else {
588 libs += [ "stlport_static" ] 593 android_libcpp_library = "c++_static"
589 }
590
591 if (current_cpu == "mipsel") {
592 libs += [
593 # ld linker is used for mips Android, and ld does not accept library
594 # absolute path prefixed by "-l"; Since libgcc does not exist in mips
595 # sysroot the proper library will be linked.
596 # TODO(gordanac): Remove once gold linker is used for mips Android.
597 "gcc",
598 ]
599 } else {
600 libs += [
601 # Manually link the libgcc.a that the cross compiler uses. This is
602 # absolute because the linker will look inside the sysroot if it's not.
603 rebase_path(android_libgcc_file),
604 ]
605 } 594 }
606 595
607 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),
608 "c", 602 "c",
609 "dl", 603 "dl",
610 "m", 604 "m",
611 ] 605 ]
606
607 # Clang with libc++ does not require an explicit atomic library reference.
608 if (!is_clang) {
609 libs += [ "atomic" ]
610 }
612 } 611 }
613 } 612 }
614 613
615 # chromium_code --------------------------------------------------------------- 614 # chromium_code ---------------------------------------------------------------
616 # 615 #
617 # 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)
618 # part of Chromium. 617 # part of Chromium.
619 618
620 config("chromium_code") { 619 config("chromium_code") {
621 if (is_win) { 620 if (is_win) {
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
1088 cflags += [ "-gsplit-dwarf" ] 1087 cflags += [ "-gsplit-dwarf" ]
1089 } 1088 }
1090 } 1089 }
1091 } 1090 }
1092 1091
1093 config("no_symbols") { 1092 config("no_symbols") {
1094 if (!is_win) { 1093 if (!is_win) {
1095 cflags = [ "-g0" ] 1094 cflags = [ "-g0" ]
1096 } 1095 }
1097 } 1096 }
OLDNEW
« no previous file with comments | « build/config/android/config.gni ('k') | net/base/net_util_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698