Linaro Blog

Linaro Android gets ready for gcc 4.7

With the first release candidate of gcc 4.7 out, we’ve decided to get Linaro Android ready for the new compiler.

Overall, adding support for the new compiler went smoothly – in the process, we fixed 2 compiler bugs, and adapted the Android codebase to gcc 4.7′s stricter checking. In particular the C++ declaration order changes took a bit of effort.

Other than that, gcc was mainly screaming at code that should never have been valid, like this extreme fondness of variable name recycling uncovered in stagefright’s Matroska decoder:

for(size_t i=0; ...) {
    ...
    int32_t i = 0;
    ...
    while(i<20) {
        for(int i=0; ...) {
            ...

Currently, the gcc 4.7 based toolchain is available on android-build. 2 builds already using it — Pandaboard and iMX6 — are also available, and seem to work as expected.

Builds for additional boards will follow shortly.

Related posts:

About Bernhard Rosenkränzer

Bernhard started developing software back when he saw his first computer - an Atari ST back in 1985. He has been involved in Linux and Open Source since 1993 - previous employers include MandrakeSoft (now Mandriva) and Red Hat, and various startups.
This entry was posted in Android, Community, Linaro, Patch-Highlights. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>