Chromium Code Reviews| Index: docs/linux_build32_on64.md |
| diff --git a/docs/linux_build32_on64.md b/docs/linux_build32_on64.md |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..31950e602d4b6eff3cd6b6a7e2141fdd0f095c92 |
| --- /dev/null |
| +++ b/docs/linux_build32_on64.md |
| @@ -0,0 +1,128 @@ |
| +_If you're looking for building a 64 bit Chromium, try LinuxChromium64_ |
| + |
| +_OBSOLETE: Building 32-bit Chromium on 64-bit Linux is no longer officially supported. The "32-bit compatibility libs" instructions probably won't work. The chroot instructions are your best bet, but it is not actively tested or maintained._ |
|
Bons
2015/08/20 20:16:50
delete due to this being obsolete
|
| + |
| +## Introduction |
| +On at least Ubuntu Hardy, there is poor support for building 32-bit software. It seems it's blocked on "multiarch" support in Debian which is a grand solution to the problem but far off in the future. (See, for example [bug 492453](http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=492453).) So in the interim, we have some hacks that seem to work so far. |
| + |
| +Even a successful build will likely have issues: see Linux64BitIssues. |
| + |
| +## What are the Prerequisites |
| +LinuxBuildInstructionsPrerequisites has an up-to-date list of prerequisite packages needed for building chrome, as well as instructions for automatically installing the prerequisites. |
| + |
| +The script on that page is based on a [script on the Ubuntu forums](http://ubuntuforums.org/showthread.php?t=474790) that helps automate installing 32-bit libs on a 64-bit system. |
| + |
| +## Manual Setup on Ubuntu/Debian |
| + 1. Go to [LinuxBuildInstructionsPrerequisites#Automated\_Setup](LinuxBuildInstructionsPrerequisites#Automated_Setup.md). |
| + 1. Manually run that script. |
| + |
| +## Manual Setup on openSUSE |
| +(Tested on openSUSE 11.1 x86\_64) |
| +This can be incomplete list. |
| + |
| +### Packages |
| +gcc-32bit |
| +glibc-devel-32bit |
| +libgio-2\_0-0-32bit |
| +gtk2-32bit |
| +libatk-1\_0-0-32bit |
| +gtk2-32bit |
| +pango-32bit |
| +pango-32bit |
| +pango-32bit |
| +gtk2-32bit |
| +cairo-32bit |
| +freetype2-32bit |
| +fontconfig-32bit |
| +libstdc++43-32bit |
| +xorg-x11-libX11-devel-32bit |
| +xorg-x11-libXrender-devel-32bit |
| +xorg-x11-libXext-devel-32bit |
| +libasound2-32bit |
| + |
| +### Symlinks |
| + |
| +``` |
| +#!/bin/bash |
| +cd /usr/lib |
| +for lib in gio-2.0 gdk-x11-2.0 atk-1.0 gdk_pixbuf-2.0 \ |
| + pangocairo-1.0 pango-1.0 pangoft2-1.0 \ |
| + gobject-2.0 gmodule-2.0 glib-2.0 gtk-x11-2.0; do |
| + ln -s -f lib$lib.so.0 lib$lib.so |
| +done |
| +ln -s -f libcairo.so.2 libcairo.so |
| +ln -s -f libfreetype.so.6 libfreetype.so |
| +ln -s -f libfontconfig.so.1 libfontconfig.so |
| +ln -s -f libstdc++.so.6 libstdc++.so |
| +ln -s -f libgthread-2.0.so.0.1800.2 libgthread-2.0.so |
| +ln -s -f libgconf-2.so.4.1.5 libgconf-2.so |
| +ln -s -f libasound.so.2 libasound.so |
| + |
| +ln -s -f /lib/libz.so.1 /lib/libz.so |
| +ln -s -f /lib/libgcc_s.so.1 /lib/libgcc_s.so |
| +``` |
| + |
| +### Useful commands |
| +To find libs you need, you can use locate, zypper and rpm, examples: |
| +``` |
| +$locate libgcc.a |
| +/usr/lib64/gcc/x86_64-suse-linux/4.3/libgcc.a |
| + |
| +$rpm -q -f /usr/lib64/gcc/x86_64-suse-linux/4.3/libgcc.a |
| +gcc43-4.3.3_20081022-9.8 |
| + |
| +$sudo zypper se gcc43 |
| +... |
| + | gcc43-32bit | The GNU C Compiler and Support Files | package |
| +... |
| + |
| +for more info use man |
| +``` |
| + |
| +## Compiling |
| +To compile using the Linux make build, set `GYP_DEFINES=target_arch=ia32` and then (re)build the Makefiles: |
| +``` |
| +gclient runhooks --force |
| +``` |
| +After that, you can use `make` to compile as described in the [Linux Build Instructions](http://code.google.com/p/chromium/wiki/LinuxBuildInstructions). |
| + |
| + |
| +### Ubuntu 32bit chroot on 64bit system |
| + |
| +The [build/install-build-deps.sh](http://src.chromium.org/svn/trunk/src/build/install-build-deps.sh) script installs all the 32bit compatibility libraries to build a 32bit binary on a 64bit Ubuntu system. But it is often easier and more reliable to develop in a real 32bit environment, instead of building against compatibility libraries. |
| + |
| +This can be done by setting up a 32bit chroot on a machine that is otherwise running a 64bit distribution. |
| + |
| +To do so, run the [build/install-chroot.sh](http://src.chromium.org/svn/trunk/src/build/install-chroot.sh) script. It asks you which environment to install. Pick any recent Ubuntu distribution (e.g. lucid) and select a 32bit installation. |
| + |
| +Optionally, change your chrome/src/out directory to be a symbolic link pointing to $HOME/chroot. This way, you can build both 32bit and 64bit versions from the same source tree. |
| + |
| +Now, install all build-prerequisites in the 32bit chroot: |
| + |
| +``` |
| + lucid32 build/install-build-deps.sh |
| +``` |
| + |
| +Reset your makefiles, if they are still configured for a 64bit build environment: |
| + |
| +``` |
| + lucid32 gclient runhooks |
| +``` |
| + |
| +And build Chromium using the development tools in the chroot environment: |
| + |
| +``` |
| + lucid32 make chrome |
| +``` |
| + |
| +Run the resulting binary as you would normally do: |
| + |
| +``` |
| + lucid32 out/Debug/chrome |
| +``` |
| + |
| +Before building a 64bit version in the same source tree, don't forget to reset your makefiles again |
| + |
| +``` |
| + gclient runhooks && make chrome |
| +``` |