在ubuntu上編譯chrome

來源:互聯網
上載者:User
在ubuntu上編譯chrome紅心地瓜1.擷取代碼1)下載tarball,http://chromium-browser-source.commondatastorage.googleapis.com/chromium_tarball.html2)   解壓縮3)安裝dept_tools:http://www.chromium.org/developers/how-tos/install-depot-tools將dept_tools加到PATH裡面 export PATH="$PATH":`pwd`/depot_tools或者加到~/.bashrc裡面2.安裝dependency進到chromium/src目錄下./build/install-build-deps.sh

3.同步代碼進到chromium/src目錄下gclient sync --force
如果不想同步,則必須執行gclient runhooks --force
這一步會調用gyp來長生一些平台特定的代碼,只要做一次就可以
4.配置

./build/gyp_chromium -Dflag1=value1 -Dflag2=value2

5.編譯make chrome
碰到問題及解決1.bison: cannot open file `external/bison/data/m4sugar/m4sugar.m4': No such file or directory看著像bison沒有裝好,又重新apt-get remove/install裝了bison,還是不行,到網站下載最新的2.5編譯安裝,還是不行於是bison -V發現顯示的是bison (GNU Bison) 2.3
可是我用Whereis bison,顯示的又是我剛裝的2.5的地址判斷是哪裡的bison預先執行了於是strace(bison),果然execve("/home/tom/work/gingerbread/out/host/linux-x86/bin/bison", ["bison"], [/* 51 vars */]) = 0

原因是我將android out 的地址設定在path的前面,於是覆蓋了/usr/local/bin,執行了android下面的bison修改PATH變數,問題得到解決
2.link的時候記憶體不足退出解決方案:1)加大swap,我加到了8Ghttp://www.ylmf.net/ubuntu/tips/2010123119690.html
2)採用gold ld替代ld進行連結 export
CC="gcc -B/usr/local/gold/bin"
或者將/usr/local/gold/bin加到PATH變數中/usr/bin的前面


參考:1)get-the-code,http://www.chromium.org/developers/how-tos/get-the-code2)linux build instruction,http://code.google.com/p/chromium/wiki/LinuxBuildInstructions3) LinuxFasterBuilds, http://code.google.com/p/chromium/wiki/LinuxFasterBuilds

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.