[ChromiumOS-Toolchain]: How to support Linaro toolchain?

239 views
Skip to first unread message

Pankaj

unread,
Mar 30, 2011, 2:08:42 AM3/30/11
to Chromium OS discuss
Dear All,

With reference to my previous post @

https://groups.google.com/d/topic/chromium-os-dev/Iebsj6ytW00/discussion

I would like to make some updates about my findings:

1: It seems currently ChromiumOS build system does not support for
installing other third-party toolchain (such as Linaro toolchain).
Because toolchain is tightly bound with ChromiumOS build system. While
setting up ChromiumOS environment using setup_board script it not only
setup board but also installs toolchain. Now by default it uses armv7-
cros-linux-gnueabi toolchain and uses following components:
a) binutils-2.19.1-r1
b) gcc-4.4.3-r4
c) linux-headers-2.6.30-r1
d) glibc-2.10.1-r2

For all these components, ebuilds are present into Chromiumos-overlay
and normally uses gentoo mirrors for downloading sources or prebuilt
binaries.

Now if someone wants to use some other toolchain, I mean some other
toolchain name such as armv5-linaro-cros-linux-gnueabi or some other
different than default one, setup_board script will fail saying no
such package or atom.
As while checking for dependencies for passed toolchain name
ChromiumOS build system downloads some file as "Packages" which
contains names of all available and supported package names along with
other details, so as our toolchain name is not there it wont allow to
install it and setup_board will fail there.

My suggestions to ChromiumOS engineers: We should keep installation of
toolchain separate from board setup or at least we should allow to
search dependencies of toolchain packages from Board-Overlay
"Packages" file.

2. But there is another way one can use there own tool-chain
components, we do not need to change name of toolchain package so let
it be armv7-cross-linux-gnueabi which is default one. The board setup
script setup_board provides a way to specify versions of binutild,
gcc, glibc and kernel headers in the form of argument passed to the
script. For ex: If we run like this
./setup_board --board=${BOARD} --nousepkg --binutils_version=2.19.1-r1
--gcc_version=4.4.3-r4
This way we can sepecify the required versions of each component.
Second step is to write/modify the ebuild for our own component.

3: Ebuild can be modified to use snapshots of source code, so that
build system will download the source code tar files from the SRC_URI
variable. In SRC_URI variable we can set path to our components.
Using RESTRICT keyword we can force build system to use our specified
paths for downloading tool-chain components.

Currently I am trying the same once I will get any success I will
update same here. .

I would like if anyone from ChroiumOS team or Linaro team has any
updates please post your comments here.

Thanks and Regards,
Pankaj





Steve McIntyre

unread,
Apr 28, 2011, 12:01:35 PM4/28/11
to Pankaj, Chromium OS discuss

Hi Pankaj,

Did you get anywhere on this third method? Ages back, I worked on an
ebuild for a different toolchain but didn't get very far. It would be
lovely if the ChromiumOS build system made it easier to use different
toolchains, but that has clearly not been a priority for their team.

Cheers,
--
Steve McIntyre
steve.m...@linaro.org

Message has been deleted

Pankaj

unread,
May 5, 2011, 12:21:31 AM5/5/11
to Chromium OS discuss
Hi Steve,

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
ChromiumOS.

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:
SRC_URI="ftp://${PATH_TO_SOURCE_TARBALL}/${P}.tar.bz2
RESTRICT="$RESTRICT mirror"

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
componenent.

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,
Pankaj Dubey
> steve.mcint...@linaro.org

Qingcheng Liu

unread,
Mar 13, 2019, 2:25:15 AM3/13/19
to Chromium OS Discussion, dubepan...@gmail.com
Hi @Pankaj,
      Is there way to to use Linaro toolchain for compiling chromium os the latest source tree ?
The method you mentioned above does not work now, setup_board.sh does not accept  -- 
gcc_version

Pankaj於 2011年5月5日星期四 UTC+8下午12時21分31秒寫道:
Reply all
Reply to author
Forward
0 new messages