[fpc-devel] RTL make shared
Adriaan van Os
adriaan at adriaan.biz
Wed Oct 30 06:50:46 CET 2024
Sven Barth via fpc-devel wrote:
> Adriaan van Os via fpc-devel <fpc-devel at lists.freepascal.org
> <mailto:fpc-devel at lists.freepascal.org>> schrieb am Di., 29. Okt. 2024,
> 15:47:
> The idea of building the RTL in a dynamic ibrary is to have one copy
> of the RTL threadvars, notably
> one copy of the _ExceptObjectStack threadvar. Will this still be
> true if a main program and a
> dynamic library both include sysinit.o ?
>
>
> The sysinit unit contains the entrypoint and directly references symbols
> provided by the main program, not the RTL, to pass them into the RTL. It
> simply can't be inside a library. The exception handling is inside the
> System and SysUtils units, so no conflict there.
sysinit.o contains _FPC_LIBMAIN and thus has to be linked in when creating a dynamic library
compiled with FPC. The crucial question is — do we then end up with one or two copies of the
_ExceptObjectStack threadvar ?
Regards,
Adriaan van Os
More information about the fpc-devel
mailing list