[COFF] Fix manifest resource file creation on Windows.
authorRui Ueyama <ruiu@google.com>
Tue, 15 Nov 2016 21:25:20 +0000 (21:25 +0000)
committerRui Ueyama <ruiu@google.com>
Tue, 15 Nov 2016 21:25:20 +0000 (21:25 +0000)
commitc3dcf99441322c37eb3a7a013b92554622beb7a6
tree905c3d9177c97334c31a1ce652f8e9d22f81b826
parent2a51748a5d0116bd8b54e0e99091574200cf6f11
[COFF] Fix manifest resource file creation on Windows.

createManifestRes was generating a MemoryBuffer from a TemporaryFile,
keeping the data but removing the file, before passing the file path
to CVTRES.exe, leading to the following error:

  CVTRES : fatal error CVT1101: cannot open 'C:\Users\user\AppData\
  Local\Temp\lld-output-resource-bfee19.res' for reading

With this, we instead create a new TemporaryFile before passing it to cvtres.

Patch from Rudy Pons!

llvm-svn: 287034
lld/COFF/DriverUtils.cpp