Using GCCE 4 with Symbian SDKs

The stock S60 SDKs are not perfect, and you may come across situations where you want to modify them. You might apply the GnuPoc patches to allow an SDK to be used on Linux, for instance, or modify the header files to avoid some warnings.

SDK patching becomes particularly important when trying to use an unsupported compiler with one of the SDKs. To my knowledge GNU Compiler Collection for Embedded (GCCE) release 2005q1 (corresponding to GCC version 3.4.3) has been the default compiler on all the publicly released S60 3rd Edition and later SDKs from Nokia. The Symbian3 SDK apparently also ships with the Symbian-specific GCCE release 4.4-172 (based on GCC version 4.4.1), but even that SDK/compiler combination appears somewhat incompatible, resulting in numerous compilation warnings in actual use.

Some of the warnings resulting from using GCCE 4 with Symbian SDKs are relatively harmless, although not in the sense that it becomes harder to spot actual problems in your code when there are numerous warnings due to system headers already. And certain warnings, such as those concerning breakage of strict aliasing are considerably more worrisome.

I've patched some of the SDKs to reduce the number of warnings when using GCCE version 4, while also still retaining support for GCCE version 3. The patches are hackish, and some of them might be unsafe. They might also fail to apply cleanly to a stock SDK, as they assume that the GnuPoc patches have been applied first.

Configuration

In addition to requiring PATH and EPOCROOT environment variables to have been set correctly as usual, these patches also require additional variables to be set to specify which GCCE is being used. These variables are EPOCGCC and EPOCGCCVER, and they are really just a patching convenience. The compiler toolkit binaries must still be on the PATH, and hence the same information could be resolved on demand by scripts, say EPOCGCCVER would be given by arm-none-symbianelf-gcc -dumpversion. Still, the required variables are easy enough to set, e.g. by using shell functions such as

use_gcce3() { export EPOCGCC=$HOME/gcce-2005q1 EPOCGCCVER=3.4.3; }
use_gcce4() { export EPOCGCC=$HOME/gcce-2010q1 EPOCGCCVER=4.4.1; }

Patches for Symbian3 1.0 SDK

At the time of writing, at least SMS Exporter is known to compile with these patches (and with hardly any warnings) using the fairly recent GCCE release 2011.09 (or GCC version 4.6.1), with or without the -std=c++0x option.

Patches for S60 5th Edition SDK

There is also a small, older collection of patches, for the S60 5th Edition SDK.

Related Links