Linaro Android gets ready for gcc 4.7

Home / Linaro Blog / Android / 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.

Recent Posts