Page 2 of 2

Re: Larger size with Mingw

Posted: Sat Dec 05, 2009 12:02 pm
by sudip
Hello Master Roberto,
Thanks a lot for your reply and for strip.rar. It works fine :)
I'll include it and do by default from the next test release.
Thanks a lot again :)
With best regards.
Sudip

Re: Larger size with Mingw

Posted: Sat Dec 05, 2009 3:28 pm
by ClaudioGalera
It's amazing !!!! :o

File Exe original = 5.423.293 bytes

With Strip.exe = 4.9216.224 bytes
and next with upx.exe = 1.380.352 bytes -> 25.45 %

if compress with only upx.exe = 1.887.421 -> 34.80 %

Thank's Roberto :)

Claudio

Re: Larger size with Mingw

Posted: Sat Dec 05, 2009 3:59 pm
by ClaudioGalera
And second thoughts ... If you compile a

Code: Select all

function main()
? "Hello world !" 
Return
in mode console, Harbour generates an exe of 1,136,095 bytes. This is because the routines or libraries are loaded, which are never used in this case for example the RDD, printer system, etc. and will therefore generate large exes.

Question : With Ide.exe or buid.bat, Can we select the libraries that are to be in the exe?

Thank's :) ( and to google too, for the english translate :lol: )

Greetings

Claudio.

Re: Larger size with Mingw

Posted: Sat Dec 05, 2009 4:13 pm
by Rathinagiri
ClaudioGalera wrote:And second thoughts ... If you compile a

Code: Select all

function main()
? "Hello world !" 
Return
in mode console, Harbour generates an exe of 1,136,095 bytes. This is because the routines or libraries are loaded, which are never used in this case for example the RDD, printer system, etc. and will therefore generate large exes.

Question : With Ide.exe or buid.bat, Can we select the libraries that are to be in the exe?

Thank's :) ( and to google too, for the english translate :lol: )

Greetings

Claudio.
Hi Claudio,

I think this we had discussed already.

As regards the number of library files with IDE and Build.bat, we need not worry about. Because, only the required libraries are linked.

Re: Larger size with Mingw

Posted: Sat Dec 05, 2009 4:27 pm
by ClaudioGalera
rathinagiri wrote:
ClaudioGalera wrote:And second thoughts ... If you compile a

Code: Select all

function main()
? "Hello world !" 
Return
in mode console, Harbour generates an exe of 1,136,095 bytes. This is because the routines or libraries are loaded, which are never used in this case for example the RDD, printer system, etc. and will therefore generate large exes.

Question : With Ide.exe or buid.bat, Can we select the libraries that are to be in the exe?

Thank's :) ( and to google too, for the english translate :lol: )

Greetings

Claudio.
Hi Claudio,

I think this we had discussed already.

As regards the number of library files with IDE and Build.bat, we need not worry about. Because, only the required libraries are linked.
Ok, I understand :)
Thanks
Claudio

Re: Larger size with Mingw

Posted: Sat Dec 05, 2009 4:57 pm
by Roberto Lopez
sudip wrote:Hello Master Roberto,
Thanks a lot for your reply and for strip.rar. It works fine :)
I'll include it and do by default from the next test release.
Thanks a lot again :)
With best regards.
Sudip
Moreover, you could try the following (I've not fully tested yet).

In 'build.bat' 'hbmk2' line (#170) you could add the following:

Code: Select all

-cflag=-Os
That will send the flag '-Os' directly to MingW (gcc compiler).

'-Os' means 'optimize for size'. I've tested with various samples without any effect. Anyway, I guess that it will work in some special circumstances.

If you prefer speed instead size, you cold use:

Code: Select all

-cflag=-O3
A complete list of gcc optimizations is here:

http://gcc.gnu.org/onlinedocs/gcc-4.4.2 ... ze-Options

Enjoy! :)

Re: Larger size with Mingw

Posted: Sat Dec 05, 2009 5:10 pm
by sudip
Thanks a lot Master Roberto :D
That's exactly I am searching for :D
With best regards.
Sudip

Re: Larger size with Mingw

Posted: Sat Dec 05, 2009 5:23 pm
by Roberto Lopez
sudip wrote:Thanks a lot Master Roberto :D
That's exactly I am searching for :D
With best regards.
Sudip
And... if you are a patient man and have a very very very speedy PC you could try:

Code: Select all

UPX --ultra-brute yourapp.exe 
Good luck! :)

Re: Larger size with Mingw

Posted: Sat Dec 05, 2009 5:26 pm
by Roberto Lopez
Roberto Lopez wrote:

Code: Select all

UPX --ultra-brute yourapp.exe 
It reduced HMG's 'hello world' to 512512 BYTES!!!