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

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

Issue 835633003: Enable libc++ on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Really fix AOSP Created 5 years, 10 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
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 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 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 defines += [ 524 defines += [
525 "__STD_C", 525 "__STD_C",
526 "__STDC_CONSTANT_MACROS", 526 "__STDC_CONSTANT_MACROS",
527 "__STDC_FORMAT_MACROS", 527 "__STDC_FORMAT_MACROS",
528 "_CRT_RAND_S", 528 "_CRT_RAND_S",
529 "_CRT_SECURE_NO_DEPRECATE", 529 "_CRT_SECURE_NO_DEPRECATE",
530 "_SCL_SECURE_NO_DEPRECATE", 530 "_SCL_SECURE_NO_DEPRECATE",
531 ] 531 ]
532 } 532 }
533 533
534 # Stlport setup. Android uses a different (smaller) version of the STL. 534 # Android setup.
535 if (is_android) { 535 if (is_android) {
536 if (is_clang) { 536 if (is_clang) {
537 # Work around incompatibilities between bionic and clang headers. 537 # Work around incompatibilities between bionic and clang headers.
538 defines += [ 538 defines += [
539 "__compiler_offsetof=__builtin_offsetof", 539 "__compiler_offsetof=__builtin_offsetof",
540 "nan=__builtin_nan", 540 "nan=__builtin_nan",
541 ] 541 ]
542 } 542 }
543 543
544 defines += [ 544 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 545
550 ldflags += [ 546 ldflags += [
551 "-Wl,--warn-shared-textrel", 547 "-Wl,--warn-shared-textrel",
552 "-nostdlib", 548 "-nostdlib",
553 ] 549 ]
554 550
555 # NOTE: The stlport header include paths below are specified in cflags 551 # Libc++ setup.
556 # rather than include_dirs because they need to come after include_dirs. 552 android_libcpp_root = "$android_ndk_root/sources/cxx-stl/llvm-libc++"
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 553
563 cflags += [ "-isystem" + 554 cflags += [
564 rebase_path("$android_stlport_root/stlport", root_build_dir) ] 555 "-isystem" +
565 lib_dirs += [ "$android_stlport_root/libs/$android_app_abi" ] 556 rebase_path("$android_libcpp_root/libcxx/include", root_build_dir),
557 "-isystem" + rebase_path(
558 "$android_ndk_root/sources/cxx-stl/llvm-libc++abi/libcxxabi/includ e",
559 root_build_dir),
560 "-isystem" +
561 rebase_path("$android_ndk_root/sources/android/support/include",
562 root_build_dir),
563 ]
566 564
567 if (component_mode == "shared_library") { 565 lib_dirs += [ "$android_libcpp_root/libs/$android_app_abi" ]
568 libs += [ "stlport_shared" ] 566 libs += [
569 } else { 567 "$android_libcpp_library",
570 libs += [ "stlport_static" ] 568 "atomic",
571 }
572 569
573 if (cpu_arch == "mipsel") { 570 # Manually link the libgcc.a that the cross compiler uses. This is
574 libs += [ 571 # absolute because the linker will look inside the sysroot if it's not.
575 # ld linker is used for mips Android, and ld does not accept library 572 rebase_path(android_libgcc_file),
576 # absolute path prefixed by "-l"; Since libgcc does not exist in mips 573 "m",
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 }
588
589 libs += [
590 "c", 574 "c",
591 "dl", 575 "dl",
592 "m",
593 ] 576 ]
594 } 577 }
595 } 578 }
596 579
597 # chromium_code --------------------------------------------------------------- 580 # chromium_code ---------------------------------------------------------------
598 # 581 #
599 # Toggles between higher and lower warnings for code that is (or isn't) 582 # Toggles between higher and lower warnings for code that is (or isn't)
600 # part of Chromium. 583 # part of Chromium.
601 584
602 config("chromium_code") { 585 config("chromium_code") {
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
1053 cflags += [ "-gsplit-dwarf" ] 1036 cflags += [ "-gsplit-dwarf" ]
1054 } 1037 }
1055 } 1038 }
1056 } 1039 }
1057 1040
1058 config("no_symbols") { 1041 config("no_symbols") {
1059 if (!is_win) { 1042 if (!is_win) {
1060 cflags = [ "-g0" ] 1043 cflags = [ "-g0" ]
1061 } 1044 }
1062 } 1045 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698