`
yidongkaifa
  • 浏览: 4067107 次
文章分类
社区版块
存档分类
最新评论

编译Chromium 源码

 
阅读更多
LinuxBuildInstructions
Build instructions for Linux
Linux
UpdatedJan 30, 2012bythakis@chromium.org

Overview

Due mostly to its history and its complexity, Chromium uses a nonstandard set of custom tools to check out and build. Here's an overview of the steps you'll run:

  1. gclient. A checkout involves pulling nearly 100 different SVN repositories of code. This process is managed with a tool calledgclient.
  2. gyp. The cross-platform build configuration system is calledgyp, and on Linux it generates Makefiles. Runninggypis analogous to the./configurestep seen in most other software.
  3. make. The actual build itself uses GNUmake.
  4. We don't provide any sort of "install" step.

Getting a checkout

Linux users often prefer to use Git. We have apage on how to check out the main tree with Git, but note that you still will need to understand and run all ofgclientandgypanyway.

First Time Build Bootstrap

  • Make sure your dependencies are up to date by running the install-build-deps.sh script:
    .../chromium/src $ ./build/install-build-deps.sh 

Configuring

Aftergclient syncfinishes, it will rungypautomatically to generate the Makefiles. You can re-run gyp yourself asbuild/gyp_chromium.

gypsupports a minimal amount of build configuration via the-Dflag.

./build/gyp_chromium -Dflag1=value1 -Dflag2=value2
  • gcc warnings. By default we fail to build if there are any compiler warnings. If you're getting warnings, can't build because of that, but just want to get things done, you can specify-Dwerror=to turn that off.
  • ChromeOS.-Dchromeos=1builds the ChromeOS version of Chrome. This isnotall of ChromeOS (seethe ChromiumOSpage for full build instructions), this is just the slightly tweaked version of the browser that runs on that system. Its not designed to be run outside of ChromeOS and some features won't work, but compiling on your Linux desktop can be useful for certain types of development and testing.

Compilation

The weird "src/" directory is an artifact of gclient. Start with:

$ cd src

Build just chrome

$ make chrome

Faster builds

To do a parallel build, add-jXwhere X is the number of make processes to start up. This is useful for multiple-core machines or machines using distcc.

Build every tests

$ make

The above builds all libraries and tests in all components.It will take hours.

Specifying other target names to restrict the build to just what you're interested in. To build just the simplest unit test:

$ make base_unittests

Or you can specify the explicit file you want to build:

$ make out/Debug/chrome

GCC 4.6 is not supported yet.You may run into some build errors (and patches are welcome to fix them). Please seehttp://crbug.com/80071before you proceed.

Clang builds

Information about building with Clang can be foundhere.

Output

Executables are written insrc/out/Debug/for Debug builds, andsrc/out/Release/for Release builds.

Release mode

AddBUILDTYPE=Releaseto the make invocation:

$ make BUILDTYPE=Release

Seeing the commands

If you want to see the actual commands that make is invoking, addV=1to the make invocation.

$ make V=1

This is useful if, for example, you are debugging gyp changes, or otherwise need to see what make is actually doing.

Clean builds

All built files are put into theout/directory, so to start over with a clean build, just:

rm -rf out

Troubleshooting

If you seemake: *** No targets specified and no makefile found. Stop., you probably need to rungypagain. See the "Configuring" steps above.

Linker Crashes

If, during the final link stage:

 LINK(target) out/Debug/chrome

You get an error like:

collect2: ld terminated with signal 6 Aborted terminate called after throwing an instance of 'std::bad_alloc'

collect2: ld terminated with signal 11 [Segmentation fault], core dumped 

you are probably running out of memory when linking. Try one of:

  1. Use thegoldlinker
  2. Build on a 64-bit computer
  3. Build in Release mode (debugging symbols require a lot of memory)
  4. Build as shared libraries (note: this build is for developers only, and may have broken functionality)
Most of these are described on theLinuxFasterBuildspage.

Advanced Features

Next Steps

If you want to contribute to the effort toward a Chromium-based browser for Linux, please check out theLinux Development pagefor more information.

分享到:
评论

相关推荐

    window10下源码编译chromium

    断断续续下载chromium代码花了1周左右,代码约15G左右,其中遇到power shell的问题,遇到python的问题。最终编译花了11:30分。相比于Linux下的编译慢很多,系统运行的稳定性和速度也差很多。打算研究源码,一起分享...

    安卓版Chromium源代码

    安卓版Chromium的源码,适用于需要定制浏览器开发的场景,代码比较庞大,完整的Chromium浏览器内核。

    chromium源码下载以及编译

    详细的描述了chromium从开始下载到编译成功的各个步骤,方便后来人少走弯路。

    VS2017编译Chromium Embedded Framework(CEF)

    VS2017编译Chromium Embedded Framework(CEF) 一、 下载 二、 用CMake配置工程 三、 编译工程 四、 修改例子测试

    编译chromium kernel说明.txt

    经过几天的摸索,终于通过本地的chromiumos kernel源码生成了zImage用于arm移植,修改kernel源码,并编译,可以进行内核移植咯。。。希望对大家有帮助

    Chromium编译参数 详细文档

    该文件属于Chromium 58版本的编译配置文档,其中,包含每一项参数的说明。 请注意,该文档是通过gn args --list out/debug生成的,如果你已下载Chromium源码,可以手动生成,不必下载。

    Chromium源代码的GitHub官方镜像-C/C++开发

    Chromium Chromium是一个开放源代码的浏览器项目,旨在为所有用户构建更安全,更快,更稳定的方式来体验Web。 该项目的网站是https://www.chromium.org。 Chromium中的文档Chromium是一个开放源代码的浏览器项目,...

    libcef + chromium源码 3202(支持VS2015), 百度云

    libcef源码(分支3202)源码+编译中遇到的问题及解决方法

    chromium编译工具gn源码

    chromium编译工具gn源码

    cef chromium-75.0.3770.100-x64(支持h264)编译好的Release包

    cef chromium-75.0.3770.100-win64(支持h264)编译好的Release包。 资源全称:cef_binary_cef_binary_75.1.16+g16a67c4+chromium-75.0.3770.100_windows64_windows64 对应cef版本:75.1.16 对应chromium版本:75.0....

    chrome-mac.zip chromium: 752277 开放源代码的浏览器项目

    Chromium是一个开放源代码的浏览器项目,旨在为所有Internet用户构建一种更安全,更快,更稳定的方式来体验Web。该站点包含设计文档,体系结构概述,测试信息等,以帮助您学习构建和使用Chromium源代码。

    Chromium核心的简单多标签浏览器源码

    C#写的Chromium核心的简单多标签浏览器源码,编译成功后把dll文件夹里面的文件复制到运行目录即可,浏览器核心版本号Chromium 43.0.2357.130

    chrome源码下载编译.docx

    最近对Chromium源码进行了下载与编译,由于花费时间较长而且一些错误感觉并不是很好解决,特地写了一篇文档来记录整个从下载到编译完成的过程,以及我遇到的一些问题的解决方案。

    chromium 编译工具depot_tools

    chromium源码编译需要的资源 直接解压到跟源码对应的路径下面 并添加路径到环境变量中

    chromium-75.0.3753.1.tar.gz

    2008年9月,谷歌推出了Chrome的浏览器以及其源代码库- 铬项目,chrome浏览器背后的开源项目chromium project也成为了历史上最成功的开源项目之一,开源软件爱好者们可以在自己的电脑上下载源码,编译一个完整的...

    采用wget方式下载资源的download_from_google_storage.py

    采用wget方式下载资源的download_from_google_storage.py, 可以轻松在墙内下载并编译chromium源码

    build_chromiumos

    在ubuntu 14.04下编译并运行chrommiuos,折腾了两天,终于下完源码,编译成功,并在KVM上运行起来了.

    CEF102.0.5005.115 Windows 自己编译支持视频播放(支持H.264, MP4, MP3等)102版本32位

    根据官方源码,加上支持视频的参数,编译,亲测可用,编译日期2022.06 支持H.264, AAC, MP4, MP3等文件 里面有官方示例程序,可以运行访问 html5test.com 验证 文件为压缩包,包含两个文件,内容如下 示例:cef_...

    20190903chromium v8 depot_tools+源码

    本源码2019-09-03下载的,环境搭建过程已经通过自己测试,按下面环境搭建可以直接进行项目编译。 由于每个人使用场景可能不一样,这里就不直接提供编译后的库文件了 v8 2019-09-03.zip目录说明: v8 2019-09-03.zip...

    Chromium Embedded Framework (CEF)源码下载

    Chromium Embedded Framework (CEF)源码,亲测可编译出libcef.dll,版本是1916

Global site tag (gtag.js) - Google Analytics