| # Copyright 2014 The Chromium Authors |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//build/config/android/config.gni") |
| import("//build/config/sysroot.gni") |
| |
| assert(is_android) |
| |
| shared_library("chromium_android_linker") { |
| sources = [ |
| "linker_jni.cc", |
| "linker_jni.h", |
| "linker_jni_onload.cc", |
| "linker_minimal_libcxx.cc", |
| ] |
| |
| deps = [ "//build:buildflag_header_h" ] |
| |
| # Export JNI symbols. |
| configs -= [ "//build/config/android:hide_all_but_jni_onload" ] |
| configs += [ "//build/config/android:hide_all_but_jni" ] |
| |
| # Disable coverage to avoid linker issue. |
| configs -= [ "//build/config/coverage:default_coverage" ] |
| |
| # ThinLTO optimizations save a few bytes of binary size. |
| configs -= [ "//build/config/compiler:thinlto_optimize_default" ] |
| configs += [ "//build/config/compiler:thinlto_optimize_max" ] |
| |
| # Disable orderfile instrumentation. Code in this target is in a different |
| # .so, cannot call unexported instrumentation functions from another one (link |
| # time error). |
| configs -= [ "//build/config/android:default_orderfile_instrumentation" ] |
| |
| # Avoid linking libc++ and support libraries, to avoid 100 kiB of |
| # un-necessary code. |
| no_default_deps = true |
| |
| # The linker is used on Android platforms that do not support GNU-style |
| # hash tables, so ensure one isn't included in it to save space (since the SysV |
| # format is always supported). It would be nice to also remove the GNU version |
| # tables, for the same reason, but a linker flag to disable them doesn't seem |
| # to exist. This saves 52 bytes on ARM. |
| ldflags = [ |
| "-Wl,--hash-style=sysv", |
| "-llog", |
| ] |
| } |