New issue
Advanced search Search tips

Issue 613452 link

Starred by 9 users

Issue metadata

Status: Fixed
Owner: ----
Closed: Oct 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug



Sign in to add a comment

Chrome doesn't cross compile for ARM64 Linux

Reported by apat...@nvidia.com, May 20 2016

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.112 Safari/537.36

Steps to reproduce the problem:
1. Sync latest chromium source
2. export GYP_CROSS_COMPILE=1
3. Cross compiling is not supported. Scripts like install-sysroot.sh report unsupported configuration.

What is the expected behavior?
It should compile successfully, but doesn't as the ARM64 linux support is not added yet.

What went wrong?
ARM64 linux support is missing.

Did this work before? N/A 

Chrome version: 49.0.2623.112  Channel: dev
OS Version: 
Flash Version:
 

Comment 1 by apat...@nvidia.com, May 20 2016

I am now able to build latest chromium with clang(3.9.0) for ARM64 linux, will try to upstream patches.

I had to make below changes:
1. Changes to sysroot creation scripts
2. Changes to GYP files for ARM64 linux
3. Disable few features like allocator and nacl for ARM64 linux
4. Fix some compilation errors with "!defined(__aarch64__)" for some unsupported stuff on ARM64.
5. Fix some redefinition errors 
6. Need to upstream created sysroot so that it can be installed using install-sysroot.sh. Looks like it needs some special google cloud permissions.
7. Add ARM64 support to install-sysroot.sh 

Comment 2 by apat...@nvidia.com, May 20 2016

Uploaded patches -
https://codereview.chromium.org/1997993003/
https://codereview.chromium.org/2001523002
https://codereview.chromium.org/1996273002

Still some work needs to be uploaded for modifying install-sysroot.sh which can be done only after uploading sysroot to google cloud, gclient runhooks fails otherwise.

And one ffmpeg patch that fixes redifinition:
chromium/config/Chromium/linux/arm64/config.h
-#define HAVE_VFP_ARGS 0
+/* #define HAVE_VFP_ARGS 0 -- Disabled to allow softfp/hardfp selection at gyp time */

Comment 3 by apat...@nvidia.com, May 20 2016

Build steps:
1. Apply all above patches
2. Build sysroot
   run sysroot-creator-jessie.sh BuildSysrootARM64 - it creates <sysroot>.tgz in out/sysroot-build/
3. create folder src/build/linux/debian_jessie_arm64-sysroot and extract <sysroot>.tgz inside it. This and 2nd step will not be required and you can just do install-sysroot --arm64 once sysroot is uploaded to google cloud
4. export GYP_CROSS_COMPILE=1
5. GYP_DEFINES='target_arch=arm64" ./build/gyp_chromium
5. ninja -C out/Release chrome
Components: -Platform>DevTools Build
Project Member

Comment 6 by bugdroid1@chromium.org, Jun 3 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/bf7b161de8c47f70b70eb4bd5b28224c1a16ed53

commit bf7b161de8c47f70b70eb4bd5b28224c1a16ed53
Author: apatole <apatole@nvidia.com>
Date: Fri Jun 03 18:58:07 2016

Fix arm64 linux compilation errors.

Fixes 'undeclared identifier __NR_access/__NR_open' compile errors.

__NR_access and __NR_open don't exist on ARM64. So, like the earlier
code in same file, added __NR_access and __NR_open case under
!defined(__aarch64__) check.

BUG= 613452 

Review-Url: https://codereview.chromium.org/1996273002
Cr-Commit-Position: refs/heads/master@{#397767}

[modify] https://crrev.com/bf7b161de8c47f70b70eb4bd5b28224c1a16ed53/services/shell/runner/host/linux_sandbox.cc

Comment 7 by apat...@nvidia.com, Jun 8 2016

Attached patch to fix ffmpeg compilation errors. I tried to upload it to chromium ffmpeg repo but getting errors:
! [remote rejected] HEAD -> refs/for/refs/heads/master%notify=NONE,cc=feature-media-reviews@chromium.org (user "feature-media-reviews@chromium.org" not found)
third_party_ffmpeg_0001-Fix-ARM64-linux-compilation-errors.patch
5.4 KB Download

Comment 10 by apat...@nvidia.com, Jun 15 2016

I have made additional changes to automatically install arm64 sysroot using install-sysroot.sh. But it needs sysroot to be uploaded to google cloud first and it needs write permissions to chrome-linux-sysroot bucket which I don't have.

Can somebody having permissions create+upload sysroot to google cloud. I have created one with revision bd10c315594d2a20e31a94a7a6c7adb9a0961c56 and tested it but not sure how I can share it for uploading. Note, need to update the package list before creating it.
1. sysroot-creator-jessie.sh UpdatePackageListsARM64
2. sysroot-creator-jessie.sh BuildSysrootARM64
I can then test my install-sysroot.sh changes and upload it for review.
Cc: mmoss@chromium.org
mmoss: Do you know off the top of your head how to upload sysroots to cloud storage?

Comment 12 by apat...@nvidia.com, Jun 20 2016

I have created a patch to modify install scripts for arm64 - https://codereview.chromium.org/2078293002/ which off course will have to be modified to match checksum and revision with sysroot that is uploaded to the cloud.


For comment 7 - try emailing feature-media-reviews@chromium.org and see if someone there can help with with ffmpeg?
Project Member

Comment 14 by bugdroid1@chromium.org, Jul 8 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ad891a49ee7aeff1a42559c0a059cb51f053e1fb

commit ad891a49ee7aeff1a42559c0a059cb51f053e1fb
Author: apatole <apatole@nvidia.com>
Date: Fri Jul 08 09:33:20 2016

Add support for installing ARM64 sysroot

This change modifies install-sysroot.py to add support for
installing ARM64 sysroot. Also update the jessie arm64 package list.

BUG= 613452 

Review-Url: https://codereview.chromium.org/2078293002
Cr-Commit-Position: refs/heads/master@{#404323}

[modify] https://crrev.com/ad891a49ee7aeff1a42559c0a059cb51f053e1fb/build/linux/sysroot_scripts/install-sysroot.py
[modify] https://crrev.com/ad891a49ee7aeff1a42559c0a059cb51f053e1fb/build/linux/sysroot_scripts/packagelist.jessie.arm64

Cc: dalecur...@chromium.org
Strange, does git cl upload not work for third_party/ffmpeg ? 


Since it's called "third_party", I'd guess that means it's being mirrored from somewhere else. The change would need to be committed upstream, not to our copy.
To clarify, last I checked it does work :) We use it frequently for uploading; it should point to this repo, https://chromium.googlesource.com/chromium/third_party/ffmpeg/
Project Member

Comment 18 by bugdroid1@chromium.org, Jul 8 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ab2caa6f55eb30e614afce9f1b2a7cfa244eb173

commit ab2caa6f55eb30e614afce9f1b2a7cfa244eb173
Author: jbudorick <jbudorick@chromium.org>
Date: Fri Jul 08 21:17:53 2016

Revert of Add support for installing ARM64 sysroot (patchset #1 id:1 of https://codereview.chromium.org/2078293002/ )

Reason for revert:
https://bugs.chromium.org/p/chromium/issues/detail?id=626784

Original issue's description:
> Add support for installing ARM64 sysroot
>
> This change modifies install-sysroot.py to add support for
> installing ARM64 sysroot. Also update the jessie arm64 package list.
>
> BUG= 613452 
>
> Committed: https://crrev.com/ad891a49ee7aeff1a42559c0a059cb51f053e1fb
> Cr-Commit-Position: refs/heads/master@{#404323}

TBR=thestig@chromium.org,mmoss@chromium.org,thakis@chromium.org,apatole@nvidia.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG= 613452 

Review-Url: https://codereview.chromium.org/2132153002
Cr-Commit-Position: refs/heads/master@{#404490}

[modify] https://crrev.com/ab2caa6f55eb30e614afce9f1b2a7cfa244eb173/build/linux/sysroot_scripts/install-sysroot.py
[modify] https://crrev.com/ab2caa6f55eb30e614afce9f1b2a7cfa244eb173/build/linux/sysroot_scripts/packagelist.jessie.arm64

I guess r404323 should have added an entry to tools/checklicenses/checklicenses.py to ignore the new sysroot.

Comment 20 by apat...@nvidia.com, Jul 11 2016

Regarding last revert,
Yes, I could repro it with "python checklicenses.py build/linux/". I see entry in EXCLUDED_PATHS for all other sysroots, will add entry for debian_jessie_arm64-sysroot there.

Before adding entry:
it fails with errors like -
build/linux/debian_jessie_arm64-sysroot/...' has non-whitelisted license 'UNKNOWN'
FAILED

After adding entry:
python checklicenses.py build/linux/
SUCCESS

Will upload new patch today...

Comment 21 by apat...@nvidia.com, Jul 11 2016

Entry to tools/copyright_scanner/copyright_scanner.py is required for fixing webview license script errors mentioned in above revert, will add entry there as well.

Steps to repro:
"python webview_licenses.py scan"
Project Member

Comment 22 by bugdroid1@chromium.org, Jul 11 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/82242c1833949a8a5ae9708b4c5af65585f23b71

commit 82242c1833949a8a5ae9708b4c5af65585f23b71
Author: apatole <apatole@nvidia.com>
Date: Mon Jul 11 20:12:17 2016

Reland "Add support for installing ARM64 sysroot"

Fixed license and copyright script errors with earlier change by
whitelisting newly introduced folder
build/linux/debian_jessie_arm64-sysroot.

This change modifies install-sysroot.py to add support for
installing ARM64 sysroot. also upadted jessie arm64 package list.

BUG= 613452 
R=thestig@chromium.org

Review-Url: https://codereview.chromium.org/2136993002
Cr-Commit-Position: refs/heads/master@{#404719}

[modify] https://crrev.com/82242c1833949a8a5ae9708b4c5af65585f23b71/build/linux/sysroot_scripts/install-sysroot.py
[modify] https://crrev.com/82242c1833949a8a5ae9708b4c5af65585f23b71/build/linux/sysroot_scripts/packagelist.jessie.arm64
[modify] https://crrev.com/82242c1833949a8a5ae9708b4c5af65585f23b71/tools/checklicenses/checklicenses.py
[modify] https://crrev.com/82242c1833949a8a5ae9708b4c5af65585f23b71/tools/copyright_scanner/copyright_scanner.py

Comment 23 by apat...@nvidia.com, Jul 12 2016

I again tried uploading ffmpeg patch today and it fails with below errors. Looks like you need to be a committer to be able to successfully upload.

To https://chromium.googlesource.com/chromium/third_party/ffmpeg
 ! [remote rejected] 23687871c6c85270c1d22632cdd4e0e9bc7dd926 -> refs/for/refs/heads/master%notify=NONE (invalid committer)
error: failed to push some refs to 'https://chromium.googlesource.com/chromium/third_party/ffmpeg'
Traceback (most recent call last):


Comment 24 by apat...@nvidia.com, Jul 12 2016

Finally I could upload third_party/ffmpeg patch. I had other conflicting account
apatole%nvidia.com@gtempaccount.com and it was causing the problem.

Path uploaded at - https://chromium-review.googlesource.com/#/c/360036/
Project Member

Comment 25 by bugdroid1@chromium.org, Jul 12 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/814e497b3425ab0d25585c3f89f61e35e5ab6bdf

commit 814e497b3425ab0d25585c3f89f61e35e5ab6bdf
Author: apatole <apatole@nvidia.com>
Date: Tue Jul 12 21:52:46 2016

Correct install sysroot script logs/comments

Since we have Jessie sysroot for arm64 linux and Wheezy sysroots
for others, log/comment lines in install-sysroot script need to be
modified to match this behavior.

BUG= 613452 
R=thestig@chromium.org, thakis@chromium.org

Review-Url: https://codereview.chromium.org/2138423002
Cr-Commit-Position: refs/heads/master@{#404841}

[modify] https://crrev.com/814e497b3425ab0d25585c3f89f61e35e5ab6bdf/build/linux/sysroot_scripts/install-sysroot.py

Project Member

Comment 26 by bugdroid1@chromium.org, Aug 29 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/third_party/ffmpeg/+/901b874d864bb5ee7b4758812a1a3665d53435e3

commit 901b874d864bb5ee7b4758812a1a3665d53435e3
Author: Arun Patole <apatole@nvidia.com>
Date: Mon Aug 29 05:11:50 2016

Fix Chrome ARM64 linux compilation errors

For GYP build,
We get HAVE_VFP_ARGS redefinition error.
To fix it, just disabling HAVE_VFP_ARGS definition in
chromium/config/Chromium/linux/arm64/config.h

For GN Build,
We get name conflict for videodsp.o as it is generated twice in same
folder using libavcodec/videodsp.c and libavcodec/aarch64/videodsp.S.
This change renames videodsp.S to videodsp_aarch64.S as a workaround
to this build issue.

BUG= 613452 

Change-Id: Iccb811ee6e3d10f888a9d1e5efb65055b409d23c
Reviewed-on: https://chromium-review.googlesource.com/360036
Reviewed-by: Chrome Cunningham <chcunningham@chromium.org>

[modify] https://crrev.com/901b874d864bb5ee7b4758812a1a3665d53435e3/chromium/config/Chrome/linux/arm64/config.h
[modify] https://crrev.com/901b874d864bb5ee7b4758812a1a3665d53435e3/ffmpeg_generated.gni
[modify] https://crrev.com/901b874d864bb5ee7b4758812a1a3665d53435e3/chromium/config/Chromium/linux/arm64/config.h
[modify] https://crrev.com/901b874d864bb5ee7b4758812a1a3665d53435e3/chromium/scripts/build_ffmpeg.py
[modify] https://crrev.com/901b874d864bb5ee7b4758812a1a3665d53435e3/chromium/patches/README
[rename] https://crrev.com/901b874d864bb5ee7b4758812a1a3665d53435e3/libavcodec/aarch64/videodsp_aarch64.S

Project Member

Comment 27 by bugdroid1@chromium.org, Sep 10 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6e5925dcef736146fa6eed5f2d88c9820963704e

commit 6e5925dcef736146fa6eed5f2d88c9820963704e
Author: wolenetz <wolenetz@chromium.org>
Date: Sat Sep 10 02:08:54 2016

Roll src/third_party/ffmpeg/ 35740fc7b..12183cc16 (5 commits).

https://chromium.googlesource.com/chromium/third_party/ffmpeg.git/+log/35740fc7b72a..12183cc1619b

$ git log 35740fc7b..12183cc16 --date=short --no-merges --format='%ad %ae %s'
2016-09-09 wolenetz avformat/mov: Fix potential integer overflow in mov_read_keys
2016-09-01 chcunningham Detect basename collisions irrespective of file extension.
2016-08-30 chcunningham Adding generate_gn_unittests.py to PRESUBMIT
2016-08-30 chcunningham FFmpeg generate_gn.py: Fix tests and logic reduction algorithm.
2016-08-29 apatole Fix Chrome ARM64 linux compilation errors

TBR=chcunningham@chromium.org,servolk@chromium.org, xhwang@chromium.org
BUG= 643948 , 627567 , 535788 , 613452 

Review-Url: https://codereview.chromium.org/2330633002
Cr-Commit-Position: refs/heads/master@{#417800}

[modify] https://crrev.com/6e5925dcef736146fa6eed5f2d88c9820963704e/DEPS

Comment 28 by apat...@nvidia.com, Oct 26 2016

I think this bug can now be closed as all the required patches to cross compile chromium for ARM64 Linux are in.

Here are some more details for future reference:
55.0.2857.0 is the first source tag with all the patches. But there are some other build issues with this tag.
I tried building it few days back with latest source (56.0.2890.0 - refs/heads/master@{#424963} and it builds. I also find it working in my quick testing.
Status: Fixed (was: Unconfirmed)
Woohoo!
Nice, thanks for getting this going :-)
Well done! 
net-misc/tlsdate-0.0.5-r44 fails to build


tlsdate-0.0.5-r44-arm64-build-fail.txt
13.1 KB View Download
@chris,
This bug was mainly about cross compiling chromium/chrome browser for arm 64 linux using GYP/GN build system. And when I tried to build Chromium browser for linux yesterday, I was able to build it. There was one v8 error but it is already fixed in v8 trunk and should be available in next V8 roll. So building chromium browser for arm64 linux still seem to be working.

If it is not working for any other build system or for chromium os, I think you can file a new bug for this. 

Sign in to add a comment