angr/vex

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

Closed this issue · 4 comments

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

vex/Makefile-gcc

Lines 43 to 47 in b08ff67

# gcc requires -malign-double to compile consistently
# old versions of clang error when given this flag
ifneq ($(shell $(CC) 2>&1 | grep -o clang),clang)
CFLAGS += -malign-double
endif

Introduced in b773fc6, not in upstream Valgrind.

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 :)

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

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