How to build V8 on Raspberry Pi (3 model B) ?

505 views
Skip to first unread message

aleReimondo

unread,
Jun 1, 2017, 11:56:13 AM6/1/17
to v8-users
Hi,
I have made most steps detailed in V8 wiki to download prerequisites and V8 sources.
Up to "gclient sync" all look ok, but the page at


is not clear to me what should I run now to v8gen and then gn
 to build V8.

Trying to make and/or gyp way had not succeded here.

The shell executable is what I need to build on the Raspberry.

any help/reccomendation will be appreciated,
Ale.

Ben Noordhuis

unread,
Jun 1, 2017, 12:18:12 PM6/1/17
to v8-users
I think you want `tools/dev/v8gen.py arm.release && ninja -C
out.gn/arm.release d8`?

aleReimondo

unread,
Jun 1, 2017, 12:36:40 PM6/1/17
to v8-users
Thank you for your fast response!

I tried tools/dev/v8gen.py arm.release
 but got error

-------------------------------------------------------------------------------
pi@raspberrypi:~/v8 $ tools/dev/v8gen.py arm.release -vv
################################################################################
/usr/bin/python -u tools/mb/mb.py gen -f infra/mb/mb_config.pyl -m developer_default -b arm.release out.gn/arm.release
  
  Writing """\
  is_debug = false
  target_cpu = "x86"
  v8_target_cpu = "arm"
  """ to /home/pi/v8/out.gn/arm.release/args.gn.
  
  /home/pi/v8/buildtools/linux64/gn gen out.gn/arm.release --check
  Traceback (most recent call last):
    File "tools/mb/mb.py", line 60, in Main
      ret = self.args.func()
    File "tools/mb/mb.py", line 257, in CmdGen
      return self.RunGNGen(vals)
    File "tools/mb/mb.py", line 786, in RunGNGen
      ret, _, _ = self.Run(cmd, env=env)
    File "tools/mb/mb.py", line 1380, in Run
      ret, out, err = self.Call(cmd, env=env, buffer_output=buffer_output)
    File "tools/mb/mb.py", line 1394, in Call
      env=env)
    File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
      errread, errwrite)
    File "/usr/lib/python2.7/subprocess.py", line 1335, in _execute_child
      raise child_exception
  OSError: [Errno 8] Exec format error
Traceback (most recent call last):
  File "tools/dev/v8gen.py", line 304, in <module>
    sys.exit(gen.main())
  File "tools/dev/v8gen.py", line 298, in main
    return self._options.func()
  File "tools/dev/v8gen.py", line 166, in cmd_gen
    gn_outdir,
  File "tools/dev/v8gen.py", line 208, in _call_cmd
    stderr=subprocess.STDOUT,
  File "/usr/lib/python2.7/subprocess.py", line 573, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['/usr/bin/python', '-u', 'tools/mb/mb.py', 'gen', '-f', 'infra/mb/mb_config.pyl', '-m', 'developer_default', '-b', 'arm.release', 'out.gn/arm.release']' returned non-zero exit status 1
-------------------------------------------------------------------------------

Ale 

Ben Noordhuis

unread,
Jun 1, 2017, 2:18:13 PM6/1/17
to v8-users
Hm, that looks like a bug to me - target_arch should be "arm", not
"x86" and it shouldn't try to compile using the x86_64 version of
clang. Consider filing a bug report.

Jakob Kummerow

unread,
Jun 1, 2017, 3:17:47 PM6/1/17
to v8-users
It's not exactly a bug. v8gen.py, by design, replicates the configuration of the respective buildbot, and that buildbot uses arm simulator builds.

It's really easy to change the build configuration locally though: just run gn args out.gn/arm.release, and in the editor that opens, set target_cpu = "arm".


--
--
v8-users mailing list
v8-u...@googlegroups.com
http://groups.google.com/group/v8-users
---
You received this message because you are subscribed to the Google Groups "v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to v8-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

aleReimondo

unread,
Jun 1, 2017, 4:11:36 PM6/1/17
to v8-users
Hi,

When I run gn (with and without arguments) I get the same error.
Is there an option to set configuration manually?

pi@raspberrypi:~/v8 $ gn args
Traceback (most recent call last):
  File "/home/pi/depot_tools/gn.py", line 38, in <module>
    sys.exit(main(sys.argv))
  File "/home/pi/depot_tools/gn.py", line 33, in main
    return subprocess.call([gn_path] + args[1:])
  File "/usr/lib/python2.7/subprocess.py", line 522, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1335, in _execute_child
    raise child_exception
OSError: [Errno 8] Exec format error

Ale


To unsubscribe from this group and stop receiving emails from it, send an email to v8-users+u...@googlegroups.com.

aleReimondo

unread,
Jun 1, 2017, 4:46:15 PM6/1/17
to v8-users
The gn command is running executable gn at ~/v8/buildtools/linux64
IMO the binary executable was downloaded from V8 repo,
 and do not have the correct contents to be run here

pi@raspberrypi:~/v8/buildtools/linux64 $ ./gn --help
bash: ./gn: cannot execute binary file: Formato de ejecutable incorrecto

So, the gn.py is not running because it is trying to run binary code
 of wrong target.

Ale

aleReimondo

unread,
Jun 2, 2017, 9:39:27 AM6/2/17
to v8-users
Now starting from a new installation to ensure the malfunction of the tools download is reproducible on clean installation of Raspbian...
Ale
Message has been deleted

aleReimondo

unread,
Jun 2, 2017, 11:10:16 AM6/2/17
to v8-users
Confirmed the malfunction of the build toolset on the Raspberry Pi.
It has been reproduced started from clean SDCard (Raspbian OS) and following wiki procedures to build V8 without observing any other issues during installation and setup.
So, I will consider this a BUG of Chrome toolset and wait to be repaired soon.
IMHO the downloaded binary of gn is wrong on the Raspery Pi 3 (Raspbian OS).
Ale
p.d. Why are we downloading binaries? the reason to use py scripting is to do not transfer binary...  please remove scripting (best) or binary downloads in the toolset :-P

aleReimondo

unread,
Jun 2, 2017, 11:37:50 AM6/2/17
to v8-users

Jakob Kummerow

unread,
Jun 2, 2017, 11:39:44 AM6/2/17
to v8-users
On Fri, Jun 2, 2017 at 5:10 PM, aleReimondo <aleRe...@smalltalking.net> wrote:
Confirmed the malfunction of the build toolset on the Raspberry Pi.
It has been reproduced started from clean SDCard (Raspbian OS) and following wiki procedures to build V8 without observing any other issues during installation and setup.
So, I will consider this a BUG of Chrome toolset and wait to be repaired soon.
IMHO the downloaded binary of gn is wrong on the Raspery Pi 3 (Raspbian OS).

Interesting observation. 
Yes, it looks like it is assumed that nobody builds on an ARM device; this site says:
Due to the lack of ARM hardware with the grunt to build Chromium native, cross compiling is currently the recommended method of building for ARM.

V8 has instructions for cross-compiling: https://github.com/v8/v8/wiki/Cross-compiling-for-ARM (these are targeting Android, but it should be easy to adapt them).

As an alternative: while there don't seem to be pre-built gn binaries for you to download, you can build your own gn from source. However, I'm not familiar with that process so I can't give more detailed hints, I only know that it is possible.
 
Ale
p.d. Why are we downloading binaries? the reason to use py scripting is to do not transfer binary...  please remove scripting (best) or binary downloads in the toolset :-P

Well, gn is a binary tool, that's by design... The Python scripts around it are just for convenience.

Jakob Kummerow

unread,
Jun 2, 2017, 11:44:56 AM6/2/17
to v8-users
On Fri, Jun 2, 2017 at 5:37 PM, aleReimondo <aleRe...@smalltalking.net> wrote:

Don't hold your breath, but feel free to help ;-)

aleReimondo

unread,
Jun 2, 2017, 11:45:19 AM6/2/17
to v8-users
Thank you Jakob,
I will try to read and build gn :-)

On the paragraph:
 
Well, gn is a binary tool, that's by design... The Python scripts around it are just for convenience.


So, the use of build tools can impose security risks.

Ale. 
Reply all
Reply to author
Forward
0 new messages