Vine-1.0&bitblaze-additional-2010-06.tar.gz on Ubuntu13.04 ./configure --with-vex=./VEX Err: /usr/bin/ld: cannot find -lvex

103 views
Skip to first unread message

Zhang Mike

unread,
May 7, 2013, 10:51:45 PM5/7/13
to bitblaz...@googlegroups.com
I don't know why, when I ./configure the vine-1.0 with bitblaze-additional-2010-06's content, it told me it needs the --with-vex, so I gave it
./configure --with-vex=./VEX (if I ./configure the vine-1.0 only, it doesn't need the --with-vex, and can make sucessfully.)
then it gave me the following error.

Is this meaning we need download the r1856 version VEX and install it, anyway? Though there's some necessary VEX files in the vine-1.0/VEX folder.
But it seems that version VEX cannot be downloaded from svn, I tried hours. If we really need that specific r1856 VEX, then is there any other way to get the package?

******************************************************************************************************************
g++ -I../src/include  -I./VEX/pub -g -O2 -L../src -L./VEX  -o disassembler disassembler.o -lasmir -lvex -lbfd -liberty -lopcodes -liberty -lbfd 
/usr/bin/ld: cannot find -lvex
collect2: error: ld returned 1 exit status
make[3]: *** [disassembler] Error 1

********************************************************************************************************************

Zhang Mike

unread,
May 8, 2013, 1:14:53 AM5/8/13
to bitblaz...@googlegroups.com
  make version
  make libvex.a

And I ask a friend to help me downloaded the r1856 VEX, then replaced the existed VEX folder content.
and use the above commands toled in the vine-1.0/INSTALL file to compile the VEX content.
but it always give me the same error as the first post described.

Stephen McCamant

unread,
May 9, 2013, 6:47:18 PM5/9/13
to bitblaz...@googlegroups.com
>>>>> "ZM" == Zhang Mike <telne...@gmail.com> writes:

ZM> I don't know why, when I ./configure the vine-1.0 with
ZM> bitblaze-additional-2010-06's content, it told me it needs the --with-vex,
ZM> so I gave it
ZM> ./configure --with-vex=./VEX (if I ./configure the vine-1.0 only, it
ZM> doesn't need the --with-vex, and can make sucessfully.)
ZM> then it gave me the following error.

I haven't yet tried reproducing this failure, so let me start by
giving some general comments.

The Vine portion of the additional source-code release doesn't share
the same relation to the 1.0 release as the TEMU portion does: it is
more self contained. So I would first try compiling it on its own,
before mixing it with the Vine 1.0 release. If you are going to mix
them, you might be better off moving individual source files rather
than overlaying the build systems wholesale. However I don't have a
theory as to how that might be causing your problem.

The copy of "VEX" shipped with Vine 1.0 is almost the same as the SVN
revision r1856. Here's how it's described in the VINE.README file we
added:

This is VEX version 1856 (per priv/main/vex_svnversion.h) with
orig_amd64/, orig_arm/, orig_ppc32/, orig_x86/, test/, and
nanoarm.orig removed. -fPIC compiler option is also added to the
Makefile.

And here's the full diff:

diff -ur -x .svn r1856/Makefile vine-1.0/VEX/Makefile
--- r1856/Makefile 2013-05-09 17:19:30.869935000 -0500
+++ vine-1.0/VEX/Makefile 2013-03-27 18:48:05.570783000 -0500
@@ -56,6 +56,11 @@
priv/guest-arm/toIR.o \
priv/guest-ppc/toIR.o

+EXTRA_DIST= HACKING.README \
+ LICENSE.GPL \
+ LICENSE.README \
+ VINE.README
+
PUB_INCLUDES = -Ipub

# Do not add any priv/host-ARCH or priv/guest-ARCH directories to this
@@ -76,7 +81,7 @@
CCFLAGS = -Wall -Wmissing-prototypes -Wshadow \
-Wpointer-arith -Wbad-function-cast -Wcast-qual \
-Wcast-align -Wmissing-declarations \
- $(EXTRA_CFLAGS) -g -O2 -fstrict-aliasing
+ $(EXTRA_CFLAGS) -g -O2 -fstrict-aliasing -fPIC

#CC = icc
#CCFLAGS = -g -Wall -wd981 -wd279 -wd1287 -wd869 -wd111 -wd188 -wd186
@@ -165,6 +170,14 @@
cat quote.txt >> priv/main/vex_svnversion.h
cat newline.txt >> priv/main/vex_svnversion.h

+distdir: pub/libvex_guest_offsets.h
+ cp --parents -t $(distdir) $(PUB_HEADERS) $(PRIV_HEADERS) \
+ $(EXTRA_DIST) \
+ priv/main/vex_svnversion.h \
+ test_main.c test_main.h \
+ Makefile \
+ `echo $(LIB_OBJS) | sed "s/\.o/\.c/g"`
+
minidist: version
rm -f vex--minidist-2005MMDD.tar
tar cf vex--minidist-2005MMDD.tar $(PUB_HEADERS) $(PRIV_HEADERS) \
@@ -298,3 +311,6 @@
priv/guest-ppc/toIR.o: $(ALL_HEADERS) priv/guest-ppc/toIR.c
$(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/guest-ppc/toIR.o \
-c priv/guest-ppc/toIR.c
+
+doc:
+ @# No documentation, so nothing to do
Only in r1856: nanoarm.orig
Only in r1856: orig_amd64
Only in r1856: orig_arm
Only in r1856: orig_ppc32
Only in r1856: orig_x86
Only in vine-1.0/VEX/priv/main: vex_svnversion.h
Only in r1856: test
Only in vine-1.0/VEX: VINE.README

ZM> Is this meaning we need download the r1856 version VEX and install
ZM> it, anyway? Though there's some necessary VEX files in the
ZM> vine-1.0/VEX folder. But it seems that version VEX cannot be
ZM> downloaded from svn, I tried hours. If we really need that
ZM> specific r1856 VEX, then is there any other way to get the
ZM> package?

Could you say more about the problems you were having with the VEX
SVN? I tried it just now with the command:

% svn checkout -r 1856 svn://svn.valgrind.org/vex/trunk r1856

and it worked fine for me.

However, as mentioned above, the Vine-1.0 and r1856 versions of VEX
really are almost identical, so you should be able to use either one.

ZM> **********************************************************************
ZM> g++ -I../src/include -I./VEX/pub -g -O2 -L../src -L./VEX -o disassembler
ZM> disassembler.o -lasmir -lvex -lbfd -liberty -lopcodes -liberty -lbfd
ZM> */usr/bin/ld: cannot find -lvex*
ZM> collect2: error: ld returned 1 exit status
ZM> make[3]: *** [disassembler] Error 1
ZM> **********************************************************************

This error message sounds like you did not manage to compile your
version of VEX correctly. With the options -L./VEX and -lvex, the
linker should be looking for a file named ./VEX/libvex.a, which is
supposed to be the result of compiling VEX. Does that file exist in
your copy? Specifically the VEX Makefile target "make libvex.a", as
the name suggests, is supposed to create that file. You mentioned in
another email that you had run that command: did you see any errors
from that?

-- Stephen

Zhang Mike

unread,
May 9, 2013, 9:12:17 PM5/9/13
to bitblaz...@googlegroups.com, mcca...@cs.umn.edu
Thanks for your comments.
1.The Vine-1.0 can be compiled sucessfully seprately.
2.But, even I compile the vine2010 seprately, it gave me the same error as this thread's first post described.
   And the ./configure also need the --with-vex to point out the VEX folder.
   I compile the downloaded VEX r1856 as you described in the vine/INSTALL file: make version, then make libvex.a,
   and there's no error, I confirmed that.

This problem also can be reprodued in the Ubuntu 10.04.
*************************************************************************
ubuntu@ubuntu13:~/Downloads/bitblaze/vine2010/VEX$ make version
rm -f priv/main/vex_svnversion.h
cat quote.txt   >> priv/main/vex_svnversion.h
svnversion -n . >> priv/main/vex_svnversion.h
cat quote.txt   >> priv/main/vex_svnversion.h
cat newline.txt >> priv/main/vex_svnversion.h
ubuntu@ubuntu13:~/Downloads/bitblaze/vine2010/VEX$ make libvex.a
cc -Wall -Wmissing-prototypes -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wmissing-declarations  -g -O2 -fstrict-aliasing -Ipub -Ipriv -o priv/main/vex_main.o \
-c priv/main/vex_main.c
rm -f libvex.a
ar clq libvex.a priv/ir/irdefs.o priv/ir/irmatch.o priv/ir/iropt.o priv/main/vex_main.o priv/main/vex_globals.o priv/main/vex_util.o priv/host-x86/hdefs.o priv/host-amd64/hdefs.o priv/host-arm/hdefs.o priv/host-ppc/hdefs.o priv/host-x86/isel.o priv/host-amd64/isel.o priv/host-arm/isel.o priv/host-ppc/isel.o priv/host-generic/h_generic_regs.o priv/host-generic/h_generic_simd64.o priv/host-generic/reg_alloc2.o priv/guest-generic/g_generic_x87.o priv/guest-generic/bb_to_IR.o priv/guest-x86/ghelpers.o priv/guest-amd64/ghelpers.o priv/guest-arm/ghelpers.o priv/guest-ppc/ghelpers.o priv/guest-x86/toIR.o priv/guest-amd64/toIR.o priv/guest-arm/toIR.o priv/guest-ppc/toIR.o
ubuntu@ubuntu13:~/Downloads/bitblaze/vine2010/VEX$ 

*************************************************************************
*************************************************************************

Stephen McCamant

unread,
May 10, 2013, 4:10:23 PM5/10/13
to bitblaz...@googlegroups.com
>>>>> "ZM" == Zhang Mike <telne...@gmail.com> writes:

ZM> I don't know why, when I ./configure the vine-1.0 with
ZM> bitblaze-additional-2010-06's content, it told me it needs the --with-vex,
ZM> so I gave it
ZM> ./configure --with-vex=./VEX (if I ./configure the vine-1.0 only, it
ZM> doesn't need the --with-vex, and can make sucessfully.)
ZM> then it gave me the following error.

ZM> ********************************************************************
ZM> g++ -I../src/include -I./VEX/pub -g -O2 -L../src -L./VEX -o disassembler
ZM> disassembler.o -lasmir -lvex -lbfd -liberty -lopcodes -liberty -lbfd
ZM> */usr/bin/ld: cannot find -lvex*
ZM> collect2: error: ld returned 1 exit status
ZM> make[3]: *** [disassembler] Error 1

ZM> ********************************************************************

Ah, I think I've figured it out. The problem is that you need to
provide an absolute path as the argument to --with-vex. For instance
in the example above you can say "$(pwd)/VEX" instead of "./VEX". The
path you give as an argument to --with-vex is passed as a -L option to
the linker. If you give a relative path, when linking happens in a
subdirectory (e.g., the above linking command happens in
vine/libasmir/apps), the path will be interpreted relative to that
subdirectory, which is different from the location you originally
specified.

Hope this helps,

-- Stephen

Zhang Mike

unread,
May 12, 2013, 10:08:34 PM5/12/13
to bitblaz...@googlegroups.com, mcca...@cs.umn.edu
Thanks, Stephen!
With your helps, I finshed compiling the vine and temu with addition-2010!
Thank you very much! 
Reply all
Reply to author
Forward
0 new messages