[Qt-interest] Qt-interest Digest, Vol 16, Issue 236
Gordon Schumacher
whiplash at pobox.com
Sun Mar 28 18:16:08 CEST 2010
On 3/26/2010 3:35 AM, Yuvraj <yuvraj.ragupathi at indieontech.com> wrote:
> My device memory size is Max 15MB
> Among 15MB , i am loading boot loader,kernal and etc.
> Now my free space is 4MB.
You really should look at some options to reduce that initial footprint...
Some thoughts...
Make sure that CONFIG_EMBEDDED is set in your configuration, so that you
have additional control over the kernel's enabled features; turn off
anything you don't need. Also, make sure that
CONFIG_CC_OPTIMIZE_FOR_SIZE is set.
Disable as many kernel modules as you possibly can - if you're not going
to be hot-plugging hardware, build all your necessary drivers directly
into the kernel (and consider disabling module support entirely!)
If your kernel is stored in NAND flash, you should look at XIP
(http://en.wikipedia.org/wiki/Execute_in_place).
Then there's userspace... there are so many options here - particularly
depending on what processor you're using - that I hardly know where to
begin. Off the top of my head...
If you're using an ARM, consider using the "-mthumb" GCC switch
(http://gcc.gnu.org/onlinedocs/gcc-4.3.4/gcc/ARM-Options.html#ARM-Options)
- it produces somewhat slower but much smaller code. You should also
read about the -mthumb-interwork switch. There is also a
CONFIG_THUMB2_KERNEL option to enable this for the kernel.
The GCC switches that I had good luck with for reducing size are: "-Os
-fno-keep-static-consts -fmerge-all-constants -ffunction-sections
-fdata-sections", and linker flags "-Wl,-O1 -Wl,--sort-common
-Wl,--as-needed -Wl,--gc-sections". Gotchas here: Vim will not build
with -Os so you will need -O2 there. Do not build gcc or glibc with
"-Wl,--gc-sections", and do not use "-Wl,--as-needed" on Qt.
Lastly - I would suggest against mucking with the kernel compile
switches except as a last resort!
More information about the Qt-interest-old
mailing list