<div dir="auto"><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Adriaan van Os via fpc-pascal <<a href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a>> schrieb am Mo., 28. Okt. 2024, 08:27:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Can someone tell me what the status is of Library packages, aka "Delphi packages" ? I found the <br>
WIki <<a href="https://wiki.freepascal.org/packages" rel="noreferrer noreferrer" target="_blank">https://wiki.freepascal.org/packages</a>> but it looks like a preliminary document.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Compile time usage of dynamic packages is implemented and is in theory working for all darwin targets, the Windows targets as well as x86_64-linux, however the functionality is not yet enabled by default, because the build system can not yet generate the packages required. </div><div dir="auto">What is missing is support to load additional packages at runtime. </div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
My questions<br>
<br>
1. For MacOS, are there any differences at the Mach-O level between a dynamic library and a library <br>
package ? Are different linking switches used ? Which ones ?<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Dynamic packages are essentially normal libraries. I'm not aware of any special options used compared to ordinary libraries. </div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
2. Are there any differences at the FreePascal RTL level ? What compiler building options govern this ?<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">The main difference is that a program or library compiled without dynamic packages will each have a statically linked copy of the RTL (and any other code it uses). If a binary uses dynamic packages then the binary itself will not contain code that is contained in one of the used runtime packages. Binaries are relatively free to decide which packages it uses, except for the RTL package which always must be used if packages are to be used (because the core units like System then need to recide in a separate library, so that other packages and the main binary can use them). </div><div dir="auto">The options involved are -Fpxxx to set the path to search for pcp files (the metadata equivalent of a ppu for dynamic packages) and -FPxxx to specify which packages to use. </div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Probably there are differences for Lazarus too, but my first interest are the low-level changes.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Lazarus currently does not support dynamic packages, because for Lazarus to profit from this, loading at runtime needs to be implemented. </div><div dir="auto"><br></div><div dir="auto">Regards, </div><div dir="auto">Sven </div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>