Page MenuHomePhabricator

[Darwin][Driver] Don't pass a file as object_path_lto during ThinLTO

Authored by steven_wu on Jan 11 2019, 9:33 AM.



After r327851, Driver::GetTemporaryPath will create the file rather than
just create a potientially unqine filename. If clang driver pass the
file as parameter as -object_path_lto, ld64 will pass it back to libLTO
as GeneratedObjectsDirectory, which is going to cause a LLVM ERROR if it
is not a directory.
Now during thinLTO, pass a temp directory path to linker instread.


Diff Detail

rC Clang

Event Timeline

steven_wu created this revision.Jan 11 2019, 9:33 AM

The code looks good. Can you add a test too? Might need to require “shell”.

I was planning to add a test but I am not sure how to check the file type of temporary files.

I add a test to check for temp file names because I do create file and directory with different prefix.

arphaman added inline comments.Jan 11 2019, 10:57 AM

Old function name in the comment.

Fix the comment

This revision is now accepted and ready to land.Jan 11 2019, 11:29 AM
This revision was automatically updated to reflect the committed changes.