Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2024-10

Library packages

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Adriaan van Os

Can someone tell me what the status is of Library packages, aka "Delphi packages" ? I found the WIki <https://wiki.freepascal.org/packages> but it looks like a preliminary document.

My questions

1. For MacOS, are there any differences at the Mach-O level between a dynamic library and a library package ? Are different linking switches used ? Which ones ?

2. Are there any differences at the FreePascal RTL level ? What compiler building options govern this ?

Probably there are differences for Lazarus too, but my first interest are the low-level changes.

Regards,

Adriaan van Os

Reply by email

Sven Barth
to Adriaan van Os

Adriaan van Os via fpc-pascal schrieb am
Mo., 28. Okt. 2024, 08:27:

Show quoted text 5 lines
Can someone tell me what the status is of Library packages, aka "Delphi packages" ? I found the WIki <https://wiki.freepascal.org/packages> but it looks like a preliminary document.

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. What is missing is support to load additional packages at runtime.

Show quoted text 6 lines
My questions 1. For MacOS, are there any differences at the Mach-O level between a dynamic library and a library package ? Are different linking switches used ? Which ones ?

Dynamic packages are essentially normal libraries. I'm not aware of any special options used compared to ordinary libraries.

2. Are there any differences at the FreePascal RTL level ? What compiler building options govern this ?

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). 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.

Probably there are differences for Lazarus too, but my first interest are the low-level changes.

Lazarus currently does not support dynamic packages, because for Lazarus to profit from this, loading at runtime needs to be implemented.

Regards,
Sven

Reply by email

Adriaan van Os
to Sven Barth
Sven Barth wrote 12 lines
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). 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.

OK. Thanks for the info.

Regards,

Adriaan van Os

Reply by email