Wednesday, May 5, 2010

V8 Build Error

Hi,
I downloaded v8 and followed the build instruction given at http://code.google.com/apis/v8/build.html#build .

However, When I executed the command "scons" (without quotes) it shown following errors on my machine.


cc1plus: error: dereferencing pointer 'dest' does break strict-aliasing rules
cc1plus: error: dereferencing pointer 'dest' does break strict-aliasing rules
cc1plus: error: dereferencing pointer 'dest' does break strict-aliasing rules
src/api.cc:3495: note: initialized from here
scons: *** [obj/release/api.o] Error 1
scons: building terminated because of errors.

This is bcoz warnings are considered as errors by the compiler.
To solve this problem,
open "SConstruct" file in the source directory of v8 and look for "V8_EXTRA_FLAGS"
Then comment the line (use # to comment line) '-Werror' in
gcc:{ 
    all:{ 
       WARNINGFLAGS: [
                                    
                                      ]
  },

After doing this, I was able to build it. However, I was not able to embed v8 in C++ application.
The reason was, I was running ubuntu x64 bit OS and V8 build is of 32-bit.

I ran following command to build 64-bit libaray of V8.
$ scons mode=debug arch=x64

Where mode=debug to build DEBUG version instead of by default release version. And arch=x64 to build 64-bit version instead of by-default 32-bit version.



No comments:

Post a Comment