[xml] Libxml2 port to Symbian OS using the Posix layer

Hi All,

We have ported libxml2 to Symbian OS / Nokia's S60 platform using the Symbian Posix layer (called Open C by 

Enclosed you can find the .diff files for the changes as well as binaries for S60 3rd edition feature pack 1. 

We got the port working quite nicely, but a problem we were not able to fix is compilation with GCCE (free) 
compiler. It apparently fails to compile a part of the source, which RVCT (commercial) compiler compiles 
fine. Enclosed is working binary compiled with RVCT.

The issue with GCCE is quite problematic and should be studied for a possible fix. Maybe someone reading the 
list and more familiar with the original source can help? The "feature not supported" error message is caused 
by the following section of code in file hash.h (the code does not compile at all with the official fix, 
which has been commented out):

 * Recent version of gcc produce a warning when a function pointer is assigned
 * to an object pointer, or vice versa.  The following macro is a dirty hack
 * to allow suppression of the warning.  If your architecture has function
 * pointers which are a different size than a void pointer, there may be some
 * serious trouble within the library.
 * @fptr:  pointer to a function
 * Macro to do a casting from an object pointer to a
 * function pointer without encountering a warning from
 * gcc
 * #define XML_CAST_FPTR(fptr) (*(void **)(&fptr))
 * This macro violated ISO C aliasing rules (gcc4 on s390 broke)
 * so it is disabled now
#define XML_CAST_FPTR(fptr) (*(void **)(&fptr))
//#define XML_CAST_FPTR(fptr) fptr

This is obviously a problem with GCCE although might be related to Open C as well. There are known to be 
other similar problems with some other components.

It might be possible to fix this problem by either rewriting the problematic part of function pointer usage 
or to see if changing some GCCE settings could be the solution. On the other hand, if the problem actually is 
in the current version of Open C, there is not much that could be done except for writing native Symbian code 
to bypass the error.

Anyway, we hope that our contribution helps others working with getting libxml2 to work in Symbian, and maybe 
it is possble to get the changes we made also into the main code line.


        Tuukka Turunen
        Director, Special Projects
        Telecom Division
        Sepänkatu 20, FIN-90100 Oulu, Finland


Attachment: symbian_port_diff.zip
Description: symbian_port_diff.zip

Attachment: Libxml2_FP1.SIS
Description: Libxml2_FP1.SIS

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]