My favorites | Sign in
Project Home Downloads Wiki Issues
Search
for
LinuxBuildInstructions  
Build instructions for Linux
Linux
Updated Jan 30, 2012 by thakis@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 called gclient.
  2. gyp. The cross-platform build configuration system is called gyp, and on Linux it generates Makefiles. Running gyp is analogous to the ./configure step seen in most other software.
  3. make. The actual build itself uses GNU make.
  4. We don't provide any sort of "install" step.

Getting a checkout

Linux users often prefer to use Git. We have a page on how to check out the main tree with Git, but note that you still will need to understand and run all of gclient and gyp anyway.

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

After gclient sync finishes, it will run gyp automatically to generate the Makefiles. You can re-run gyp yourself as build/gyp_chromium.

gyp supports a minimal amount of build configuration via the -D flag.

./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=1 builds the ChromeOS version of Chrome. This is not all of ChromeOS (see the ChromiumOS page 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 -jX where 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 see http://crbug.com/80071 before you proceed.

Clang builds

Information about building with Clang can be found here.

Output

Executables are written in src/out/Debug/ for Debug builds, and src/out/Release/ for Release builds.

Release mode

Add BUILDTYPE=Release to the make invocation:

$ make BUILDTYPE=Release

Seeing the commands

If you want to see the actual commands that make is invoking, add V=1 to 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 the out/ directory, so to start over with a clean build, just:

rm -rf out

Troubleshooting

If you see make: *** No targets specified and no makefile found. Stop., you probably need to run gyp again. 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 the gold linker
  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 the LinuxFasterBuilds page.

Advanced Features

Next Steps

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

Comment by zhangxia...@gmail.com, May 7, 2010

The source code from the tar ball has subversion work-copy format 1.5, however, ubuntu 8.04 LTS comes with subversion 1.4, we need http://svn.apache.org/repos/asf/subversion/trunk/tools/client-side/change-svn-wc-format.py to down grade it. I suggest Google use default 1.4 format in the tar ball for the maximum interoperability.

(BTW, get source code instructions is hosted on Google Sites, and I can't leave a comment there)

Comment by rkll...@gmail.com, Aug 7, 2010

Because Chromium is developed with recent libraries, the built binary won't run on CentOS 5/RHEL 5. I would like to try to use another system (Fedora 13) to create a static build of Chromium that might actually run on the world's most popular commercial Linux, but I have no idea how to produce a static Chromium binary. I looked at the bug site and in the various build docs, plus various Makefiles and it looks like no-one has ever considered building Chromium statically. Or did I miss something? Should I file a bug on this?

Comment by j...@google.com, Aug 11, 2010

Tip: If you get a request for "Password for '(null)' GNOME keyring: " (see below), you may want to try deleting the "login" user from the "Passwords and Encryption Keys" app,

found .git directory; skipping src Password for '(null)' GNOME keyring:

running 'svn update /usr/local/space/home/gspencer/depot/chrome/cros_deps' in '/usr/local/space/home/gspencer/depot/chrome' svn: GNOME Keyring is locked and we are non-interactive Error: failed to run command: svn update /usr/local/space/home/gspencer/depot/chrome/cros_deps -- What exactly is the GNOME keyring (it's not my usual chromium key), and why can't I sync unless it's

Comment by gregsimon@chromium.org, Mar 11, 2011

If you are running 32-bit Linux kernel you may run into the following during linking of test_shell or chrome:

   /usr/bin/ld: fatal error: pthread_create failed: Resource temporarily unavailable

To get around this do not use the gold linker. There are reports of this from Ubuntu running on both vmware and parallels.

Comment by somethin...@gmail.com, Aug 23, 2011

Is there a comprehensive list of all the chromium compile flags somewhere?

Comment by max.ray...@me.com, Sep 20, 2011

after that the 'make chrome' is finished, what you're supposed to do to run it? :/

Comment by tomorrow...@gmail.com, Nov 7, 2011

bison: cannot open file `external/bison/data/m4sugar/m4sugar.m4': No such file or directory Traceback (most recent call last):

File "scripts/rule_bison.py", line 73, in <module>
assert returnCode == 0
AssertionError? make: [out/Debug/obj/gen/webkit/CSSGrammar.cpp] Error 1

Comment by hitap...@gmail.com, Dec 20, 2011

make chrome fail:

`Compile src/untrusted/stubs/crti_x86_32.S ../native_client/toolchain/linux_x86_newlib/x86_64-nacl/bin/gcc -c src/untrusted/stubs/crti_x86_32.S -o /home/testbox/softs/chronium/home/chrome-svn/tarball/chromium/src/out/Debug/obj/gen/tc_newlib/lib32/crti.o -std=gnu99 -m32 -O3 -fomit-frame-pointer -mtls-use-call -DNACL_BLOCK_SHIFT=5 -DNACL_BLOCK_SIZE=32 -DNACL_BUILD_ARCH=x86 -Dlinux -DSTDC_LIMIT_MACROS=1 -DSTDC_FORMAT_MACROS=1 -D_GNU_SOURCE=1 -D_BSD_SOURCE=1 -D_POSIX_C_SOURCE=199506 -D_XOPEN_SOURCE=600 -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DDYNAMIC_ANNOTATIONS_PREFIX=NACL -DNACL_BUILD_SUBARCH=32 -I/home/testbox/softs/chronium/home/chrome-svn/tarball/chromium/src/out/Debug/obj/gen/tc_newlib/include -I.. -I../ppapi -I.. -I../ppapi

>>>../native_client/build/build_nexe.py>> <<--compile>> <<--no-suffix>> <<--strip=x86_32>> <<--arch>> <<x86-32>> <<--build>> <<newlib_nlib>> <<--root>> <<..>> <<--name>> <</home/testbox/softs/chronium/home/chrome-svn/tarball/chromium/src/out/Debug/obj/gen/tc_newlib/lib32/crt_initfini_dummy>> <<--objdir>> <</home/testbox/softs/chronium/home/chrome-svn/tarball/chromium/src/out/Debug/obj/gen/tc_newlib/lib32>> <<--include-dirs>> <</home/testbox/softs/chronium/home/chrome-svn/tarball/chromium/src/out/Debug/obj/gen/tc_newlib/include .. ../ppapi .. ../ppapi>> <<--lib-dirs>> << >> <<--compile_flags>> <<-m32 -O3 -fomit-frame-pointer -mtls-use-call>> <<-DNACL_BLOCK_SHIFT=5>> <<-DNACL_BLOCK_SIZE=32>> <<-DNACL_BUILD_ARCH=x86>> <<-D__linux__>> <<-DSTDC_LIMIT_MACROS=1>> <<-DSTDC_FORMAT_MACROS=1>> <<-D_GNU_SOURCE=1>> <<-D_BSD_SOURCE=1>> <<-D_POSIX_C_SOURCE=199506>> <<-D_XOPEN_SOURCE=600>> <<-DDYNAMIC_ANNOTATIONS_ENABLED=1>> <<-DDYNAMIC_ANNOTATIONS_PREFIX=NACL>> <<-DNACL_BUILD_SUBARCH=32>> <<--link_flags>> <<-m32 -B/home/testbox/softs/chronium/home/chrome-svn/tarball/chromium/src/out/Debug/obj/gen/tc_newlib/lib32 >> <<src/untrusted/stubs/crti_x86_32.S>> <<src/untrusted/stubs/crtn_x86_32.S<<

../native_client/build/build_nexe.py --compile --no-suffix --strip=x86_32 --arch x86-32 --build newlib_nlib --root .. --name /home/testbox/softs/chronium/home/chrome-svn/tarball/chromium/src/out/Debug/obj/gen/tc_newlib/lib32/crt_initfini_dummy --objdir /home/testbox/softs/chronium/home/chrome-svn/tarball/chromium/src/out/Debug/obj/gen/tc_newlib/lib32 --include-dirs /home/testbox/softs/chronium/home/chrome-svn/tarball/chromium/src/out/Debug/obj/gen/tc_newlib/include .. ../ppapi .. ../ppapi --lib-dirs --compile_flags -m32 -O3 -fomit-frame-pointer -mtls-use-call -DNACL_BLOCK_SHIFT=5 -DNACL_BLOCK_SIZE=32 -DNACL_BUILD_ARCH=x86 -Dlinux -DSTDC_LIMIT_MACROS=1 -DSTDC_FORMAT_MACROS=1 -D_GNU_SOURCE=1 -D_BSD_SOURCE=1 -D_POSIX_C_SOURCE=199506 -D_XOPEN_SOURCE=600 -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DDYNAMIC_ANNOTATIONS_PREFIX=NACL -DNACL_BUILD_SUBARCH=32 --link_flags -m32 -B/home/testbox/softs/chronium/home/chrome-svn/tarball/chromium/src/out/Debug/obj/gen/tc_newlib/lib32 src/untrusted/stubs/crti_x86_32.S src/untrusted/stubs/crtn_x86_32.S<<

../native_client/toolchain/linux_x86_newlib/x86_64-nacl/bin/gcc -c src/untrusted/stubs/crti_x86_32.S -o /home/testbox/softs/chronium/home/chrome-svn/tarball/chromium/src/out/Debug/obj/gen/tc_newlib/lib32/crti.o -std=gnu99 -m32 -O3 -fomit-frame-pointer -mtls-use-call -DNACL_BLOCK_SHIFT=5 -DNACL_BLOCK_SIZE=32 -DNACL_BUILD_ARCH=x86 -Dlinux -DSTDC_LIMIT_MACROS=1 -DSTDC_FORMAT_MACROS=1 -D_GNU_SOURCE=1 -D_BSD_SOURCE=1 -D_POSIX_C_SOURCE=199506 -D_XOPEN_SOURCE=600 -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DDYNAMIC_ANNOTATIONS_PREFIX=NACL -DNACL_BUILD_SUBARCH=32 -I/home/testbox/softs/chronium/home/chrome-svn/tarball/chromium/src/out/Debug/obj/gen/tc_newlib/include -I.. -I../ppapi -I.. -I../ppapi FAILED: 2? No such file or directory

make: [out/Debug/obj/gen/tc_newlib/lib32/crt_initfini_dummy] Erreur 255`

Comment by nw...@detroitsci.com, Jan 5, 2012

Re: "make chrome fail" by hitap...@gmail.com, Dec 20, 2011

The "FAILED: [Errno 2] No such file or directory" error is misleading. If you try to run gcc from the command line, you'll see that there are dependencies missing (the following on Centos 6/64bit):

[root@dtw-10-4-20-55 native_client]# ../native_client/toolchain/linux_x86_newlib/x86_64-nacl/bin/gcc -bash: ../native_client/toolchain/linux_x86_newlib/x86_64-nacl/bin/gcc: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

This can be resolved by adding the glibc.i686 library and other missing libs (as root): yum install glibc.i686 libstdc++.so.6 libz.so.1

HTH Nathan

Comment by esaul...@gmail.com, Jan 8, 2012

Thank you for your prompt response, Nathan. I am in the same situation except that I am on an LFS system, and in order to get an x86 version of glibc, I'd have to first build a cross compiler to create x86 binaries, and then build a 32 bit version of uClibc, which translates into pain. Isn't there another way around this?

Comment by esaul...@gmail.com, Jan 8, 2012

I think I figured it out - disabling nacl does the trick! ./build/gyp_chromium disable_nacl=1 found it here - http://code.google.com/p/chromium/wiki/LinuxFasterBuilds

Comment by christop...@gmail.com, Feb 6 (5 days ago)

Using - webRTC enabled chrome 18.0.1027.0 compiled for linux - peerconnection_server - http://libjingle.googlecode.com/svn/trunk/talk/examples/peerconnection/server/server_test.html for testserver

I don't get the "CALL" functionality on the test page, only "message". New to network, so I didn't quite get the "note" at the bottom of http://code.google.com/p/webrtc/source/browse/trunk/test/functional_test/README.

Help please!! Xtof

Comment by esaul...@gmail.com, Feb 7 (4 days ago)

I have seen this in a post here, but it's expired or was removed, however I am experiencing the same issue with gamepad and libudev

 out/Release/obj.target/content/../content_browser/content/browser/gamepad/platform_data_fetcher_linux.o: In function  
 content::GamepadPlatformDataFetcherLinux::IsGamepad(udev_device*, int&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)':
 platform_data_fetcher_linux.cc:(.text._ZN7content31GamepadPlatformDataFetcherLinux9IsGamepadEP11udev_deviceRiRSs+0x2c): undefined reference to 
 `udev_device_get_property_value(udev_device*, char const*)'

and so on ad nauseam . . . libudev.so.0.5.1 is there with all the symbolic links, and all the functions that it complains about finding are there. Everything is pure 64 bit. Perhaps there is a way to simply turn off gamepad? I don't think I need this on my desktop . . .


Sign in to add a comment
Powered by Google Project Hosting