code: def _get_host_libc_from_host_compiler(self):
      
      compiler_exe = self.get_options().host_compiler
  
      # Implicitly, we are passing in the environment of the executing pants process to
      # `get_compiler_library_dirs()`.
      # These directories are checked to exist!
      library_dirs = self._parse_search_dirs.get_compiler_library_dirs(compiler_exe)
  
      libc_crti_object_file = None
      for libc_dir_candidate in library_dirs:
        maybe_libc_crti = os.path.join(libc_dir_candidate, self._LIBC_INIT_OBJECT_FILE)
        if os.path.isfile(maybe_libc_crti):
          libc_crti_object_file = maybe_libc_crti
          break
  
      if not libc_crti_object_file:
        raise self.HostLibcDevResolutionError(
          "Could not locate {fname} in library search dirs {dirs} from compiler: {compiler!r}. "
          "You may need to install a libc dev package for the current system. "
          "For many operating systems, this package is named 'libc-dev' or 'libc6-dev'."
          .format(fname=self._LIBC_INIT_OBJECT_FILE, dirs=library_dirs, compiler=compiler_exe))
  
      return HostLibcDev(crti_object=libc_crti_object_file,
                         fingerprint=hash_file(libc_crti_object_file))
docs: Locate the host's libc-dev installation using a specified host compiler's search dirs.