This is an archive of the discontinued LLVM Phabricator instance.

[lldb] [lit] Fix finding lld-link when it is not in 'compiler dir'
ClosedPublic

Authored by mgorny on Feb 9 2019, 6:33 AM.

Details

Summary

Fix the build helper to find lld-link via PATH lookup, rather than
making a fragile assumption that it will be present in the 'compiler
directory'. This fixes tests on Gentoo where clang and lld
are installed in different directories.

Diff Detail

Repository
rL LLVM

Event Timeline

mgorny created this revision.Feb 9 2019, 6:33 AM
labath added inline comments.Feb 11 2019, 2:01 AM
lldb/lit/helper/build.py
293–298 ↗(On Diff #186113)

How about we replace all of this with a call like linker_path = find_executable(name, [compiler_dir] + search_paths) ?

299–300 ↗(On Diff #186113)

find_executable returns None on failure, so this needs to be adjusted.

mgorny marked 2 inline comments as done.Feb 11 2019, 2:26 AM
mgorny updated this revision to Diff 186205.Feb 11 2019, 2:38 AM

Updated to use find_executable() unconditionally.

labath accepted this revision.Feb 11 2019, 5:42 AM

lgtm

lldb/lit/helper/build.py
296 ↗(On Diff #186205)

linker_path isn't going to be terribly useful here when it's none. Probably just replace it with name.

This revision is now accepted and ready to land.Feb 11 2019, 5:42 AM
mgorny marked 2 inline comments as done.Feb 11 2019, 6:08 AM
mgorny added inline comments.
lldb/lit/helper/build.py
296 ↗(On Diff #186205)

Indeed, thanks for catching this.

This revision was automatically updated to reflect the committed changes.
mgorny marked an inline comment as done.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 11 2019, 6:09 AM