code: def link(
      self,
      target_desc,
      objects,
      output_filename,
      output_dir=None,
      libraries=None,
      library_dirs=None,
      runtime_library_dirs=None,
      export_symbols=None,
      debug=0,
      extra_preargs=None,
      extra_postargs=None,
      build_temp=None,
      target_lang=None,
  ):
      objects, output_dir = self._fix_object_args(objects, output_dir)
      fixed_args = self._fix_lib_args(
          libraries, library_dirs, runtime_library_dirs
      )
      libraries, library_dirs, runtime_library_dirs = fixed_args
  
      lib_opts = gen_lib_options(
          self, library_dirs, runtime_library_dirs, libraries
      )
      if not isinstance(output_dir, (str, type(None))):
          raise TypeError("'output_dir' must be a string or None")
      if output_dir is not None:
          output_filename = os.path.join(output_dir, output_filename)
  
      if self._need_link(objects, output_filename):
          ld_args = (
              objects
              + self.objects
              + lib_opts
              + ["-o", output_filename]
          )
          if debug:
              ld_args[:0] = ["-g"]
          if extra_preargs:
              ld_args[:0] = extra_preargs
          if extra_postargs:
              ld_args.extend(extra_postargs)
          self.mkpath(os.path.dirname(output_filename))
          try:
              if target_desc == CCompiler.EXECUTABLE:
                  linker = self.linker_exe[:]
              else:
                  linker = self.linker_so[:]
              if target_lang == "c++" and self.compiler_cxx:
                  # skip over environment variable settings if /usr/bin/env
                  # is used to set up the linker's environment.
                  # This is needed on OSX. Note: this assumes that the
                  # normal and C++ compiler have the same environment
                  # settings.
                  i = 0
                  if os.path.basename(linker[0]) == "env":
                      i = 1
                      while "=" in linker[i]:
                          i += 1
  
                  if os.path.basename(linker[i]) == "ld_so_aix":
                      # AIX platforms prefix the compiler with the ld_so_aix
                      # script, so we need to adjust our linker index
                      offset = 1
                  else:
                      offset = 0
  
                  linker[i + offset] = self.compiler_cxx[i]
  
              if sys.platform == "darwin":
                  linker = _osx_support.compiler_fixup(linker, ld_args)
  
              self.spawn(linker + ld_args)
          except DistutilsExecError as msg:
              raise LinkError(msg)
      else:
          log.debug("skipping %s (up-to-date)", output_filename)
  
file_path: catboost/contrib/tools/python3/src/Lib/distutils/unixccompiler.py
imports: import os, sys, re
  from distutils import sysconfig
  from distutils.dep_util import newer
  from distutils.ccompiler import CCompiler, gen_preprocess_options, gen_lib_options
  from distutils.errors import DistutilsExecError, CompileError, LibError, LinkError
  from distutils import log
label_desc: Use image node_id 4 for calling the UnixCCompiler obj's underlying member method code with example usage: obj.link(target_desc, objects, output_filename, output_dir, libraries, library_dirs, runtime_library_dirs, export_symbols, debug, extra_preargs, extra_postargs, build_temp, target_lang) without return types