|
LinuxBuildInstructions
Build instructions for Linux
Linux OverviewDue 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:
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
.../chromium/src $ ./build/install-build-deps.sh ConfiguringAfter 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
CompilationThe weird "src/" directory is an artifact of gclient. Start with: $ cd src Build just chrome$ make chrome Faster buildsTo 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 buildsInformation about building with Clang can be found here. OutputExecutables are written in src/out/Debug/ for Debug builds, and src/out/Release/ for Release builds. Release modeAdd BUILDTYPE=Release to the make invocation: $ make BUILDTYPE=Release Seeing the commandsIf 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 buildsAll built files are put into the out/ directory, so to start over with a clean build, just: rm -rf out TroubleshootingIf you see make: *** No targets specified and no makefile found. Stop., you probably need to run gyp again. See the "Configuring" steps above. Linker CrashesIf, 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:
Advanced Features
Next StepsIf you want to contribute to the effort toward a Chromium-based browser for Linux, please check out the Linux Development page for more information. |
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)
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?
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
If you are running 32-bit Linux kernel you may run into the following during linking of test_shell or chrome:
To get around this do not use the gold linker. There are reports of this from Ubuntu running on both vmware and parallels.
Is there a comprehensive list of all the chromium compile flags somewhere?
after that the 'make chrome' is finished, what you're supposed to do to run it? :/
bison: cannot open file `external/bison/data/m4sugar/m4sugar.m4': No such file or directory Traceback (most recent call last):
AssertionError? make: [out/Debug/obj/gen/webkit/CSSGrammar.cpp] Error 1make 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`
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
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?
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
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
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
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 . . .