-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is the readline implementation correct? #75
Comments
I have reread the documentation and seen https://github.com/lincheney/rl_custom_function . Homewever, there is another concern. The application works by hijacking
The call to |
Hello It works for me ... but that is probably not a helpful response :| I suspect this issue may be related: lincheney/rl_custom_function#5 It works well for the official readline packages from the 2 linux distros I use (fedora + arch), (Also, if you have suggestions on better ways to implement this, please let me know!) |
I am using libreadline 8.2 disstributed from the package manager on Ubuntu 22.10. I've tried to elicit a function call to use the PLT in a function call that does not cross shared library boundary using various linker options, but couldn't figure it out. This is different from various statements I've read online, such as this answer: "With -fPIC instead of -fPIE, things are even worse: even calls to global functions defined within the same compilation unit have to go through the PLT, to support symbol interposition." This is not true in my experience. It was not an issue of default linker arguments (things like I also tried to look at readline packages on fedora package index. For an old one, I can see there was such a function call:
However, for a newer one, that call was no longer there. I don't think you can count on this I would guess that for performance reasons, PLT calls are being phased out by linkers when possible. This means that you can only hijack calls between shared objects. In the case of readline, the only one you can be sure of is the call to
However, I don't know the readline internals. |
Hi I'm using Fedora 37 right now with the latest available readline.
Yeah this is probably true. |
It looks there is an alternate interface which readline module uses. |
I threw together a horrible hack (in an ancient language, because I'm a dinosaur): https://gist.github.com/srd424/e8649dae5cd6c3b17ac0d7de0ffcb2ff Compared to @lincheney's implementation it rather demonstrates why I shouldn't be allowed near a compiler, but it does seem to work for the moment :) |
This does not work on Ubuntu, though. Seems to be related to the way readline has been compiled. See: lincheney/fzf-tab-completion#75 lincheney/rl_custom_function#5 There is a hack mentioned for Ubuntu, which I could try.
This does not work on Ubuntu, though. Seems to be related to the way readline has been compiled. See: lincheney/fzf-tab-completion#75 lincheney/rl_custom_function#5 There is a hack mentioned for Ubuntu, which I could try: https://gist.github.com/srd424/e8649dae5cd6c3b17ac0d7de0ffcb2ff
Did anyone get this working on ubuntu? Sorry it was not clear to me how the "hack" mentioned in the previous comment could be enabled :) |
Hello, thank you for your efforts in the direction of fzf+readline integration. However, I have to wonder if the current suggested integration strategy actually works. It suggests the
.inputrc
configI had no idea that
libreadline
can dynamically load functions from any shared object. However, looking at the documentation, I don't see any mention of that config syntax. For them$include
is just something like#include
. Additionally,libreadline
doesn't require use symboldlopen
on my system, nor does any commit in the upstream repository contain "$include function".So are you using a custom fork of
libreadline
to make this work? I am not able to get it to work. I think I'll statically link your project together with my own libreadline.Edit: Indeed, tracing
sqlite3
with the example config I find it tries to open the file whose name isfunction rl_custom_complete /home/psacawa/lib/librl_custom_complete.so
. Where did you getlibreadline.so
that works this way?Edit: Fixed, see below
The text was updated successfully, but these errors were encountered: