• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2014 The Chromium Authors
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5import("//build/config/android/config.gni")
6import("//build/config/sysroot.gni")
7
8assert(is_android)
9
10shared_library("chromium_android_linker") {
11  sources = [
12    "linker_jni.cc",
13    "linker_jni.h",
14    "linker_jni_onload.cc",
15    "linker_minimal_libcxx.cc",
16  ]
17
18  deps = [ "//build:buildflag_header_h" ]
19
20  # Export JNI symbols.
21  configs -= [ "//build/config/android:hide_all_but_jni_onload" ]
22  configs += [ "//build/config/android:hide_all_but_jni" ]
23
24  # Disable coverage to avoid linker issue.
25  configs -= [ "//build/config/coverage:default_coverage" ]
26
27  # ThinLTO optimizations save a few bytes of binary size.
28  configs -= [ "//build/config/compiler:thinlto_optimize_default" ]
29  configs += [ "//build/config/compiler:thinlto_optimize_max" ]
30
31  # Disable orderfile instrumentation. Code in this target is in a different
32  # .so, cannot call unexported instrumentation functions from another one (link
33  # time error).
34  configs -= [ "//build/config/android:default_orderfile_instrumentation" ]
35
36  # Avoid linking libc++ and support libraries, to avoid 100 kiB of
37  # un-necessary code.
38  no_default_deps = true
39
40  # The linker is used on Android platforms that do not support GNU-style
41  # hash tables, so ensure one isn't included in it to save space (since the SysV
42  # format is always supported). It would be nice to also remove the GNU version
43  # tables, for the same reason, but a linker flag to disable them doesn't seem
44  # to exist. This saves 52 bytes on ARM.
45  ldflags = [
46    "-Wl,--hash-style=sysv",
47    "-llog",
48  ]
49}
50