[fpc-pascal] BUG: FPC must not expect main for shared library
jonas.maebe at elis.ugent.be
Fri Nov 21 19:44:10 CET 2008
On 21 Nov 2008, at 19:34, KES wrote:
> JM> On 21 Nov 2008, at 18:04, KES wrote:
>>> I think FPC must not expect 'main' entry point
> JM> The "main" of an FPC shared library contains the code to run the
> JM> initialisation routines of all units used by the library. The
> label of
> JM> this code is however not called "main" (I can't remember that it
> JM> was), and the FreeBSD startup code for is indeed wrong in
> calling it.
> JM> For the FreeBSD maintainers: I guess you should use similar init/
> JM> code as what is used for Linux (compiler/t_linux.pas, search for
> JM> initname).
> fpc -Ss does not help ((
That switch is unrelated, it's about parsing TP-style object
constructors and destructors.
The problem you have needs to be fixed in the compiler, you cannot
change this behaviour using a command line switch. As far as I can
tell, the problem is simply that nobody ever added support for shared
libraries under FreeBSD. There is no startup code for them in the run
time library, and no special case for them in the target-specific
files of the compiler.
The reason you get that error, is because it always uses the startup
code for programs (and those do always have a main function).
More information about the fpc-pascal