Chromium Code Reviews| OLD | NEW | 
|---|---|
| (Empty) | |
| 1 _If you're looking for building a 64 bit Chromium, try LinuxChromium64_ | |
| 2 | |
| 3 _OBSOLETE: Building 32-bit Chromium on 64-bit Linux is no longer officially supp orted. The "32-bit compatibility libs" instructions probably won't work. The chr oot 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
 
 | |
| 4 | |
| 5 ## Introduction | |
| 6 On at least Ubuntu Hardy, there is poor support for building 32-bit software. I t 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. | |
| 7 | |
| 8 Even a successful build will likely have issues: see Linux64BitIssues. | |
| 9 | |
| 10 ## What are the Prerequisites | |
| 11 LinuxBuildInstructionsPrerequisites has an up-to-date list of prerequisite packa ges needed for building chrome, as well as instructions for automatically instal ling the prerequisites. | |
| 12 | |
| 13 The script on that page is based on a [script on the Ubuntu forums](http://ubun tuforums.org/showthread.php?t=474790) that helps automate installing 32-bit libs on a 64-bit system. | |
| 14 | |
| 15 ## Manual Setup on Ubuntu/Debian | |
| 16 1. Go to [LinuxBuildInstructionsPrerequisites#Automated\_Setup](LinuxBuildInst ructionsPrerequisites#Automated_Setup.md). | |
| 17 1. Manually run that script. | |
| 18 | |
| 19 ## Manual Setup on openSUSE | |
| 20 (Tested on openSUSE 11.1 x86\_64) | |
| 21 This can be incomplete list. | |
| 22 | |
| 23 ### Packages | |
| 24 gcc-32bit | |
| 25 glibc-devel-32bit | |
| 26 libgio-2\_0-0-32bit | |
| 27 gtk2-32bit | |
| 28 libatk-1\_0-0-32bit | |
| 29 gtk2-32bit | |
| 30 pango-32bit | |
| 31 pango-32bit | |
| 32 pango-32bit | |
| 33 gtk2-32bit | |
| 34 cairo-32bit | |
| 35 freetype2-32bit | |
| 36 fontconfig-32bit | |
| 37 libstdc++43-32bit | |
| 38 xorg-x11-libX11-devel-32bit | |
| 39 xorg-x11-libXrender-devel-32bit | |
| 40 xorg-x11-libXext-devel-32bit | |
| 41 libasound2-32bit | |
| 42 | |
| 43 ### Symlinks | |
| 44 | |
| 45 ``` | |
| 46 #!/bin/bash | |
| 47 cd /usr/lib | |
| 48 for lib in gio-2.0 gdk-x11-2.0 atk-1.0 gdk_pixbuf-2.0 \ | |
| 49 pangocairo-1.0 pango-1.0 pangoft2-1.0 \ | |
| 50 gobject-2.0 gmodule-2.0 glib-2.0 gtk-x11-2.0; do | |
| 51 ln -s -f lib$lib.so.0 lib$lib.so | |
| 52 done | |
| 53 ln -s -f libcairo.so.2 libcairo.so | |
| 54 ln -s -f libfreetype.so.6 libfreetype.so | |
| 55 ln -s -f libfontconfig.so.1 libfontconfig.so | |
| 56 ln -s -f libstdc++.so.6 libstdc++.so | |
| 57 ln -s -f libgthread-2.0.so.0.1800.2 libgthread-2.0.so | |
| 58 ln -s -f libgconf-2.so.4.1.5 libgconf-2.so | |
| 59 ln -s -f libasound.so.2 libasound.so | |
| 60 | |
| 61 ln -s -f /lib/libz.so.1 /lib/libz.so | |
| 62 ln -s -f /lib/libgcc_s.so.1 /lib/libgcc_s.so | |
| 63 ``` | |
| 64 | |
| 65 ### Useful commands | |
| 66 To find libs you need, you can use locate, zypper and rpm, examples: | |
| 67 ``` | |
| 68 $locate libgcc.a | |
| 69 /usr/lib64/gcc/x86_64-suse-linux/4.3/libgcc.a | |
| 70 | |
| 71 $rpm -q -f /usr/lib64/gcc/x86_64-suse-linux/4.3/libgcc.a | |
| 72 gcc43-4.3.3_20081022-9.8 | |
| 73 | |
| 74 $sudo zypper se gcc43 | |
| 75 ... | |
| 76 | gcc43-32bit | The GNU C Compiler and Support Files | packag e | |
| 77 ... | |
| 78 | |
| 79 for more info use man | |
| 80 ``` | |
| 81 | |
| 82 ## Compiling | |
| 83 To compile using the Linux make build, set `GYP_DEFINES=target_arch=ia32` and th en (re)build the Makefiles: | |
| 84 ``` | |
| 85 gclient runhooks --force | |
| 86 ``` | |
| 87 After that, you can use `make` to compile as described in the [Linux Build Instr uctions](http://code.google.com/p/chromium/wiki/LinuxBuildInstructions). | |
| 88 | |
| 89 | |
| 90 ### Ubuntu 32bit chroot on 64bit system | |
| 91 | |
| 92 The [build/install-build-deps.sh](http://src.chromium.org/svn/trunk/src/build/in stall-build-deps.sh) script installs all the 32bit compatibility libraries to bu ild a 32bit binary on a 64bit Ubuntu system. But it is often easier and more rel iable to develop in a real 32bit environment, instead of building against compat ibility libraries. | |
| 93 | |
| 94 This can be done by setting up a 32bit chroot on a machine that is otherwise run ning a 64bit distribution. | |
| 95 | |
| 96 To do so, run the [build/install-chroot.sh](http://src.chromium.org/svn/trunk/sr c/build/install-chroot.sh) script. It asks you which environment to install. Pic k any recent Ubuntu distribution (e.g. lucid) and select a 32bit installation. | |
| 97 | |
| 98 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. | |
| 99 | |
| 100 Now, install all build-prerequisites in the 32bit chroot: | |
| 101 | |
| 102 ``` | |
| 103 lucid32 build/install-build-deps.sh | |
| 104 ``` | |
| 105 | |
| 106 Reset your makefiles, if they are still configured for a 64bit build environment : | |
| 107 | |
| 108 ``` | |
| 109 lucid32 gclient runhooks | |
| 110 ``` | |
| 111 | |
| 112 And build Chromium using the development tools in the chroot environment: | |
| 113 | |
| 114 ``` | |
| 115 lucid32 make chrome | |
| 116 ``` | |
| 117 | |
| 118 Run the resulting binary as you would normally do: | |
| 119 | |
| 120 ``` | |
| 121 lucid32 out/Debug/chrome | |
| 122 ``` | |
| 123 | |
| 124 Before building a 64bit version in the same source tree, don't forget to reset y our makefiles again | |
| 125 | |
| 126 ``` | |
| 127 gclient runhooks && make chrome | |
| 128 ``` | |
| OLD | NEW |