Recommended optimizations for GCCE
From Forum Nokia Wiki
Reducing the size of your GCCE executables
You may find that executables compiled with GCCE for S60 3rd Edition are significantly larger when compiled with a GCCE and an S60 3rd Edition SDK than the corresponding S60 2nd Edition version, even though S60 3rd Edition binaries are compressed by default.
According to the release notes for the S60 3rd Edition SDK Maintenance Release the recommended possible optimizations for reducing the size of a 3rd Edition executable are -O2 -fno-unit-at-a-time. However, this is not the default after installation of the SDK. The easiest way to enable these for a particular project is to add the following line to the MMP file:
OPTION GCCE -O2 -fno-unit-at-a-time
This is probably no longer necessary if you are using the S60 3rd Edition FP1 SDK, because it already includes the line
REL_OPTIMISATION=-O2 -fno-unit-at-a-time
in the gcce.mk file, making the above settings the default.
| "Danger, Will Robinson!" |
|---|
|
Why this is needed
It seems that there is a single culprit that is alone responsible for the majority of the size increase: the AknsConstants.h file declares a host of "static const" structures for skin-related IDs that make it into the final binary, even though they are never referenced. These constants are included once for each .cpp file that uses "popular" header files such as <aknutils.h> or <aknmessagequerydialog.h>, leading to about 20k of excess data per file.
With the optimization options set as above, GCCE recognizes these as being "dead data", and removes them from the final executable.
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem with compile AutoFocus API | bulllogo | Symbian Media (Graphics & Sounds) | 0 | 2007-06-26 07:40 |
| S603rd MR - Registration example does not build | zdenko | General Symbian C++ | 0 | 2006-11-23 10:21 |
| Series 60 Platform SDK's for Symbian OS, for Java | prasid | Mobile Java Tools & SDKs | 2 | 2006-03-06 18:49 |
| sdk3.0 with vb.net | gerald1002 | Symbian Tools & SDKs | 1 | 2004-01-29 04:53 |
| Carbide - error at linking time | lucafr | Carbide.c++ and CodeWarrior Tools | 8 | 2008-09-25 14:22 |
