diff options
Diffstat (limited to 'deps/v8/build/config/android')
-rw-r--r-- | deps/v8/build/config/android/BUILD.gn | 39 | ||||
-rw-r--r-- | deps/v8/build/config/android/rules.gni | 14 |
2 files changed, 50 insertions, 3 deletions
diff --git a/deps/v8/build/config/android/BUILD.gn b/deps/v8/build/config/android/BUILD.gn index b69d42b700..51a990fa34 100644 --- a/deps/v8/build/config/android/BUILD.gn +++ b/deps/v8/build/config/android/BUILD.gn @@ -40,6 +40,7 @@ config("compiler") { # Don't allow visible symbols from libgcc or libc++ to be # re-exported. "-Wl,--exclude-libs=libgcc.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. @@ -105,9 +106,30 @@ config("runtime_library") { # arm-linux-androideabi-4.4.3 toolchain (circa Gingerbread) will exhibit # strange errors. The include ordering here is important; change with # caution. - cflags_cc = [ "-isystem" + - rebase_path("$android_ndk_root/sources/android/support/include", - root_build_dir) ] + cflags_cc = [] + if (!use_custom_libcxx) { + if (android_ndk_major_version >= 13) { + libcxx_include_path = + rebase_path("$android_libcpp_root/include", root_build_dir) + libcxxabi_include_path = rebase_path( + "$android_ndk_root/sources/cxx-stl/llvm-libc++abi/include", + root_build_dir) + } else { + libcxx_include_path = + rebase_path("$android_libcpp_root/libcxx/include", root_build_dir) + libcxxabi_include_path = rebase_path( + "$android_ndk_root/sources/cxx-stl/llvm-libc++abi/libcxxabi/include", + root_build_dir) + } + cflags_cc += [ + "-nostdinc++", + "-isystem" + libcxx_include_path, + "-isystem" + libcxxabi_include_path, + ] + } + cflags_cc += [ "-isystem" + rebase_path( + "$android_ndk_root/sources/android/support/include", + root_build_dir) ] defines = [ "__GNU_SOURCE=1", # Necessary for clone(). @@ -117,6 +139,17 @@ config("runtime_library") { lib_dirs = [ android_libcpp_lib_dir ] libs = [] + if (!use_custom_libcxx) { + # The libc++ runtime library (must come first). + # ASan needs to dynamically link to libc++ even in static builds so + # that it can interpose operator new. + if (is_component_build || is_asan) { + libs += [ "c++_shared" ] + } else { + libs += [ "c++_static" ] + } + libs += [ "c++abi" ] + } libs += [ "android_support" ] # arm builds of libc++ starting in NDK r12 depend on unwind. diff --git a/deps/v8/build/config/android/rules.gni b/deps/v8/build/config/android/rules.gni index 4846ade15c..0337663b4b 100644 --- a/deps/v8/build/config/android/rules.gni +++ b/deps/v8/build/config/android/rules.gni @@ -70,6 +70,9 @@ template("create_native_executable_dist") { if (defined(invoker.deps)) { data_deps += invoker.deps } + if (is_component_build || is_asan) { + data_deps += [ "//build/android:cpplib_stripped" ] + } write_runtime_deps = _runtime_deps_file } @@ -2191,6 +2194,17 @@ if (enable_java_templates) { defined(invoker.secondary_abi_shared_libraries) && invoker.secondary_abi_shared_libraries != [] + if (is_component_build || is_asan) { + if (_shared_libraries_is_valid) { + _native_libs_deps += [ "//build/android:cpplib_stripped" ] + } + if (_secondary_abi_shared_libraries_is_valid) { + _secondary_abi_native_libs_deps += [ + "//build/android:cpplib_stripped($android_secondary_abi_toolchain)", + ] + } + } + if (_shared_libraries_is_valid) { _native_libs_deps += invoker.shared_libraries |