rizinorg / rizin

UNIX-like reverse engineering framework and command-line toolset.
https://rizin.re
GNU Lesser General Public License v3.0
2.7k stars 361 forks source link

Enable building/installing/loading plugins with static releases #3982

Open rickhg12hs opened 11 months ago

rickhg12hs commented 11 months ago

Is your feature request related to a problem? Please describe.

There is only a static release for Linux and it would be great to use some of the available plugins (e.g., jsdec, rz-ghidra) with the release. Unfortunately, rz-pm cannot properly build the plugins without significant environment variable twiddling (e.g., PATH= ... PKG_CONFIG_PATH= ... LDPATH= ...). And then, even after a successful plugin build, rizin refuses to load it.

$ bin/rizin 
ERROR: rz_sys_dlopen: error: ~/.local/lib/rizin/plugins/libcore_pdd.so (Dynamic loading not supported)

Describe the solution you'd like

I'd like rz-pm to included with the static bundle and have it build/install the plugins easily for the user ... and then have rizin be able to load/use them.

Describe alternatives you've considered

Build everything from source, but that's not as convenient as installing a release and plugins should be, especially for test-drivers and new users.

Additional context

The static release could be installed anywhere in the file system, but some paths in lib/pkconfig/*.pc are hard-wired to not-the-place rizin will be installed. prefix= should be the actual directory where rizin is installed. Also, in a couple .pc files there is a reference to /usr/lib/libutil.a but it is rendered as /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../lib/libutil.a. In general, there will be no /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1, so /usr/lib/libutil.a will not be found. This creates issues for rz-pm/cmake/meson when it looks for include/library files. Perhaps there should be a post-install step to fix the .pc files, or rz-pm needs to be smarter so it can determine the correct paths.

New users are generally excited about one or more of the plugins and easily installing rizin from the releases and the plugins would make first steps more successful and enjoyable. This would also be an easy procedure to run the latest releases when distros lag behind.

ret2libc commented 11 months ago

https://github.com/rizinorg/rizin/issues/1755 this is the same issue, I think.

rickhg12hs commented 11 months ago

1755 this is the same issue, I think.

Partially.

This feature request is really more about UX and mentions some backing issues.

.pc issues are the same, but not being able to load plugins wasn't mentioned in #1755 . If all the hoops are jumped through to build a plugin, static rizin won't load it.