Page MenuHomePhabricator

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

Authored by mgorny on Sat, Feb 9, 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.Sat, Feb 9, 6:33 AM
labath added inline comments.Mon, Feb 11, 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.Mon, Feb 11, 2:26 AM
mgorny updated this revision to Diff 186205.Mon, Feb 11, 2:38 AM

Updated to use find_executable() unconditionally.

labath accepted this revision.Mon, Feb 11, 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.Mon, Feb 11, 5:42 AM
mgorny marked 2 inline comments as done.Mon, Feb 11, 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 TranscriptMon, Feb 11, 6:09 AM