Glomation
 
Advanced Search
Welcome, Guest. Please login or register.

Login with username, password and session length
May 22, 2012, 03:54:03 AM
News: Welcome to GLomation peer support forum
Pages: [1]
Topic Tools  
Read September 27, 2010, 02:23:28 AM #0
Mario Frara

How to reduce the size of C programs?

Hi to everybody.
I am using a Board 9260s with software kernel 2.6.30.
The FileSystem is compiled with  buildroot 2010.08   
I need to run C programs on this board.
I am using the compiler on linux server debian etch, downloaded from the support Glomation:
ARM cross development tool chain Generic-arm_gcc 4.2.3-glibc-2.3.3.tar.bz2 

The GCC compiler is arm-unknown-linux-gnu-gcc .
Now, only with “-static” parameter, everything work well, but it returns a file of about 480Kb even if the source is a few lines!
I am asking You how can I reduce the size of the compiled file?
What parameters and options can I  use to reduce the file size?

Thanks in advance for any your useful replay.
FYI
Mario
 
Read September 27, 2010, 02:40:21 PM #1
admin

Re: How to reduce the size of C programs?

When linked with static option all library code are linked in your program.  Try without static.
 
Read September 28, 2010, 01:48:15 AM #2
Mario Frara

Re: How to reduce the size of C programs?

Yes, I know this. Like I wote you in the second part of my message, with “-static” parameter, everything work well, (except for the size of the program), but without "-static" parameter it doesn't work at all!
Thanks for the replay

Mario
 
Read September 28, 2010, 01:29:44 PM #3
admin

Re: How to reduce the size of C programs?

The possible cause of the program not able to run are incompatible library.  You can build your own file system with the library you wanted or change the cross compiler library to match the existing library in the factory installed file system.  Also make sure to compile your program using ABI (not EABI) if you want to use the factory installed file system.
 
Read October 01, 2010, 10:42:14 AM #4
Mario Frara

Re: How to reduce the size of C programs?

Hi!
I recompiled with Abi-Oabi.
I tried with the option “preferred static library" but it doesn’t work!.
Perhaps the compilers and/or libraries are not compatible.
I would like to try with a previous compiler 4.2.4 (the default was the 4.3.x).
When I tried I'll let you know if it works or not.
Meanwhile, thanks for your support!
FYI
Mario
 
Pages: [1]
Jump to:  

Theme Update by Runic Warrior Originally created by m3talc0re