Page MenuHomePhabricator

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

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

Details

Summary

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.

rdar://problem/47194182

Diff Detail

Repository
rC Clang

Event Timeline

steven_wu created this revision.Fri, Jan 11, 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.Fri, Jan 11, 10:57 AM
include/clang/Driver/Driver.h
508

Old function name in the comment.

Fix the comment

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