cross-building for chromeos-arm

235 views
Skip to first unread message

Tim Newsham

unread,
Aug 20, 2014, 5:06:49 PM8/20/14
to chromi...@chromium.org
I'm trying to build chromium for arm on and amd64 box.  I'm able to build "directly" for amd64, but when I try to follow the cross-building instructions at https://code.google.com/p/chromium/wiki/LinuxChromiumArm (recipe 2) I get an error:

$ build/gyp_chromium -Dchromeos=1
$ ninja -C out/Debug.arm/ chrome
ninja: Entering directory `out/Debug.arm/'
ninja: error: '../../native_client/toolchain/.tars/linux_x86/nacl_arm_newlib.json', needed by 'gen/sdk/linux_x86/nacl_arm_newlib/nacl_arm_newlib.json', missing and no known rule to make it

I have a nativelicnet/toolchain/.tars/linux_x68 directory but there is no nacl_arm_newlib.json file here (there is such a file in another subtree).  What am I doing wrong and how can I get this built?

Also, is it possible to keep around several build trees for different platforms in the same tree?  Can I just move the out/Debug directory (ie. to out/Debug.amd64 and out/Debug.arm) after running gyp_chromium and then run ninja builds against each of those separately, or will they interfere in some way?

Tim

Nico Weber

unread,
Aug 20, 2014, 5:09:29 PM8/20/14
to tim.n...@gmail.com, Chromium-dev
On Wed, Aug 20, 2014 at 2:06 PM, Tim Newsham <tim.n...@gmail.com> wrote:
I'm trying to build chromium for arm on and amd64 box.  I'm able to build "directly" for amd64, but when I try to follow the cross-building instructions at https://code.google.com/p/chromium/wiki/LinuxChromiumArm (recipe 2) I get an error:

$ build/gyp_chromium -Dchromeos=1
$ ninja -C out/Debug.arm/ chrome
ninja: Entering directory `out/Debug.arm/'
ninja: error: '../../native_client/toolchain/.tars/linux_x86/nacl_arm_newlib.json', needed by 'gen/sdk/linux_x86/nacl_arm_newlib/nacl_arm_newlib.json', missing and no known rule to make it

I think this might be written by runhooks, did you run `gclient runhooks` (or `gclient sync`, which runs runhooks)?
 
I have a nativelicnet/toolchain/.tars/linux_x68 directory but there is no nacl_arm_newlib.json file here (there is such a file in another subtree).  What am I doing wrong and how can I get this built?

Also, is it possible to keep around several build trees for different platforms in the same tree?  Can I just move the out/Debug directory (ie. to out/Debug.amd64 and out/Debug.arm) after running gyp_chromium and then run ninja builds against each of those separately, or will they interfere in some way?

It's possible. You can set GYP_GENERATOR_FLAGS=output_dir=out_foo (or pass -Goutput_dir=out_foo to build/gyp_chromium, same thing) and then build with ninja -C out_foo/Release.
 

Tim

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev

Tim Newsham

unread,
Aug 20, 2014, 5:58:05 PM8/20/14
to chromi...@chromium.org, tim.n...@gmail.com
Indeed, i had forgot to gsync.  Thank you.  I get a bit further now, but I'm getting an error (full error log is attached).

arm-linux-gnueabihf-g++: error: find-bad-constructs: No such file or directory
arm-linux-gnueabihf-g++: error: arm-linux-gnueabihf: No such file or directory

It looks like this issue has been reported before: https://code.google.com/p/chromium/issues/detail?id=395832    which mentions that another gcc version might be required?  The cross building guide doesn't make any mention of this.  Is there an easy workaround that doesnt involve installing a different version gcc?
err.txt

Nico Weber

unread,
Aug 20, 2014, 6:05:10 PM8/20/14
to tim.n...@gmail.com, Chromium-dev
On Wed, Aug 20, 2014 at 2:58 PM, Tim Newsham <tim.n...@gmail.com> wrote:
Indeed, i had forgot to gsync.  Thank you.  I get a bit further now, but I'm getting an error (full error log is attached).

arm-linux-gnueabihf-g++: error: find-bad-constructs: No such file or directory
arm-linux-gnueabihf-g++: error: arm-linux-gnueabihf: No such file or directory

It looks like this issue has been reported before: https://code.google.com/p/chromium/issues/detail?id=395832    which mentions that another gcc version might be required?  The cross building guide doesn't make any mention of this.  Is there an easy workaround that doesnt involve installing a different version gcc?

There are 2.5 ways to go about this that I know of that should mostly work.

1. Do what this bot does: http://build.chromium.org/p/chromium.fyi/builders/Linux%20ARM%20Cross-Compile/builds/34504/steps/gclient%20runhooks/logs/stdio It sets target_arch=arm and (implicitly) uses clang for building (clang is bundled with the chromium checkout). Make sure not to set CC, CXX, or similar envvars when using this.

2. Use the chromeos "simplechrome" workflow. Run `cros chrome-sdk --board=daisy` (from the chromium src/ folder), and then build with ninja -C out_daisy/Release. That script will download a cros toolchain and configure things to use that as target toolchain. (You can look at third_party/chromite/cros/commands/cros_chrome_sdk.py to learn what that does.)

3. You can do something slightly custom where you provide your own target compiler, set CC / CXX to that (note that you need gcc4.8+), and add clang=0 to your GYP_DEFINES.

Nico

Achuith Bhandarkar

unread,
Aug 20, 2014, 6:17:13 PM8/20/14
to Nico Weber, tim.n...@gmail.com, Chromium-dev
I believe the simple chrome workflow is the best candidate here (2). Note that we have a amd64-generic board, so you don't have to use daisy.

Here's the link:

Zelidrag Hornung

unread,
Aug 20, 2014, 6:19:03 PM8/20/14
to Achuith Bhandarkar, Nico Weber, tim.n...@gmail.com, Chromium-dev
On Wed, Aug 20, 2014 at 3:16 PM, Achuith Bhandarkar <ach...@chromium.org> wrote:
I believe the simple chrome workflow is the best candidate here (2). Note that we have a amd64-generic board,

you mean arm-generic?

Nico Weber

unread,
Aug 20, 2014, 6:25:57 PM8/20/14
to Tim Newsham, Chromium-dev
On Wed, Aug 20, 2014 at 3:04 PM, Nico Weber <tha...@chromium.org> wrote:
On Wed, Aug 20, 2014 at 2:58 PM, Tim Newsham <tim.n...@gmail.com> wrote:
Indeed, i had forgot to gsync.  Thank you.  I get a bit further now, but I'm getting an error (full error log is attached).

arm-linux-gnueabihf-g++: error: find-bad-constructs: No such file or directory
arm-linux-gnueabihf-g++: error: arm-linux-gnueabihf: No such file or directory

It looks like this issue has been reported before: https://code.google.com/p/chromium/issues/detail?id=395832    which mentions that another gcc version might be required?  The cross building guide doesn't make any mention of this.  Is there an easy workaround that doesnt involve installing a different version gcc?

There are 2.5 ways to go about this that I know of that should mostly work.

1. Do what this bot does: http://build.chromium.org/p/chromium.fyi/builders/Linux%20ARM%20Cross-Compile/builds/34504/steps/gclient%20runhooks/logs/stdio It sets target_arch=arm and (implicitly) uses clang for building (clang is bundled with the chromium checkout). Make sure not to set CC, CXX, or similar envvars when using this.

2. Use the chromeos "simplechrome" workflow. Run `cros chrome-sdk --board=daisy` (from the chromium src/ folder), and then build with ninja -C out_daisy/Release. That script will download a cros toolchain and configure things to use that as target toolchain. (You can look at third_party/chromite/cros/commands/cros_chrome_sdk.py to learn what that does.)

(Forgot to say: you need to run `build/gyp_chromium` in the shell opened by cros chrome-sdk before starting the build.)

Achuith Bhandarkar

unread,
Aug 20, 2014, 6:29:01 PM8/20/14
to Zelidrag Hornung, Nico Weber, tim.n...@gmail.com, Chromium-dev
Ah, Nico is right - we don't have arm-generic. daisy is the best option I believe.

Tim Newsham

unread,
Aug 20, 2014, 9:31:03 PM8/20/14
to chromi...@chromium.org, tim.n...@gmail.com
Thank you, following method #1 seems to have worked (build is still in progress).  Here's what I ended up doing:

[follow cross instructions, but DO NOT set the environment variables, then...]

$ export GYP_CROSSCOMPILE=1
$ export GYP_DEFINES="arm_float_abi=hard component=static_library target_arch=arm test_isolation_mode=archive test_isolation_outdir=https://isolateserver.appspot.com"
$ build/gyp_chromium -Goutput_dir=out_arm 
$ ninja -C out_arm/Debug chrome

Tim

On Wednesday, August 20, 2014 12:05:10 PM UTC-10, Nico Weber wrote:
There are 2.5 ways to go about this that I know of that should mostly work.

1. Do what this bot does: http://build.chromium.org/p/chromium.fyi/builders/Linux%20ARM%20Cross-Compile/builds/34504/steps/gclient%20runhooks/logs/stdio It sets target_arch=arm and (implicitly) uses clang for building (clang is bundled with the chromium checkout). Make sure not to set CC, CXX, or similar envvars when using this.

Nico
Reply all
Reply to author
Forward
0 new messages