When using llvm-libtool-darwin as a drop in replacement for cctools libtool, Xcode expects you to create a dependency info file. This file is a very simple format describing the input files, the output files, and the version of the tool. This logic is mirrored from that of ld64.lld, which supports creating this file as well. Ideally we could extract it, but I don't think we want to throw this into one of the grab-bag libraries given how small the logic is. Differential Revision: https://reviews.llvm.org/D134322
27 lines
622 B
Python
Executable File
27 lines
622 B
Python
Executable File
#
|
|
# Dump the dependency file (produced with -dependency_info) to text
|
|
# format for testing purposes.
|
|
#
|
|
|
|
import sys
|
|
|
|
f = open(sys.argv[1], "rb")
|
|
byte = f.read(1)
|
|
while byte != b'':
|
|
if byte == b'\x00':
|
|
sys.stdout.write("version: ")
|
|
elif byte == b'\x10':
|
|
sys.stdout.write("input-file: ")
|
|
elif byte == b'\x11':
|
|
sys.stdout.write("not-found: ")
|
|
elif byte == b'\x40':
|
|
sys.stdout.write("output-file: ")
|
|
byte = f.read(1)
|
|
while byte != b'\x00':
|
|
sys.stdout.write(byte.decode("ascii"))
|
|
byte = f.read(1)
|
|
sys.stdout.write("\n")
|
|
byte = f.read(1)
|
|
|
|
f.close()
|