GN (android): Append ".cr" to component .so's to avoid zygote lib collisions
With this, ChromePublic now launches with is_component_build = true BUG=500882 Review URL: https://codereview.chromium.org/1236543004 Cr-Original-Commit-Position: refs/heads/master@{#338612} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: a2daf08ffddf4549160f3925383b457a2eb03c7f
This commit is contained in:
Родитель
cb0663129c
Коммит
4186705ae6
|
@ -162,7 +162,7 @@ if (is_android) {
|
|||
android_gdbserver =
|
||||
"$android_ndk_root/prebuilt/$android_prebuilt_arch/gdbserver/gdbserver"
|
||||
|
||||
# libc++ stuff ---------------------------------------------------------------
|
||||
# Toolchain stuff ------------------------------------------------------------
|
||||
|
||||
android_libcpp_root = "$android_ndk_root/sources/cxx-stl/llvm-libc++"
|
||||
if (component_mode == "shared_library") {
|
||||
|
@ -171,6 +171,10 @@ if (is_android) {
|
|||
android_libcpp_library = "c++_static"
|
||||
}
|
||||
|
||||
# By appending .cr, we prevent name collisions with libraries already
|
||||
# loaded by the Android zygote.
|
||||
android_product_extension = ".cr.so"
|
||||
|
||||
# ABI ------------------------------------------------------------------------
|
||||
|
||||
if (current_cpu == "x86") {
|
||||
|
|
|
@ -1432,20 +1432,22 @@ template("android_apk") {
|
|||
"Relocation packing requires use of the" + " Chromium linker.")
|
||||
}
|
||||
|
||||
_native_libs = []
|
||||
if (is_component_build) {
|
||||
_native_libs += [ "$root_out_dir/lib.stripped/libc++_shared.so" ]
|
||||
_chromium_linker_dep += [ "//build/android:cpplib_stripped" ]
|
||||
}
|
||||
|
||||
# Allow native_libs to be in the form "foo.so" or "foo.cr.so"
|
||||
_first_ext_removed =
|
||||
process_file_template(invoker.native_libs, "{{source_name_part}}")
|
||||
_native_libs += process_file_template(
|
||||
invoker.native_libs,
|
||||
"$root_build_dir/lib.stripped/{{source_file_part}}")
|
||||
_first_ext_removed,
|
||||
"$root_build_dir/lib.stripped/{{source_name_part}}$android_product_extension")
|
||||
|
||||
_native_libs_dir = base_path + "/libs"
|
||||
|
||||
if (_use_chromium_linker) {
|
||||
_native_libs +=
|
||||
[ "$root_build_dir/lib.stripped/libchromium_android_linker.so" ]
|
||||
_native_libs += [ "$root_build_dir/lib.stripped/libchromium_android_linker$android_product_extension" ]
|
||||
}
|
||||
|
||||
_enable_relocation_packing = false
|
||||
|
@ -1656,7 +1658,7 @@ template("android_apk") {
|
|||
|
||||
skip_packing_list = [
|
||||
"gdbserver",
|
||||
"libchromium_android_linker.so",
|
||||
"libchromium_android_linker$android_product_extension",
|
||||
]
|
||||
|
||||
enable_packing_arg = 0
|
||||
|
@ -1940,7 +1942,7 @@ template("unittest_apk") {
|
|||
if (defined(invoker.unittests_binary)) {
|
||||
unittests_binary = invoker.unittests_binary
|
||||
} else {
|
||||
unittests_binary = "lib" + test_suite_name + ".so"
|
||||
unittests_binary = "lib${test_suite_name}${android_product_extension}"
|
||||
}
|
||||
|
||||
if (defined(invoker.apk_name)) {
|
||||
|
|
|
@ -69,6 +69,7 @@ template("android_gcc_toolchain") {
|
|||
replace_command = "if ! cmp -s $temp_stripped_soname $stripped_soname; then mv $temp_stripped_soname $stripped_soname; fi"
|
||||
postsolink = "$strip_command && $replace_command"
|
||||
solink_outputs = [ stripped_soname ]
|
||||
default_output_extension = android_product_extension
|
||||
|
||||
# We make the assumption that the gcc_toolchain will produce an exe with
|
||||
# the following definition.
|
||||
|
|
|
@ -160,6 +160,9 @@ template("gcc_toolchain") {
|
|||
# overrides it (in which case {{output_extension}} will be what the target
|
||||
# specifies).
|
||||
default_output_extension = ".so"
|
||||
if (defined(invoker.default_output_extension)) {
|
||||
default_output_extension = invoker.default_output_extension
|
||||
}
|
||||
|
||||
output_prefix = "lib"
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче