This is an archive of the discontinued LLVM Phabricator instance.

[LLVM] Support histedit.h and libedit.a in non-standard locations
AbandonedPublic

Authored by RVP on Feb 23 2022, 9:07 AM.

Details

Reviewers
None
Summary

When histedit.h and libedit.a are in non-standard locations which is not
uncommon, cmake does not automatically configure LLVM to build the line
editor. But completion and history provided by LineEditor are very useful in
clang-query.

To use this -DLLVM_ENABLE_LIBEDIT=ON must be specified along with the location
of libedit.a and histedit.h in -DCMAKE_LIBRARY_PATH=... and
-DCMAKE_INCLUDE_PATH=... respectively. Alternatively, the full path to these
files can specified using -DLIBEDIT_LIBRARY=... and -DHISTEDIT_FILE=...
respectively

There are some instances such as when using ASan, building with libedit is
skipped. That will continue to be the case.

Diff Detail

Event Timeline

RVP created this revision.Feb 23 2022, 9:07 AM
RVP requested review of this revision.Feb 23 2022, 9:07 AM
RVP updated this revision to Diff 410849.Feb 23 2022, 9:14 AM
RVP edited the summary of this revision. (Show Details)Feb 23 2022, 9:41 AM
RVP edited the summary of this revision. (Show Details)
RVP edited the summary of this revision. (Show Details)
RVP edited the summary of this revision. (Show Details)
RVP edited the summary of this revision. (Show Details)Feb 23 2022, 10:39 AM
RVP added a comment.Feb 23 2022, 10:44 AM

This seems to cause a build failure.

ld.lld: error: undefined symbol: strvis
>>> referenced by hist.o:(hist_command) in archive /usr/lib/x86_64-linux-gnu/libedit.a
>>> referenced by history.o:(history_save_fp) in archive /usr/lib/x86_64-linux-gnu/libedit.a
>>> referenced by historyn.o:(history_save_fp) in archive /usr/lib/x86_64-linux-gnu/libedit.a
 
ld.lld: error: undefined symbol: strlcpy
>>> referenced by terminal.o:(terminal_settc) in archive /usr/lib/x86_64-linux-gnu/libedit.a
>>> referenced by terminal.o:(terminal_settc) in archive /usr/lib/x86_64-linux-gnu/libedit.a
>>> referenced by tty.o:(tty_stty) in archive /usr/lib/x86_64-linux-gnu/libedit.a
>>> did you mean: strncpy
>>> defined in: /lib/x86_64-linux-gnu/libc.so.6

Closing this for now as it seems this may need further work.

RVP planned changes to this revision.Feb 23 2022, 11:27 AM
RVP removed a reviewer: pcc.
RVP abandoned this revision.Feb 23 2022, 11:30 AM

Abandoning it. Will submit a new patch later.