Yes, using third method I am able to install Linaro toolchain (Linaro-
GCC-4.5-2011.03-0) within ChromiumOS using their default scripts
(setup_board.sh). Here are my findings for using Linaro toolchain in
1: Need to change default profile of ChromiumOS from "Hardened" to
"Non-hardened": As by default ChromiumOS uses "hardened toolchain" for
which while installing toolchain using setup_board script it applies
PIE(Position Independent Executable) and SPECs patches on top of GCC.
After discussion with Michael Hope from Linaro, I came to know that
Linaro does not releases PIE and SPEC patches for Linaro GCC, so I
tried to use Gentoo provided patches of PIE and SPECS but found that
building of Linaro GCC failed due to failure in applying patches. So
for the time being I have modified default profile of ChromiumOS from
"Hardened" to "Non-hardened" so that while installing toolchain it
will not try to apply PIE and SPECS patches.
2: Need to add/modify GCC ebuilds: Since ChromiumOS tries to get
source from Gentoo or ChromiumOS mirrors we need to modify the
corresponding ebuild's of GCC. What I did is, obtained an ebuild for
GCC-4.5 version from Gentoo website (http://gentoo-portage.com/
modified it so that GCC source code can be downloaded from local
server (one of my local machine). Modification in ebuild requires are
add SRC_URI variable and set the complete path of tarball of GCC
source code. Append "mirror" to RESTRICT variable, as shown below:
Note: I found one issue in using Linaro released GCC source tarballs.
As Linaro releases GCC source as gcc-linaro-4.5-2011.03-0.tar.bz2
which upon untarred gives a directory as gcc-linaro-4.5-2011.03-0, but
as ChromiumOS uses Gentoo portage build system which requires all
packages (which comes in tarballs) should be present in directory have
name as "PackageName-Version" in this case "gcc-4.5.3 or gcc-4.4.3".
So we need to download Linaro GCC tarball untar it rename folder name
as gcc-4.5.3 and then again create tarball.
3: Need to add/modify dependent packages ebuild: Since ChromiumOS be
default using Gentoo's 4.4.3 based toolchain which has different
dependencies than 4.5 based GCC, so we need to modify/add ebuilds for
those dependent packages. I have added ebuild of MPFR, GMP and MPC all
obtained from Gentoo.
4: Run setup_board script giving argument for gcc as "--
gcc_version=4.5.3". This will install toolchain with Linaro GCC
5: Using this toolchain when I tried to build ChromiumOS packages (run
build_packages script), I found out of 399 odd packages some 11-12
packages failed in compilation steps complaining one or other reason.
Note: All these packages got compiled well if used default toolchain.
On further investigation I found that most of failed packages failed
as GCC-4.5 is checking strict typechecking. So as these are problems
in those respective packages and need to be fixed by their maintainers
for the time being I did a workaround and modified compiler flags
(such as removing -Werror or -Wall flags) and got compiled all the
packages. Upon successful compilation of all packages created
ChromiumOS, created image of it and tested on Samsung board and after
few attempt got success in bringing up ChromiumOS compiled with Linaro
toolchain on Samsung board.
Thanks and Regards,