The sizes that I mentioned (315KB vs 205KB) are for the final .dll and
.so size.  You might try linking your object files into a lib to see
how that affects size.   You could also try running the "strip"
command on the object files to ensure all the debugging symbols are
removed.

Any OMIT options you compile your application with must also be used
to compile the mkkeywordhash tool (used to generate keywordhash.h) and
passed to the lemon parser (used to generate parse.c).   They must
also be passed to gcc to compile sqlite3.c.

Note how the define for SQLITE_OMIT_LOAD_EXTENSION is used below:

gcc -o mkkeywordhash.exe -DSQLITE_OMIT_LOAD_EXTENSION=1  mkkeywordhash.c

./lemon.exe -DSQLITE_OMIT_LOAD_EXTENSION=1  parse.y

gcc -Os -DSQLITE_OS_WIN=1 -DNDEBUG -DSQLITE_OMIT_LOAD_EXTENSION=1  -c sqlite3.c


Another thing to check is that NDEBUG is defined.   SQLite makes
significant use of asserts for debugging and testing, and defining
NDEBUG will leave this code out.

HTH.
-Shane


2008/10/30 Pados Károly <[EMAIL PROTECTED]>:
>
> First a note: I removed -ffunction-sections from the compiler options, and it 
> is now better, but not good enough (365KB). It was an options the AVR IDE 
> defaulted to, that is why I not noticed it. OMIT_DISKIO is also NOT defined. 
> I am using SQLite version 3.6.4. OTHER_OS=1 and THREADSAFE=0.
>
> At first try, I just used the amalgamation from the site and put the 
> SQLITE_OMIT_* lines at the beginining of the source file. It was only after 
> then I noticed in the online docs that to correctly use the OMIT defines, I 
> have to start from full sources. So I got the tarball, used 
> Makefile.gcc-linux as a template to make my own makefile (I defined the OMIT 
> options), and issued a "make -f Makefile.gcc-avr sqlite3.c". (Although I have 
> no idea how the Tcl script would use defines from the makefile, I assume some 
> of the tools (lemon?) involved try to parse the make- and source files like a 
> very basic preprocessor, so it is possible.)
>
> Again, OMITs are prepended to sqlite3.c. I use the (atmel supplied) AVR32 gcc 
> compiler to compile with "-Os -fno-inline -Wall -c -fmessage-length=0 
> -mpart=uc3b1256es". These are all the gcc options in use, and now I get 
> 365KB. As an experiment, I also tried to compile with the x86 gcc 4.3.2 to 
> see the size it produces, with the same options I got 315KB. Definitely 
> better but still far too large. So, on one hand the AVR32 compiler is not 
> that good for producing small code, but I am also missing something 
> important, because the x86 object file is also much larger than the size you 
> mentioned (315KB vs 205KB). Not to mention that 315KB is without optional 
> features, the 205KB you mentioned is with them.
>
> These are the exact actions I took. Any help is appretiated. Thanks,
> Károly
>
>> Date: Wed, 29 Oct 2008 21:50:37 -0400
>> From: [EMAIL PROTECTED]
>> To: sqlite-users@sqlite.org
>> Subject: Re: [sqlite] Making the binary small
>>
>> Are you compiling the SQLite shell utility, or just the library?   The
>> Windows and Linux versions of the lib available from the download page
>> which are compiled with all the optional features are 235kb and 205kb
>> respectively.   It's surprising that the compiled version for AVR32 is
>> more than twice as large with all the optional features compiled out.
>>   Can you provide anymore information on how you are compiling it?
>> Which version are you compiling?   Are you using the amalgamation?
>> Are you compiling without debugging information?
>>
>> -Shane
>>
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
> _________________________________________________________________
> Connect to the next generation of MSN Messenger
> http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=wlmailtagline
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to