PSA: Try out gcc-4.6.0

12 views
Skip to first unread message

Ahmad Sharif

unread,
Jul 7, 2011, 8:49:55 PM7/7/11
to Chromium OS dev
You can now try out a new cross-compiler for your packages that is gcc-4.6.0-based. This compiler will be the default cross compiler for ChromiumOS soon.

To switch to 4.6.0 (after installing it if it's not there):

For x86-based boards:

(cr_chroot) export ctarget=i686-pc-linux-gnu; ~/trunk/src/platform/dev/cros_gcc_config $ctarget-4.6.0; source /etc/profile; $ctarget-gcc -v

For arm-based boards:

(cr_chroot) export ctarget=armv7a-cros-linux-gnueabi; ~/trunk/src/platform/dev/cros_gcc_config $ctarget-4.6.0; source /etc/profile; $ctarget-gcc -v

NOTE: Installing it may take a while if it's not already installed.

What this does is: save the current binutils-config, switch to ld instead of gold, unmask gcc 4.6.0, install it side-by-side with the current 4.4.3 based compiler, install gcc libs to all relevant boards, switch binutils to the old config, source /etc/profile and print the cross compiler version. If all goes well, you should see "gcc version 4.6.x-google" after the final step. Most of the complexity is hidden in the cros_gcc_config script.

To switch back to 4.4.3:

For x86-based boards:

(cr_chroot) export ctarget=i686-pc-linux-gnu; ~/trunk/src/platform/dev/cros_gcc_config $ctarget-4.4.3; source /etc/profile; $ctarget-gcc -v

For arm-based boards:

(cr_chroot) export ctarget=armv7a-cros-linux-gnueabi; ~/trunk/src/platform/dev/cros_gcc_config $ctarget-4.4.3; source /etc/profile; $ctarget-gcc -v

To list available gccs:

For x86-based boards:

(cr_chroot) export ctarget=i686-pc-linux-gnu; ~/trunk/src/platform/dev/cros_gcc_config -l | grep $ctarget

For arm-based boards:

(cr_chroot) export ctarget=armv7a-cros-linux-gnueabi; ~/trunk/src/platform/dev/cros_gcc_config -l | grep $ctarget

To enjoy gcc-4.6.0:

Switch to gcc-4.6.0, try to compile your favorite package and fix any warnings/errors you see when building it.

Further details are on this page:


under the heading "Switching Toolchain Compilers"

For questions or comments, reply to this email thread or email asharif@.

Sonny Rao

unread,
Jul 8, 2011, 6:10:20 PM7/8/11
to Ahmad Sharif, Chromium OS dev
Question: if I run the command you have to switch to gcc-4.6.0 then
run ./setup_board will that board be built completely with gcc-4.6 or
will it revert to 4.4.3?

From what I saw when I tried it, it seems like it used 4.4.3, but
that's not what I wanted or was expecting

Sonny

> --
> Chromium OS Developers mailing list: chromiu...@chromium.org
> View archives, change email options, or unsubscribe:
> http://groups.google.com/a/chromium.org/group/chromium-os-dev?hl=en
>

Sonny Rao

unread,
Jul 8, 2011, 6:30:40 PM7/8/11
to Ahmad Sharif, Chromium OS dev
Looks like setup_board has it's own toolchain defaults hardcoded
But one can specify --gcc to setup_board and retain gcc 4.6.0
I'm not sure if the pre-built glibc that was merged was compiled with
gcc 4.6.0 or not, I guess I have to use --nousepkg to make sure I get
a glibc built with 4.6.0 ?

The other thing I noticed when doing setup_board with the defaults is
that it uninstalled gcc 4.6.0
which was rather annoying because I had to go fetch the source and
rebuild it again

Sonny

asharif

unread,
Jul 8, 2011, 6:43:17 PM7/8/11
to Sonny Rao, Chromium OS dev
On Fri, Jul 8, 2011 at 3:30 PM, Sonny Rao <sonn...@chromium.org> wrote:
Looks like setup_board has it's own toolchain defaults hardcoded

Right.
 
But one can specify --gcc to setup_board and retain gcc 4.6.0

You can specify --gcc_version=4.6.0 --nousepkg to retain 4.6.0.
 
I'm not sure if the pre-built glibc that was merged was compiled with
gcc 4.6.0 or not, I guess I have to use --nousepkg to make sure I get
a glibc built with 4.6.0 ?

The other thing I noticed when doing setup_board with the defaults is
that it uninstalled gcc 4.6.0
which was rather annoying because I had to go fetch the source and
rebuild it again

Sorry about that. I plan to make the installation faster by using a seed tarball sometime soon.

Also, note that when running ./build_packages, you should probably pass in --skip_toolchain_update to make sure it doesn't try to update the toolchain. I will add that to the documentation.
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages