angr / vex

A patched version of VEX to work with PyVEX.
GNU General Public License v2.0
104 stars 44 forks source link

Build breakage on non-x86 due to -malign-double #14

Closed afaerber closed 6 years ago

afaerber commented 6 years ago

pyvex builds on ppc64(le), aarch64 and possibly others break because -malign-double is not a valid flag on all architectures.

https://github.com/angr/vex/blob/b08ff6739a29b0ca3a8218ec7516513dca978ce9/Makefile-gcc#L43-L47

Introduced in b773fc63421f409f60552c632a0cdff0cc737926, not in upstream Valgrind.

rhelmot commented 6 years ago

I have some extremely bad news if you’re trying to get angr to run on non intel platforms. This is absolutely not the last problem you’ll run into. LibVEX was theoretically written to be architecture independent, but this is a complete lie and we have had to twist its arms in horrifying, disgusting ways in order to even be able to lift for arches on x86_64, and then even harder on i386. I once got it working on 32 bit armel, but I can’t remember if I merged all the necessary hacks. Forget a big endian platform, that’ll be >1000 lines of edits in vex probably.

For this reason, I can’t help you if you want to go down this path. Plus I don’t have access to the machines to test this...

Submit a pull request if you would like this fixed. Maybe I’m wrong about how hard it is :)

afaerber commented 6 years ago

For now I've limited the architectures we build pyvex for to 32-bit and 64-bit Intel: https://build.opensuse.org/package/view_file/devel:languages:python/python-pyvex/python-pyvex.spec?expand=1

For comparison here's the list of architectures we build valgrind for, which includes three Big Endian targets: https://build.opensuse.org/package/view_file/devel:tools/valgrind/valgrind.spec?expand=1

rhelmot commented 6 years ago

Right - I don’t think I was clear enough: libvex works fine when the host and guest architectures are the same, but when you’re doing cross-architecture stuff, that is, everything you ever do with angr, everything falls apart.

On Sat, Mar 31, 2018 at 5:34 PM Andreas Färber notifications@github.com wrote:

For now I've limited the architectures we build pyvex for to 32-bit and 64-bit Intel:

https://build.opensuse.org/package/view_file/devel:languages:python/python-pyvex/python-pyvex.spec?expand=1

For comparison here's the list of architectures we build valgrind for, which includes three Big Endian targets:

https://build.opensuse.org/package/view_file/devel:tools/valgrind/valgrind.spec?expand=1

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/angr/vex/issues/14#issuecomment-377733618, or mute the thread https://github.com/notifications/unsubscribe-auth/ACYg9SsVrxQnau5wukAg7uymTP7EM78_ks5tkCCigaJpZM4TCMO2 .

rhelmot commented 6 years ago

I finally figured out how to do this! No guarantees that anything will work correctly, but it should at least build now :)