code: def cross_compiler(
      compile_func,
      options=None,
      output_format=None,
      get_target_triple=None,
      add_files=None,
  ):
      """Create a cross compiler function by specializing compile_func with options.
  
      This function can be used to construct compile functions that
      can be passed to AutoTVM measure or export_library.
  
  
      Parameters
      ----------
      compile_func : Union[str, Callable[[str, str, Optional[str]], None]]
          Function that performs the actual compilation
  
      options : Optional[List[str]]
          List of additional optional string.
  
      output_format : Optional[str]
          Library output format.
  
      get_target_triple: Optional[Callable]
          Function that can target triple according to dumpmachine option of compiler.
  
      add_files: Optional[List[str]]
          List of paths to additional object, source, library files
          to pass as part of the compilation.
  
      Returns
      -------
      fcompile : Callable[[str, str, Optional[str]], None]
          A compilation function that can be passed to export_library.
  
      Examples
      --------
      .. code-block:: python
  
         from tvm.contrib import cc, ndk
         # export using arm gcc
         mod = build_runtime_module()
         mod.export_library(path_dso,
                            fcompile=cc.cross_compiler("arm-linux-gnueabihf-gcc"))
         # specialize ndk compilation options.
         specialized_ndk = cc.cross_compiler(
             ndk.create_shared,
             ["--sysroot=/path/to/sysroot", "-shared", "-fPIC", "-lm"])
         mod.export_library(path_dso, fcompile=specialized_ndk)
      """
      base_options = [] if options is None else options
      kwargs = {}
      add_files = [] if add_files is None else add_files
  
      # handle case where compile_func is the name of the cc
      if isinstance(compile_func, str):
          kwargs = {"cc": compile_func}
          compile_func = create_shared
  
      def _fcompile(outputs, objects, options=None):
          all_options = base_options
          if options is not None:
              all_options += options
          compile_func(
              outputs,
              objects + add_files,
              options=all_options,
              **kwargs,
          )
  
      if not output_format and hasattr(compile_func, "output_format"):
          output_format = compile_func.output_format
      output_format = output_format if output_format else "so"
  
      if not get_target_triple and hasattr(
          compile_func, "get_target_triple"
      ):
          get_target_triple = compile_func.get_target_triple
  
      _fcompile.output_format = output_format
      _fcompile.get_target_triple = get_target_triple
      return _fcompile
  
file_path: tvm/python/tvm/contrib/cc.py
imports: import sys
  import shutil
  import os
  import subprocess
  from .None import utils, tar
  from .._ffi.base import py_str
label_desc: Use image node_id 9 for calling a global function with example usage: cross_compiler(compile_func, options, output_format, get_target_triple, add_files) and returns: _fcompile