Index: build/config/compiler/BUILD.gn |
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn |
index 95e09d93c3f1fae4ce2cfef7905828c07a9833b1..ad947050cc52f88c4b1ea2e465d326ba03d22364 100644 |
--- a/build/config/compiler/BUILD.gn |
+++ b/build/config/compiler/BUILD.gn |
@@ -462,10 +462,10 @@ config("compiler") { |
ldflags += [ |
"-Wl,--no-undefined", |
- # Don't allow visible symbols from libgcc or stlport to be |
+ # Don't allow visible symbols from libgcc or libc++ to be |
# re-exported. |
"-Wl,--exclude-libs=libgcc.a", |
- "-Wl,--exclude-libs=libstlport_static.a", |
+ "-Wl,--exclude-libs=libc++_static.a", |
# Don't allow visible symbols from libraries that contain |
# assembly code with symbols that aren't hidden properly. |
@@ -547,7 +547,7 @@ config("runtime_library") { |
] |
} |
- # Stlport setup. Android uses a different (smaller) version of the STL. |
+ # Android standard library setup. |
if (is_android) { |
if (is_clang) { |
# Work around incompatibilities between bionic and clang headers. |
@@ -557,11 +557,7 @@ config("runtime_library") { |
] |
} |
- defines += [ |
- "USE_STLPORT=1", |
- "_STLP_USE_PTR_SPECIALIZATIONS=1", |
- "__GNU_SOURCE=1", # Necessary for clone(). |
- ] |
+ defines += [ "__GNU_SOURCE=1" ] # Necessary for clone(). |
# TODO(jdduke) Re-enable on mips after resolving linking |
# issues with libc++ (crbug.com/456380). |
@@ -570,45 +566,48 @@ config("runtime_library") { |
} |
ldflags += [ "-nostdlib" ] |
- # NOTE: The stlport header include paths below are specified in cflags |
+ # NOTE: The libc++ header include paths below are specified in cflags |
# rather than include_dirs because they need to come after include_dirs. |
# Think of them like system headers, but don't use '-isystem' because the |
# arm-linux-androideabi-4.4.3 toolchain (circa Gingerbread) will exhibit |
# strange errors. The include ordering here is important; change with |
# caution. |
- android_stlport_root = "$android_ndk_root/sources/cxx-stl/stlport" |
+ android_libcpp_root = "$android_ndk_root/sources/cxx-stl/llvm-libc++" |
- cflags += [ "-isystem" + |
- rebase_path("$android_stlport_root/stlport", root_build_dir) ] |
- lib_dirs += [ "$android_stlport_root/libs/$android_app_abi" ] |
+ cflags += [ |
+ "-isystem" + |
+ rebase_path("$android_libcpp_root/libcxx/include", root_build_dir), |
+ "-isystem" + rebase_path( |
+ "$android_ndk_root/sources/cxx-stl/llvm-libc++abi/libcxxabi/include", |
+ root_build_dir), |
+ "-isystem" + |
+ rebase_path("$android_ndk_root/sources/android/support/include", |
+ root_build_dir), |
+ ] |
- if (component_mode == "shared_library") { |
- libs += [ "stlport_shared" ] |
- } else { |
- libs += [ "stlport_static" ] |
- } |
+ lib_dirs += [ "$android_libcpp_root/libs/$android_app_abi" ] |
- if (current_cpu == "mipsel") { |
- libs += [ |
- # ld linker is used for mips Android, and ld does not accept library |
- # absolute path prefixed by "-l"; Since libgcc does not exist in mips |
- # sysroot the proper library will be linked. |
- # TODO(gordanac): Remove once gold linker is used for mips Android. |
- "gcc", |
- ] |
+ if (component_mode == "shared_library") { |
+ android_libcpp_library = "c++_shared" |
} else { |
- libs += [ |
- # Manually link the libgcc.a that the cross compiler uses. This is |
- # absolute because the linker will look inside the sysroot if it's not. |
- rebase_path(android_libgcc_file), |
- ] |
+ android_libcpp_library = "c++_static" |
} |
libs += [ |
+ "$android_libcpp_library", |
+ |
+ # Manually link the libgcc.a that the cross compiler uses. This is |
+ # absolute because the linker will look inside the sysroot if it's not. |
+ rebase_path(android_libgcc_file), |
"c", |
"dl", |
"m", |
] |
+ |
+ # Clang with libc++ does not require an explicit atomic library reference. |
+ if (!is_clang) { |
+ libs += [ "atomic" ] |
+ } |
} |
} |