Compiling Qt for Symbian using GCCE 4

updated for 4.6.2 release

This is experimental and has a lot of known issues,
but you can run QtGui, QtCore and QtNetwork built with GCCE4 on device which is sufficient for basic development.

Steps have beeen tested with Nokia N97 SDK and 5800 Express Music HW.
You will need to do additional steps if using older SDKs.

Howto:

Get the latest GCCE compiler for Symbian: Sourcery G++ Lite 2009q3-63 4.4.1
Download from http://www.codesourcery.com/sgpp/lite/arm/portal/release1038
Install and add the bin directory to be the first in path

Check the guide on how to use GCC4 on Symbian
http://wiki.forum.nokia.com/index.php/How_to_use_GCCE_4_with_Symbian_SDKs
For N97 SDK you only need the va_list correction:

—-patch va_list—–
+++ \epoc32\include\gcce\gcce.h
@@ -90,25 +90,25 @@

#ifdef __cplusplus

 namespace std {
     extern "C" {  

#endif / __cplusplus /

-typedef struct va_list { void *ap; } va_list;

+//typedef struct va_list { void *ap; } va_list;
+#include <stdarg.h>

#ifdef __cplusplus

}  /* extern "C" */
 }  /* namespace std */  

 using ::std::va_list;  

#endif

–#define va_start(ap, parmN) builtin_va_start(ap.ap, parmN)
–#define va_arg(ap, type) builtin_va_arg(ap.ap, type)
–#define va_end(ap) builtin_va_end(ap.ap)
+//#define va_start(ap, parmN) builtin_va_start(ap.ap, parmN)
+//#define va_arg(ap, type) builtin_va_arg(ap.ap, type)
+//#define va_end(ap) builtin_va_end(ap.ap)

#define VA_LIST va_list
#define _VA_LIST_DEFINED //To deal with stdarg.h
#define __VA_LIST_defined //To deal with e32def.h

@@ -117,13 +117,13 @@
#define VA_ARG(ap,type) va_arg(ap,type)
#define VA_END(ap) va_end(ap)
// This should prevent /stdlib/linc/stdarg.h from doing damage.
#define _STDARG_H

// now deal with stdarg_e.h
-typedef va_list e32_va_list;
+//typedef va_list
e32_va_list;
#define _STDARG_E_H

// This is an EABI compliant compiler
#ifndef EABI
#define EABI
#endif
—-patch va_list—–

Known issues other than mentioned above

  • GCCE cannot handle long paths. To workaround this limitation you can build each component from their own directory.
    E.g. to build corelib first change directory into src/corelib and then run make debug-gcce
  • QtWebkit assumes atomicity.h to be in GCC:ext/atomicity.h when building with GCCE. This is not the case for GCCE. Can be worked around.
    Related bug report: http://bugreports.qt.nokia.com/browse/QTBUG-5239
  • QtWebkit wchar_t issue, failing to call _construct in _string.h. needs more investigation.
  • GCCE produces huge binaries compared to RVCT. This might lead to loading of binaries failing on low memory devices or installation issues due to disk usage of larger binaries.
    To make smaller binaries you can pass -0s to compiler telling it to prefer smaller size over speed.