V8 build on Linux using GYP

179 views
Skip to first unread message

Neha

unread,
Jan 9, 2013, 6:29:34 AM1/9/13
to v8-u...@googlegroups.com
Hi,
 
I tried building v8_master using gyp on linux.
make used is 3.81, gcc 4.1.2. python is Python-2.7.3.
 
I get compilation error when i run make native :
 
---------------------------------------------------------------------------------------------------------------------
GYP_GENERATORS=make \
        build/gyp/gyp --generator-output="out" build/all.gyp \
                      -Ibuild/standalone.gypi --depth=. -S.native  -Dv8_enable_backtrace=1 -Dv8_can_use_vfp2_instructions=true -Darm_fpu=vfpv2 -Dv8_can_use_vfp3_instructions=true -Darm_fpu=vfpv3
make[1]: Entering directory `/home/nmishr12/RulesEngine/V8/v8-master/out'
  CXX(target) /home/nmishr12/RulesEngine/V8/v8-master/out/native/obj.target/preparser_lib/src/allocation.o
  CXX(target) /home/nmishr12/RulesEngine/V8/v8-master/out/native/obj.target/preparser_lib/src/atomicops_internals_x86_gcc.o
  CXX(target) /home/nmishr12/RulesEngine/V8/v8-master/out/native/obj.target/preparser_lib/src/bignum.o
  CXX(target) /home/nmishr12/RulesEngine/V8/v8-master/out/native/obj.target/preparser_lib/src/bignum-dtoa.o
  CXX(target) /home/nmishr12/RulesEngine/V8/v8-master/out/native/obj.target/preparser_lib/src/cached-powers.o
  CXX(target) /home/nmishr12/RulesEngine/V8/v8-master/out/native/obj.target/preparser_lib/src/conversions.o
  CXX(target) /home/nmishr12/RulesEngine/V8/v8-master/out/native/obj.target/preparser_lib/src/diy-fp.o
  CXX(target) /home/nmishr12/RulesEngine/V8/v8-master/out/native/obj.target/preparser_lib/src/dtoa.o
  CXX(target) /home/nmishr12/RulesEngine/V8/v8-master/out/native/obj.target/preparser_lib/src/fast-dtoa.o
  CXX(target) /home/nmishr12/RulesEngine/V8/v8-master/out/native/obj.target/preparser_lib/src/fixed-dtoa.o
  CXX(target) /home/nmishr12/RulesEngine/V8/v8-master/out/native/obj.target/preparser_lib/src/once.o
  CXX(target) /home/nmishr12/RulesEngine/V8/v8-master/out/native/obj.target/preparser_lib/src/preparse-data.o
  CXX(target) /home/nmishr12/RulesEngine/V8/v8-master/out/native/obj.target/preparser_lib/src/preparser.o
  CXX(target) /home/nmishr12/RulesEngine/V8/v8-master/out/native/obj.target/preparser_lib/src/preparser-api.o
  CXX(target) /home/nmishr12/RulesEngine/V8/v8-master/out/native/obj.target/preparser_lib/src/scanner.o
  CXX(target) /home/nmishr12/RulesEngine/V8/v8-master/out/native/obj.target/preparser_lib/src/strtod.o
  CXX(target) /home/nmishr12/RulesEngine/V8/v8-master/out/native/obj.target/preparser_lib/src/token.o
  CXX(target) /home/nmishr12/RulesEngine/V8/v8-master/out/native/obj.target/preparser_lib/src/unicode.o
  CXX(target) /home/nmishr12/RulesEngine/V8/v8-master/out/native/obj.target/preparser_lib/src/utils.o
  AR(target) /home/nmishr12/RulesEngine/V8/v8-master/out/native/obj.target/tools/gyp/libpreparser_lib.a
  CXX(target) /home/nmishr12/RulesEngine/V8/v8-master/out/native/obj.target/preparser/preparser/preparser-process.o
  LINK(target) /home/nmishr12/RulesEngine/V8/v8-master/out/native/preparser
  CXX(target) /home/nmishr12/RulesEngine/V8/v8-master/out/native/obj.target/v8_base/src/accessors.o
cc1plus: warnings being treated as errors
../src/heap.h: In member function âv8::internal::byte** v8::internal::Heap::store_buffer_top_address()â:
../src/heap.h:1264: warning: dereferencing type-punned pointer will break strict-aliasing rules
make[1]: *** [/home/nmishr12/RulesEngine/V8/v8-master/out/native/obj.target/v8_base/src/accessors.o] Error 1
make[1]: Leaving directory `/home/nmishr12/RulesEngine/V8/v8-master/out'
make: *** [native] Error 2
-------------------------------------------------------------------------------------------------------------------------------
 
Any help on this?
 
 

Rodolph Perfetta

unread,
Jan 9, 2013, 6:52:28 AM1/9/13
to v8-u...@googlegroups.com
Add strictaliasing=off to your build command.

Alternatively use a newer gcc. 4.1.2 is old and the code generated by it on ARM is not very good.



Neha

unread,
Jan 9, 2013, 11:44:11 PM1/9/13
to v8-u...@googlegroups.com
 
Thanks for the prompt reply.
 
I tried strictaliasing=off option along with make native. This worked. The code got compiled with this option.
What are the implications of using this option when i want to further use V8 with my application?

Rodolph Perfetta

unread,
Jan 10, 2013, 6:36:10 AM1/10/13
to v8-u...@googlegroups.com
This option disable the strict aliasing rule for gcc. See gcc docs for more info (the flag passed to gcc is -fno-strict-aliasing).

Stephan Beal

unread,
Jan 10, 2013, 7:09:40 AM1/10/13
to v8-u...@googlegroups.com
On Thu, Jan 10, 2013 at 5:44 AM, Neha <nehatrip...@gmail.com> wrote:
I tried strictaliasing=off option along with make native. This worked. The code got compiled with this option.
What are the implications of using this option when i want to further use V8 with my application?

If you mean as a "normal client", just using the v8 public API, this option doesn't affect the client code or how the client code needs to be compiled, it only affects how gcc compiles v8.

--
----- stephan beal
http://wanderinghorse.net/home/stephan/

Neha

unread,
Jan 11, 2013, 1:49:04 AM1/11/13
to v8-u...@googlegroups.com, sgb...@googlemail.com
ok, Thanks Rodolph and Stephan!

Neha

unread,
Jan 11, 2013, 4:34:31 AM1/11/13
to v8-u...@googlegroups.com, sgb...@googlemail.com
 
Solution for compiling v8 on Linux:
 
gcc version used : 4.1.2. Also tried with gcc 4.2.3.
 
The code did not compile with the existing version of python(2.4)
 
Download python 2.7.3. Configure and Build the same.
use python 2.7.3 and make 3.81 by setting path on linux.
 
GYP should be at the root level of v8. (Same level as the build folder)
 
build v8 with command-> make native strictaliasing=off

Jakob Kummerow

unread,
Jan 11, 2013, 10:02:28 AM1/11/13
to v8-u...@googlegroups.com, sgb...@googlemail.com
On Fri, Jan 11, 2013 at 10:34 AM, Neha <nehatrip...@gmail.com> wrote:
 
Solution for compiling v8 on Linux:
 
gcc version used : 4.1.2. Also tried with gcc 4.2.3.
 
The code did not compile with the existing version of python(2.4)
 
Download python 2.7.3. Configure and Build the same.
use python 2.7.3 and make 3.81 by setting path on linux.

Python 2.6.x is fine too.
 
GYP should be at the root level of v8. (Same level as the build folder)

What? GYP should be checked out into <v8>/build/gyp, which is where "make dependencies" puts it.

build v8 with command-> make native strictaliasing=off
 

On Friday, January 11, 2013 12:19:04 PM UTC+5:30, Neha wrote:
ok, Thanks Rodolph and Stephan!

On Thursday, January 10, 2013 5:39:40 PM UTC+5:30, Stephan Beal wrote:
On Thu, Jan 10, 2013 at 5:44 AM, Neha <nehatrip...@gmail.com> wrote:
I tried strictaliasing=off option along with make native. This worked. The code got compiled with this option.
What are the implications of using this option when i want to further use V8 with my application?

If you mean as a "normal client", just using the v8 public API, this option doesn't affect the client code or how the client code needs to be compiled, it only affects how gcc compiles v8.

--
----- stephan beal
http://wanderinghorse.net/home/stephan/

--

Neha

unread,
Jan 14, 2013, 3:48:06 AM1/14/13
to v8-u...@googlegroups.com, sgb...@googlemail.com
 
You are right..
GYP inside the build folder.(build/gyp).
Thanks!
Reply all
Reply to author
Forward
0 new messages