Advanced Search
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
May 22, 2012, 03:54:03 AM
Home
Help
Calendar
Login
Register
News
: Welcome to GLomation peer support forum
Glomation
»
Peer Support Forums
»
GESBC-9260
»
How to reduce the size of C programs?
« previous
next »
Pages: [
1
]
Topic Tools
Topic Tools
Send this topic
Print
September 27, 2010, 02:23:28 AM
#0
Mario Frara
Mario Frara
Show Mario Frara's last posts.
Show general stats for Mario Frara.
Super Hero
Posts: 6
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
September 27, 2010, 02:40:21 PM
#1
admin
admin
Show admin's last posts.
Show general stats for admin.
Administrator
Super Hero
Posts: 342
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.
September 28, 2010, 01:48:15 AM
#2
Mario Frara
Mario Frara
Show Mario Frara's last posts.
Show general stats for Mario Frara.
Super Hero
Posts: 6
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
September 28, 2010, 01:29:44 PM
#3
admin
admin
Show admin's last posts.
Show general stats for admin.
Administrator
Super Hero
Posts: 342
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.
October 01, 2010, 10:42:14 AM
#4
Mario Frara
Mario Frara
Show Mario Frara's last posts.
Show general stats for Mario Frara.
Super Hero
Posts: 6
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
]
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> Announcements
=> General Discussion
=> Programming Tips, Recommendded Readings, etc.
-----------------------------
Peer Support Forums
-----------------------------
=> GESBC-9302
=> GESBC-9260
=> GESBC-9G20
=> GESBC-2440
=> GESBC-9315
Loading...