How to cross-compile Chromium for ARM

How to cross-compile Chromium for ARM

本文转载自:chrome - How do I cross-compile Chromium for ARM

先做个记号,尚未试验。

Steps

  1. mkdir -pv ~/chromium
  2. cd ~/chromium
  3. git config --global user.name "Joel Maranhao"
  4. git config --global user.email "youremail@example.com"
  5. git config --global core.autocrlf false
  6. git config --global core.filemode false
  7. git config --global color.ui true
  8. git clone https://chromium.googlesource.com/chromium/tools/depot_tools
  9. export PATH=$PATH:~/chromium/depot_tools See Update Notes 1
  10. mkdir -v ~/chromium/buildhost See Update Note 2
  11. cd ../buildhost See Update Note 2
  12. fetch --nohooks chromium
  13. cd src && ./build/install-build-deps.sh See Note 3
  14. sudo apt-get install gcc-arm-linux-gnueabihf
  15. sudo apt-get install g++-4.8-multilib-arm-linux-gnueabihf
  16. ./build/install-build-deps.sh --arm See Note 3
  17. gclient sync
  18. GYP_CROSSCOMPILE=1
    GYP_DEFINES=target_arch=arm arm_float_abi=hard component=shared_library linux_use_gold_flags=1
    See Note 4
  19. gclient runhooks
  20. ninja -C out/Debug chrome

Notice Steps 17 - 19. Step 18 replaces the Export Statements from Recipe 2 in the file chromium.gyp_env (This effectively switches the build Compiler to clang). Step 19 imports the chromium.gyp_env settings, and will run the proper buildscripts in the proper order.

Warning: Testing Steps

I’ll test these steps on my XUbuntu VM and report back/update etc.

Update Notes

1. Making the change permanent to the PATH variable is advisable if you are gong to do this more than once. Find the following:

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
   PATH="$HOME/bin:$PATH"
fi

in $HOME.profile. Add PATH=$PATH:~/chromium/depot_tools, so that the final if looks like:

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
    PATH=$PATH:~/chromium/depot_tools
fi

If Needed, create a $HOME/bin directory (It did not exist on my VM), then logout and back in again.

2. From Studying your Post, while downloading the Gigs and Gigs of data from the repository, I see that you ran the fetch script and downloaded the Source Code into the depot_tools directory. This is a common mistake and is easily remedied by creating a separate directory, as I’ve done. This keeps the tools needed to manage and manipulate the build files separate from the items you are building. This also ensures that the items you are building aren’t polluted by the tools used to build them.

3. The first pass of build-deps.sh downloads all the build tools regardless of cross-compiling or not. Step 14 and 15 are needed in case the script complains about Held Packages. The 2nd Pass(Step 16), sets up the cross compile. I’ll update this note as the build progresses.

4. For some reason the OP and I both had trouble with the gyp_env file. Because of this, I have updated Step 18 to include the needed exports. If interested in using the gyp_env file, see the Gyp User Documentation, Configuring the Builds, and Common Gyp Build Parameters

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值