Larger size with Mingw

Discuss anything else that does not suite other forums.

Moderator: Rathinagiri

User avatar
sudip
Posts: 1454
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: Larger size with Mingw

Post 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
With best regards,
Sudip
ClaudioGalera
Posts: 47
Joined: Tue Jul 14, 2009 1:14 pm
Location: Mar del Plata, Argentina

Re: Larger size with Mingw

Post 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
ClaudioGalera
Posts: 47
Joined: Tue Jul 14, 2009 1:14 pm
Location: Mar del Plata, Argentina

Re: Larger size with Mingw

Post 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.
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Larger size with Mingw

Post 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.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
ClaudioGalera
Posts: 47
Joined: Tue Jul 14, 2009 1:14 pm
Location: Mar del Plata, Argentina

Re: Larger size with Mingw

Post 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
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: Larger size with Mingw

Post 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! :)
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
sudip
Posts: 1454
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: Larger size with Mingw

Post by sudip »

Thanks a lot Master Roberto :D
That's exactly I am searching for :D
With best regards.
Sudip
With best regards,
Sudip
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: Larger size with Mingw

Post 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! :)
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: Larger size with Mingw

Post by Roberto Lopez »

Roberto Lopez wrote:

Code: Select all

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

Roberto


(Veritas Filia Temporis)
Post Reply