This is an archive of the discontinued LLVM Phabricator instance.

[lldb] [test] Pass appropriate -L&-Wl,-rpath for libc++ on NetBSD
ClosedPublic

Authored by mgorny on Feb 25 2019, 9:11 AM.

Details

Summary

Pass appropriate -L and -Wl,-rpath flags pointing out to the LLVM
library directory on NetBSD. This is necessary since clang on NetBSD
requires libc++ but it is not installed as part of the system
by default. For the purpose of running buildbot, we want LLDB to use
just-built libc++.

Diff Detail

Repository
rL LLVM

Event Timeline

mgorny created this revision.Feb 25 2019, 9:11 AM

Unfortunately I don't know of a substantially better way to solve. I have one small improvement inline. Also, I take it this means running tests without a libc++ checkout is not supported on NetBSD. Maybe you should add netbsd to the cmake code where we print the darwin warning if you build without libc++ checked out.

lldb/lit/Suite/lit.cfg
35–36 ↗(On Diff #188195)

Instead of passing this via the environment, you should arrange so that --env LLVM_LIBS_DIR=dir gets passed to dotest.py. This will stop people from pounding the head against the wall on why do the tests behave differently when run from lit vs. directly from command line.

Unfortunately I don't know of a substantially better way to solve. I have one small improvement inline. Also, I take it this means running tests without a libc++ checkout is not supported on NetBSD. Maybe you should add netbsd to the cmake code where we print the darwin warning if you build without libc++ checked out.

Actually, it can use either libc++ checkout or installed libc++. it just happens that the latter is uncommon.

mgorny updated this revision to Diff 188946.Mar 1 2019, 10:58 AM
mgorny retitled this revision from [lldb] [test] Pass appropriate -L for just-built libc++ to [lldb] [test] Pass appropriate -L&-Wl,-rpath for just-built libc++.
mgorny edited the summary of this revision. (Show Details)

Turns out LD_LIBRARY_PATH does not solve all the issues on NetBSD. I've went ahead with the simplest solution possible, and added -Wl,-rpath (only on NetBSD) along with -L flags.

mgorny updated this revision to Diff 189364.Mar 5 2019, 10:51 AM
mgorny retitled this revision from [lldb] [test] Pass appropriate -L&-Wl,-rpath for just-built libc++ to [lldb] [test] Pass appropriate -L&-Wl,-rpath for libc++ on NetBSD.
mgorny edited the summary of this revision. (Show Details)

Updated to make it all conditional to NetBSD, as discussed.

labath accepted this revision.Mar 6 2019, 3:19 AM
This revision is now accepted and ready to land.Mar 6 2019, 3:19 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMar 6 2019, 6:03 AM