[fpc-devel]compiling on openbsd 3.5

Lee Bowyer Lee at networkpenetration.com
Sun Jun 6 14:37:50 CEST 2004


okay, cheers marco, expect pleas for help ;-)

On Sun, 6 Jun 2004 14:28:46 +0200 (CEST), Marco van de Voort  
<marcov at stack.nl> wrote:

>> >
>> > I can still assist, but I'm not going to do the bulk of the work  
>> anymore,
>> > I simply don't have the time.
>>
>> All I use is openbsd, if you can give some help over the prt0 problem, I
>> can certainly send you any openbsd fixes...
>>
>> The amount of fixing needed for 1.9.x/2.0 doesn't seem that heavy  
>> (except
>> for the prt0..)
>
> The basic idea is:
>
> prt0:
>
> - compile the original crt<x>.c code that comes with the OS.
> - move the argc, argv and environ variables to Pascal space
> 	(1.0.x SYSBSD$identifier, 1.9.x: SYSTEM$identifier)
> - remove all libc initialisation and finalisation code.
> - copy the initcode of the coprocessor (the fstcw code)
> - Remove the pushes of parameter before main, replace it with
> 	a xorl %ebp,%ebp
> - Change the name of main (IIRC 1.9.x: PASCALMAIN (capitals),
> 	older: main)
> - copy the code to exit the program (a syscall to exit in asm,
> 	load the program exitcode from pascal space)
> - Sometimes one has to add ELF identifiers too.
>
> cprt0.as: (prt0.as for shared linking to libc programs)
>
> Pretty much the same, except that removing the libc init/finalisation
> stuff is not necessary.
>
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-devel



-- 

Lee Bowyer
Lee at networkpenetration.com
www.networkpenetration.com




More information about the fpc-devel mailing list