summaryrefslogtreecommitdiffstats
path: root/chromium/build/config/android/linker_version_script.gni
blob: a764df37c5d277f731d1034db5879c862d369ebe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/config/python.gni")

# Generate a custom linker version script that can later be used with
# "-Wl,--version-script=<path>" ldflags.
#
# Variables:
#    export_java_symbols: Optional. If true, also export all Java_* symbols
#      exported for JNI.
#    export_symbol_whitelist_files: Optional. List of paths to input files containing
#      lists of symbols to export.
#    linker_script: Path to output linker version script.
#
template("generate_linker_version_script") {
  action_with_pydeps(target_name) {
    script = "//build/android/gyp/generate_linker_version_script.py"
    outputs = [
      invoker.linker_script,
    ]
    inputs = []
    args = [ "--output=" + rebase_path(invoker.linker_script, root_build_dir) ]

    if (defined(invoker.export_java_symbols) && invoker.export_java_symbols) {
      args += [ "--export-java-symbols" ]
    }

    if (defined(invoker.export_symbol_whitelist_files)) {
      foreach(file_, invoker.export_symbol_whitelist_files) {
        inputs += [ file_ ]
        args += [
          "--export-symbol-whitelist-file",
          rebase_path(file_, root_build_dir),
        ]
      }
    }
  }
}