Linux executable size big ?

Linux specific forum
USCode
Addict
Addict
Posts: 923
Joined: Wed Mar 24, 2004 11:04 pm
Location: Seattle

Linux executable size big ?

Post by USCode »

:?: Anyone know why executables created by PB are so big on Linux as compared to the ones generated on Windows?

One of my applications on Windows is 17KB, but is 890KB when compiled on Linux!

Anything I can do to reduce that? Maybe some library is being linked in and I can pass a flag to prevent that?
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

I will check but it was even smaller than windows exe here..
USCode
Addict
Addict
Posts: 923
Joined: Wed Mar 24, 2004 11:04 pm
Location: Seattle

More info.

Post by USCode »

Thanks Fred!
I'm on SuSE 9.0 and compiled the program with PB 3.81, using this syntax:

./pbcompiler MyProgram.pb -e MyProgram

One strange thing I noticed is that in addition to creating huge executables, it also creates a 'purebasic.exe' executable when I compile my normal Linux executable??? So at that time I have 2 executables. If I rename the 'purebasic.exe' file to a normal Linux executable name, then I can run it! This file has the exact same bytesize as my Linux executable.

I also got this warning in trying to compile an app:
/usr/lib/gcc-lib/i586-suse-linux/3.3.1/../../../../i586-suse-linux/bin/ld: Warning: alignment 1 of symbol `PB_StringBase' in purebasic.o is smaller than 4 in Network.a(Network.o)


I must be doing something wrong! Some setting wrong?
Snooze
New User
New User
Posts: 7
Joined: Wed Aug 27, 2003 10:28 am
Location: Belgium

Post by Snooze »

I've got the same problem... :?:
May the Sound be with You !
USCode
Addict
Addict
Posts: 923
Joined: Wed Mar 24, 2004 11:04 pm
Location: Seattle

Size

Post by USCode »

:?: Fred, were you able to figure out the Linux executable size issue?
Thanks!
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

Any Answer?
User avatar
GeoTrail
Addict
Addict
Posts: 2794
Joined: Fri Feb 13, 2004 12:45 am
Location: Bergen, Norway
Contact:

Post by GeoTrail »

When I compile on Mandrake 10.1 the filesize is about the same as on Windows.
I Stepped On A Cornflake!!! Now I'm A Cereal Killer!
olejr
Enthusiast
Enthusiast
Posts: 152
Joined: Sun Jul 11, 2004 7:48 pm
Location: Lillehammer, No(r)way
Contact:

Post by olejr »

I also did a test compile on Windows & Linux,
and the filesize was: Linux: 10740bytes Windows: 7168bytes..

As of the problem with two executables I don't have that..

BTW: MandrakeLinux 10.0 & Windows XP Pro. PB v3.91
User avatar
GeoTrail
Addict
Addict
Posts: 2794
Joined: Fri Feb 13, 2004 12:45 am
Location: Bergen, Norway
Contact:

Post by GeoTrail »

olejr, could you post the code you compiled here so I can test it in Mandrake 10.1?
I Stepped On A Cornflake!!! Now I'm A Cereal Killer!
olejr
Enthusiast
Enthusiast
Posts: 152
Joined: Sun Jul 11, 2004 7:48 pm
Location: Lillehammer, No(r)way
Contact:

Post by olejr »

GeoTrail wrote:olejr, could you post the code you compiled here so I can test it in Mandrake 10.1?
It's a "project" I'm working on.. 9 source files....
User avatar
GeoTrail
Addict
Addict
Posts: 2794
Joined: Fri Feb 13, 2004 12:45 am
Location: Bergen, Norway
Contact:

Post by GeoTrail »

OK, I'll compile one of the PB samples then :)
I Stepped On A Cornflake!!! Now I'm A Cereal Killer!
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

on coLinux, it is about 2x the windows size.
Post Reply