Lazarus
Free Pascal => Beginners => Topic started by: guest64953 on December 03, 2019, 01:06:40 pm
-
I'm only know -O3 :-[
-
I'm a Lazarus user not (direct) FPC user. For release binary, I usually choose:
-O3 (slow optiomization)
-CX (smart linkable)
-XX (link smart)
-Xs (strip symbols from executable)
Honestly I don't know the different between "smart linkable" and "link smart". But both sound good, so I enable them all. :)
-
-CX -XXs -O3 (but -O4 should also be OK) And processor optimizations on certain platforms.
-
Honestly I don't know the different between "smart linkable" and "link smart".
"Smart linkable" compiles the units so that thay can be smart-linked if desired. "Link smart" then links the program "smartly", linking only the code actually used.
They are complementary: if you don't make the units "smart-linkable" then they can't be "smart-linked", and viceversa: if you don't smart-link then it doesn't matter whether they are "smart-linkable" or not.
HTH
-
Could you explain the options used on Akira1364's post?
https://forum.lazarus.freepascal.org/index.php?topic=32642.30 (https://forum.lazarus.freepascal.org/index.php?topic=32642.30)
-
They are complementary: if you don't make the units "smart-linkable" then they can't be "smart-linked", and viceversa: if you don't smart-link then it doesn't matter whether they are "smart-linkable" or not.
HTH
So why not just merge them into one single option?
-
So why not just merge them into one single option?
I have another question, what is linking? It is for debugging?
-
I remember in the old DOS days, when I learned Clipper, there was a utility called BLinker. Not sure what exactly it did but I guess Clipper compiles the source code to obj and the linker converts (or merge several objs) to an executable binary.
https://en.wikipedia.org/wiki/Linker_%28computing%29 (https://en.wikipedia.org/wiki/Linker_%28computing%29)
I tried to imagine the obj files are something similar to Turbo Pascal TPUs, or later DCUs, ...
-
They are complementary: if you don't make the units "smart-linkable" then they can't be "smart-linked", and viceversa: if you don't smart-link then it doesn't matter whether they are "smart-linkable" or not.
HTH
So why not just merge them into one single option?
Because they are, conceptually, different operations: one happens when compiling and adds some overhead into the object files. The other happens when linking and it may not always be desirable (e.g. for debugging/profiling purposes).
I have another question, what is linking? It is for debugging?
When compiling a program each unit is compiled to its own .o/.ppu files. Once that is done for everything all those bits and pieces have to be "joined" together to create the executable program: that proces is called linking. That allows you, for example, to use the same unit (like say, System, SysUtils, etc.) without having to recompile all of them every time.
I tried to imagine the obj files are something similar to Turbo Pascal TPUs, or later DCUs, ...
The equivalent to a TPU or DCU in Free Pascal is the combination of the object file and the unit description file (.ppu).
Having a "TPU/DCU" divided in two files has some advantages; for example, it allows you to use a standard linker, like ld, instead of having to rely on (and build!) a dedicated one embedded in the compiler, as happens with Borland's Pascals
-
Could you explain the options used on Akira1364's post?
https://forum.lazarus.freepascal.org/index.php?topic=32642.30 (https://forum.lazarus.freepascal.org/index.php?topic=32642.30)
Did anyone notice this post? :D
-
Could you explain the options used on Akira1364's post?
https://forum.lazarus.freepascal.org/index.php?topic=32642.30 (https://forum.lazarus.freepascal.org/index.php?topic=32642.30)
Did anyone notice this post? :D
How about typing:
fpc -?
in your console and reading the result? ;D
Most of them are also explained (though somewhat sketchily) in the User's Guide.
-
I found this page, seems to be useful:
https://www.freepascal.org/docs-html/user/userap1.html
-
I found this page, seems to be useful:
https://www.freepascal.org/docs-html/user/userap1.html
Yeah, that's the one I meant. It seems to be just the output of "fpc -h".
-
I remember in the old DOS days, when I learned Clipper, there was a utility called BLinker. Not sure what exactly it did
BLinker was a better solution for CA-Clipper than the standard RTLink, because it was faster, it allowed to access more memory beyond the limit of 640kb up to 16mb of physical memory and 64mb of virtual memory and it generated compressed binaries among other professional features for that time.
but I guess Clipper compiles the source code to obj and the linker converts (or merge several objs) to an executable binary.
Correct. There were three main commands: clipper, rtlink (among many other alternatives being BLinker the most famous) and make.
"Clipper" to preprocess (PPO) the sources files (PRG) from xBase to the real language (very similar to C, AFAICR) and to generate the OBJ files;
Then "rtlink" to build the binaries (EXE) or libraries (LIB);
And finally "rmake" to govern the process for bigger projects (LNK and RMK).
https://en.wikipedia.org/wiki/Linker_%28computing%29 (https://en.wikipedia.org/wiki/Linker_%28computing%29)
I tried to imagine the obj files are something similar to Turbo Pascal TPUs, or later DCUs, ...
Sort of. Since Clipper was developed in C, the compiling process was much more similar to C, than to Pascal.