Pedro Alves wrote: > I've built a cc1.exe with the attached patch applied, and I now get the > same alignments as the OP reported MSVC choses. I'm doing a full > gcc build now. > > The patch also forces 64-bit alignment on doubles, but I haven't > tested it yet - bonus points if someone tests it and compares it to > MSVC. > > Cheers, > Pedro Alves > > > Index: gcc/gcc/config/arm/wince-pe.h > =================================================================== > --- gcc/gcc/config/arm/wince-pe.h (revision 838) > +++ gcc/gcc/config/arm/wince-pe.h (working copy) > @@ -229,6 +229,13 @@ > #undef DEFAULT_STRUCTURE_SIZE_BOUNDARY > #define DEFAULT_STRUCTURE_SIZE_BOUNDARY 8 > > +/* Force alignment of doubles to 64-bit. */ > +#undef ARM_DOUBLEWORD_ALIGN > +#define ARM_DOUBLEWORD_ALIGN 1 > + > +#undef BIGGEST_ALIGNMENT > +#define BIGGEST_ALIGNMENT 64 > + > #undef TREE > > #ifndef BUFSIZ
Compiling SQLite 3.5.x (CVS version as of 2007-11-13) using CeGCC (SVN rev 1064) worked OOTB. However running the resulting SQLite 3 shell (sqlite3.exe) on a WM 5 device with PXA 270 CPU gave strange results when selecting the sqlite_master schema until I reverted the above patch. IMO the problem is related to 64 bit alignment of vararg parameters on stack. SQLite heavily uses long long internally for all integral computations and sqlite3_snprintf() (similar to C library's snprintf()) with format %lld gives wrong results. It seems to me that the argument for %lld was shifted towards a higher memory address by 4 bytes, thus I reverted the patch, and then it worked. The strange thing is: on a PXA 255 Windows Mobile 2003 device I did not observe any sqlite3_snprintf() problems regardless of the expansion of the ARM_DOUBLEWORD_ALIGN macro. Any thoughts ? Best regards, Christian ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Cegcc-devel mailing list Cegcc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/cegcc-devel