Sign in Join

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

Mailing lists / fpc-pascal / 2008-11

si_prc.pp or prt0.as(m)?

8 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

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

Marco van de Voort
to leledumbo

In our previous episode, leledumbo said:

Both files define _start symbol. Which one is actually used? Is it possible to use only ptr0.as(m)?

This afaik depends on the OS. Linux uses si_pr*, and FreeBSD uses (c)prt0.as

OS X afaik has parts that are equivalent to stuff in si_pr* integrated in the main program.

Reply by email

leledumbo
to Marco van de Voort
Marco van de Voort wrote 7 lines
This afaik depends on the OS. Linux uses si_pr*, and FreeBSD uses (c)prt0.as OS X afaik has parts that are equivalent to stuff in si_pr* integrated in the main program.

So it's integrated in the compiler (I mean, the compiler already knows which one to use depending on the target OS)? Is there any other way to change this other than tweaking the compiler?

View this message in context: http://www.nabble.com/si_prc.pp-or-prt0.as%28m%29--tp20696684p20696972.html Sent from the Free Pascal - General mailing list .

Reply by email

Marco van de Voort
to leledumbo

In our previous episode, leledumbo said:

Show quoted text 9 lines
> This afaik depends on the OS. Linux uses si_pr*, and FreeBSD uses > (c)prt0.as > > OS X afaik has parts that are equivalent to stuff in si_pr* integrated in > the main program. > So it's integrated in the compiler (I mean, the compiler already knows which one to use depending on the target OS)? Is there any other way to change this other than tweaking the compiler?

No. Though afaik only the names are set, and since (unlike with normal units) you can exchange these files without recompiling everything, except maybe for OS X/

I haven't really tested this for si_* though, but this has been done in the past that allowed to fix the same binary releases to generate FreeBSD 4 or 5 binaries, using the following scripts:

http://www.stack.nl/~marcov/fixfpc
http://www.stack.nl/~marcov/fixfpc19
http://www.stack.nl/~marcov/fixfpc2

As of 2.2, these scripts are no longer supported though, since more post 4 functionality has been integrated into the RTL.

Reply by email

leledumbo
to Marco van de Voort

Thanks, I'll follow http://wiki.freepascal.org/Porting_Free_Pascal these instructions instead.
Btw, what other documents do you have in stack.nl/~marcov? Is there any list for them? Some compiler related articles might be useful for me (I'm taking compiler techniques class, but it uses Java as implementation language with traditional intermediate code approach. FPC's unique design might give a new sight).

View this message in context: http://www.nabble.com/si_prc.pp-or-prt0.as%28m%29--tp20696684p20698854.html Sent from the Free Pascal - General mailing list .

Reply by email

Marco van de Voort
to Jonas Maebe

In our previous episode, Jonas Maebe said:

Show quoted text 5 lines
> OS X afaik has parts that are equivalent to stuff in si_pr* > integrated in > the main program. No, Mac OS X uses the system-supplied crt1.o.

I know, but the FPC specific stuff (the variables like operatingsystem_argc) moved to main?

Reply by email

Jonas Maebe
to Marco van de Voort
Marco van de Voort wrote 9 lines
In our previous episode, Jonas Maebe said: >> OS X afaik has parts that are equivalent to stuff in si_pr* >> integrated in >> the main program. > > No, Mac OS X uses the system-supplied crt1.o. I know, but the FPC specific stuff (the variables like operatingsystem_argc) moved to main?
It's in the system unit (rtl/bsd/system.pp, procedure FPC_SYSTEMMAIN;
FPC_DARWIN_PASCALMAIN and are both always defined)

The way it works is that crt1.o calls 'main', and the Pascal program simply contains a branch to FPC_SYSTEMMAIN as its main function (or as whatever you specify using -XM).

Jonas

Reply by email