Beispiel #1
0
def CheckInputsArch(inputs):
  count = 0
  for f in inputs:
    if ldtools.IsFlag(f):
      continue
    elif filetype.IsLLVMBitcode(f) or filetype.IsBitcodeArchive(f):
      pass
    elif filetype.IsNative(f):
      ArchMerge(f, True)
    else:
      Log.Fatal("%s: Unexpected type of file for linking (%s)",
                pathtools.touser(f), filetype.FileType(f))
    count += 1

  if count == 0:
    Log.Fatal("no input files")
Beispiel #2
0
def FindFile(search_names, search_dirs, acceptable_types):
  for curdir in search_dirs:
    for name in search_names:
      path = pathtools.join(curdir, name)
      if pathtools.exists(path):
        if acceptable_types == LibraryTypes.ANY:
          return path
        # Linker scripts aren't classified as Native or Bitcode.
        if filetype.IsLinkerScript(path):
          return path
        if (acceptable_types == LibraryTypes.NATIVE and
            filetype.IsNative(path)):
          return path
        if (acceptable_types == LibraryTypes.BITCODE and
            (filetype.IsLLVMBitcode(path) or
             filetype.IsBitcodeArchive(path))):
          return path
  return None