angr/pyvex

Something, possibly a new version of make, is breaking "deeply evil" space manipulation in pyvex_c/Makefile

Closed this issue · 6 comments

Something, possibly a new version of make, is breaking "deeply evil" space manipulation in pyvex_c/Makefile. I provide here a sequence of two builds. The first uses make 4.2.1 and succeeds. The second uses make 4.3 and fails. Both are running within a Fedora Rawhide (33) mock environment.

Note that in the second sequence make seems to produce the string ".../libvex.a?" rather than ".../libvex.a".

bash-5.0# make --version
GNU Make 4.2.1
Built for x86_64-redhat-linux-gnu
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
bash-5.0# python3 setup.py build
running build
Building libVEX
make: Nothing to be done for 'all'.
Building libpyvex
gcc -c -g -O2 -Wall -shared -fPIC -std=c99 -I "/builddir/build/BUILD/pyvex-8.20.1.7/vex/pub" pyvex.c
gcc -c -g -O2 -Wall -shared -fPIC -std=c99 -I "/builddir/build/BUILD/pyvex-8.20.1.7/vex/pub" logging.c
gcc -c -g -O2 -Wall -shared -fPIC -std=c99 -I "/builddir/build/BUILD/pyvex-8.20.1.7/vex/pub" analysis.c
gcc -c -g -O2 -Wall -shared -fPIC -std=c99 -I "/builddir/build/BUILD/pyvex-8.20.1.7/vex/pub" postprocess.c
gcc -g -O2 -Wall -shared -fPIC -std=c99 -I "/builddir/build/BUILD/pyvex-8.20.1.7/vex/pub" -o libpyvex.so pyvex.o logging.o analysis.o postprocess.o "/builddir/build/BUILD/pyvex-8.20.1.7/vex/libvex.a" -Wl,-soname,libpyvex.so
ar rcs libpyvex.a pyvex.o logging.o analysis.o postprocess.o
Copying libraries and headers
Creating CFFI defs file
running build_py
copying pyvex/vex_ffi.py -> build/lib/pyvex
running egg_info
writing pyvex.egg-info/PKG-INFO
writing dependency_links to pyvex.egg-info/dependency_links.txt
writing requirements to pyvex.egg-info/requires.txt
writing top-level names to pyvex.egg-info/top_level.txt
reading manifest file 'pyvex.egg-info/SOURCES.txt'
writing manifest file 'pyvex.egg-info/SOURCES.txt'
copying pyvex/lib/libpyvex.a -> build/lib/pyvex/lib
copying pyvex/lib/libpyvex.so -> build/lib/pyvex/lib
copying pyvex/include/libvex_guest_arm.h -> build/lib/pyvex/include
copying pyvex/include/libvex_ir.h -> build/lib/pyvex/include
copying pyvex/include/libvex_guest_tilegx.h -> build/lib/pyvex/include
copying pyvex/include/libvex_guest_ppc64.h -> build/lib/pyvex/include
copying pyvex/include/libvex_guest_arm64.h -> build/lib/pyvex/include
copying pyvex/include/pyvex.h -> build/lib/pyvex/include
copying pyvex/include/libvex_guest_mips32.h -> build/lib/pyvex/include
copying pyvex/include/libvex_emnote.h -> build/lib/pyvex/include
copying pyvex/include/libvex_guest_ppc32.h -> build/lib/pyvex/include
copying pyvex/include/libvex_guest_x86.h -> build/lib/pyvex/include
copying pyvex/include/libvex_s390x_common.h -> build/lib/pyvex/include
copying pyvex/include/libvex_basictypes.h -> build/lib/pyvex/include
copying pyvex/include/libvex_guest_mips64.h -> build/lib/pyvex/include
copying pyvex/include/libvex.h -> build/lib/pyvex/include
copying pyvex/include/libvex_trc_values.h -> build/lib/pyvex/include
copying pyvex/include/libvex_guest_amd64.h -> build/lib/pyvex/include
copying pyvex/include/libvex_guest_offsets.h -> build/lib/pyvex/include
copying pyvex/include/libvex_guest_s390x.h -> build/lib/pyvex/include
bash-5.0# ( cd pyvex_c/ && make clean )
rm -f libpyvex.so libpyvex.a *.o

bash-5.0# make --version
GNU Make 4.3
Built for x86_64-redhat-linux-gnu
Copyright (C) 1988-2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
bash-5.0# python3 setup.py build
running build
Building libVEX
make: Nothing to be done for 'all'.
Building libpyvex
gcc -c -g -O2 -Wall -shared -fPIC -std=c99 -I "/builddir/build/BUILD/pyvex-8.20.1.7/vex/pub" pyvex.c
gcc -c -g -O2 -Wall -shared -fPIC -std=c99 -I "/builddir/build/BUILD/pyvex-8.20.1.7/vex/pub" logging.c
gcc -c -g -O2 -Wall -shared -fPIC -std=c99 -I "/builddir/build/BUILD/pyvex-8.20.1.7/vex/pub" analysis.c
gcc -c -g -O2 -Wall -shared -fPIC -std=c99 -I "/builddir/build/BUILD/pyvex-8.20.1.7/vex/pub" postprocess.c
make: *** No rule to make target '/builddir/build/BUILD/pyvex-8.20.1.7/vex/libvex.a?', needed by 'libpyvex.so'. Stop.
make: *** Waiting for unfinished jobs....
gmake: *** No rule to make target '/builddir/build/BUILD/pyvex-8.20.1.7/vex/libvex.a?', needed by 'libpyvex.so'. Stop.
error: Unable to build libpyvex.

This is indeed caused by a new version of Make. I think Bader posted a similar issue here as well as a fix.

Does this PR fix your issue? #209

@balbassam Does this issue look familiar to you? It would be great if you can help out here :)

This is the exact same issue I had in the past. I'm running Make 4.3 as well on my system and the latest pyvex's no longer has that issue.

Although, I still have my linker issue on vex itself that I posted on slack and failed to make an issue about.

@ltfish, it does indeed seem that #209 fixes my problem.

We just released a new version of PyVEX (as well as angr) to PyPI about 12 hours ago. You should consider using the latest version instead (which already has this fix).