hi jsoftware
thanks , but how could you get this compiled together !
i mean the commandline
i used -O3 -XsX -CX -Sd but i only got system.o
hi jsoftware
thanks , but how could you get this compiled together !
i mean the commandline
i used -O3 -XsX -CX -Sd but i only got system.o
does FPC not remove unused code, variable and consts?
in my assembler/compiler, i have include 10,000 lines of code, and if my main file does nothing it will be the minimum exe size, why does FPC use 30kb that is ridiculous....
in ziron, even a messagebox app is 2kb
I'd be interested in what FPU adds so much to the exe to be 30kb!!!!!!!! :OCode:program WIN32GUI 'Test'; #include 'kernel32.zir'; #include 'user32.zir'; MessageBox(0, 'Hello World!', 'Hello', MB_OK); ExitProcess(0);
the minimum size note on windows (PE) is 1kb, since you need 512 bytes for headers and 512 for your code.
this compiles with an equiv of 101873 lines of code and is still only 2kb, i can add error checking too which takes it to 3.5kb......Code:program WIN32GUI 'Test'; #include 'kernel32.zir'; #include 'user32.zir'; #include 'strings.zir'; #include 'gdi32.zir'; function Unused1() { #repeat 100000: eax = eax; //useless code to make the exe huge :) (not really since it will be discarded) #end } MessageBox(0, 'Hello World!', 'Hello', MB_OK); ExitProcess(0);
Last edited by Colin; 09-11-2011 at 03:35 PM.
Download the Ziron Assembler
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
Peregrinus, expectavi pedes meos in cymbalis
Nullus norvegicorum sole urinat
thanks for your help ,looks interesting now , MessageBox becomes 542b !! after compressing with upx and com
Last edited by AirPas; 10-11-2011 at 07:46 AM.
Aside from a 30kb executeable being limited in functionality - UPX is a very good bet IMO. Although I admit I find 700kb ok and 70kb to be very small for me. You could always do some ASM8086 on linux - virtually no size at all.
I once tried to change the world. But they wouldn't give me the source code. Damned evil cunning.
Also read the FPC wiki page about EXE sizes: http://wiki.freepascal.org/Size_Matters
Most importantly the "why bother?" bit.
You have to compile the units first.
fpc -O3 -Us system
fpc -O3 fpintres
fpc -O3 sysinitpas
fpc -O3 -XsX -CX yourcode
Peregrinus, expectavi pedes meos in cymbalis
Nullus norvegicorum sole urinat
Bookmarks