das-labor / panopticon

A libre cross-platform disassembler.
https://panopticon.re
GNU General Public License v3.0
1.43k stars 80 forks source link

Provide a statically linked linux binary #229

Open ghost opened 7 years ago

ghost commented 7 years ago

It would be nice if one wouldn't have to bother to compile the thing for various linuxes.

m4b commented 7 years ago

@opennota There should be compiled binaries here: https://panopticon.re/get/

ghost commented 7 years ago

@m4b They are not statically linked. That is the point. You need Qt5.4 installed and what not.

m4b commented 7 years ago

Providing a statically linked binary would only be possible if:

  1. Every qt dependency also provided static archives when building/to link against, which they probably don't
  2. The UI frontend was changed to something which only provides static libraries

I actually don't know of a UI framework on Linux for 2., eg you can create a completely statically linked binary without dynamic calls to a UI lib (I suspect game developers would go nuts for this), although this is very far from my expertise.

@opennota do you know of anything, resources where to look?

ghost commented 7 years ago

An executable statically linked to Qt (and linked to some shared libraries other than Qt) is already a big step forward.

Qt itself can be built statically: http://doc.qt.io/qt-5/linux-deployment.html#static-linking

m4b commented 7 years ago

So it's ultimately up to @flanfly, but statically linking the qt deps would be nice (I was a little put off having to install stuff, primarily cause I'm lazy, and the dependency list wasn't as robust as it is now so I had some initial troubles), as it would cut down on a pain point in getting it setup.

Note it will increase the binary size, just poking around, I'd estimate by at least 15MB. Very likely much more.

So in order to do this, someone will have to file a PR to the upstream QT rust bindings and add a build.rs file which either

  1. Clones qt and builds from source with the static build enabled as instructed in your link, and then builds the rust bindings with the static lib (hence producing a static qt rust binding)

  2. Or check if the necessary .a QT files are installed on system (I don't think they are by default), and use them when building rust bindings

  3. is definitely possible, check https://github.com/m4b/capstone-rs for an example of how to do this in a build.rs file

That could in principle take care of QT, which as I said could be cool for distribution (although we'd add this as a build feature in panopticon because I'd prefer panopticon build time to not increase :laughing:)

Again that's all up to @flanfly

As for a completely statically linked executable, I suggest running ldd qtpanopticon to see what you're up against :D

flanfly commented 7 years ago

Hey @opennota, I understand that you don't want to install Qt just for trying out Panopticon The problem is that setting up (and debugging) a build job to compile everything statically for a bunch of GNU/Linux distros is quite a lot of work. I frankly don't want to invest time into that, now that we have DEB and RPM packages.

In case anybody is willing to send a PR, I'll merge it.

est31 commented 7 years ago

You can try doing cross distro builds using flatpak and the KDE/Qt runtime.