Page MenuHomePhabricator

[Driver] Search compiler-rt paths in -print-file-name=

Authored by phosek on Jul 24 2017, 4:03 PM.



This makes it possible to print the name of compiler-rt libraries
by using simply clang -print-file-name=libclang_rt.${runtime}-${arch}.so
same as other libraries, without having to know the details of the
resource directory organization.

Diff Detail


Event Timeline

phosek created this revision.Jul 24 2017, 4:03 PM
mcgrathr accepted this revision.Jul 24 2017, 4:08 PM

LGTM. Perhaps there should be a test.

This revision is now accepted and ready to land.Jul 24 2017, 4:08 PM
phosek updated this revision to Diff 109485.Aug 2 2017, 10:18 PM
This revision was automatically updated to reflect the committed changes.
ldionne added inline comments.

By introducing a second way of getting the path to compiler-rt, this created inconsistencies where some platforms that implement getCompilerRT(...) now won't return the right value for getCompilerRTPath().

Is this the intent: getCompilerRT() == append(getCompilerRTPath(), basename(getCompilerRT(...))? If so, I think it would make sense to refactor this a bit so that we have:

getCompilerRTDir(); // What's currently called getCompilerRTPath(). This would be overriden by toolchains.
getCompilerRTBasename(args...); // Exists currently, but we would override this in the toolchains instead of having a default implementation.
getCompilerRT(args...); // This would basically do append(getCompilerRTDir(), getCompilerRTBasename(args...))


Herald added a project: Restricted Project. · View Herald TranscriptWed, Mar 15, 6:53 AM