Re: [fpc-devel] FPC for FreeBSD/PowerPC

2017-08-10 Thread Marco van de Voort
In our previous episode, Karoly Balogh (Charlie/SGR) said:
> > To my knowledge there is no universal "newer" and "older" BSD syscall
> > set. Are you talking about something NetBSD specific? So the first thing
> > would be to qualify that, and/or verify in how much the other BSDs
> > follow.
> 
> Well, you can turn off the COMPAT calls in the kernel config.

(I assume NetBSD only then, what comes instead of it? What does gcc use? etc 
etc)

I assume you mean the ifdef use_stat30? Talk to Pierre for that:


r20741 | pierre | 2012-04-07 17:37:03 +0200 (Sat, 07 Apr 2012) | 1 line

 Add NETBSD_USE_STAT30 conditional for recent NetBSD changes, not yet used

) 

> While they're enabled now by default, it certainly looks like something
> which might go away, or optional.  Also while fixing up stuff I ran into
> the fact that the alignments have changed anyway between aout and ELF it
> seems, so some of the stuff we have won't work on really old systems
> anyway, even if you plug in some old binutils for them.


> But I was mainly referring to stat and fsstat structures and the syscalls
> which are using them. It's quite an ifdef-mess already, so I was hoping to
> remove some of that. And there were a few other calls, but I can't
> remember. I just remember using ktruss, and running into a few compat
> calls shown.

The alignment is awfully ad-hoc, I think I originally started out as packed
with padding without much practical grasp of how alignment worked.  (most
notably fixed vs natural alignment)

Anything netbsd/PPC specific can be considered scratch and changable at your
discretion.  It is terribly old.  I only care for the synergy of the BSD
ports in general.

> > It might require revalidating all ports, since e.g. structures might change
> > which in turn might mean validating them on all targets (mostly due to
> > padding)
> 
> Yapp, see above. :) I'm pretty certain some if not all of the netbsdppc
> $ifdef'ing and the related hacks are pretty much unnecessary at this
> point. But I understand the compiler has advanced a lot since these were
> added, so I don't mean to point fingers.

Iirc some of the extra named pad field came from the original headers. 
Probably they exist to make the stat record definition the same over all
architectures, regardless of architecture padding rules.  So they are
probably not my/Pierre's inventions.  They can be outdated though.
 
> > I remembered btw that NetBSD did run briefly on PPC though, around FPC
> > 1.9.2 on a PPC603, Florian helped with the assembler back then.  I
> > remember the main issue was some problem with fpu instructions needing
> > alignment on 603 but not on 604e.

(and I tested on a 603e-200 pmac 4400 iirc)
 
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] FPC for FreeBSD/PowerPC

2017-08-10 Thread Karoly Balogh (Charlie/SGR)
Hi,

On Thu, 10 Aug 2017, Marco van de Voort wrote:

> > The questions is, can I just go in and upgrade our syscall interface to
> > the newer calls (where makes sense), or do we intend to support older
> > systems too?
>
> To my knowledge there is no universal "newer" and "older" BSD syscall
> set. Are you talking about something NetBSD specific? So the first thing
> would be to qualify that, and/or verify in how much the other BSDs
> follow.

Well, you can turn off the COMPAT calls in the kernel config. While
they're enabled now by default, it certainly looks like something which
might go away, or optional. Also while fixing up stuff I ran into the fact
that the alignments have changed anyway between aout and ELF it seems, so
some of the stuff we have won't work on really old systems anyway, even if
you plug in some old binutils for them.

But I was mainly referring to stat and fsstat structures and the syscalls
which are using them. It's quite an ifdef-mess already, so I was hoping to
remove some of that. And there were a few other calls, but I can't
remember. I just remember using ktruss, and running into a few compat
calls shown.

> It might require revalidating all ports, since e.g. structures might change
> which in turn might mean validating them on all targets (mostly due to
> padding)

Yapp, see above. :) I'm pretty certain some if not all of the netbsdppc
$ifdef'ing and the related hacks are pretty much unnecessary at this
point. But I understand the compiler has advanced a lot since these were
added, so I don't mean to point fingers.

> I remembered btw that NetBSD did run briefly on PPC though, around FPC
> 1.9.2 on a PPC603, Florian helped with the assembler back then.  I
> remember the main issue was some problem with fpu instructions needing
> alignment on 603 but not on 604e.

Yes, I ran into the same issue while porting to AmigaOS4 a bit later, and
not only 603 but some of the derived cores too, like the 750 etc. It had
the same issues. But the compiler has a much better infrastructure to deal
with these issues these days. My PowerPC assembly is a bit rusty, but I
can still tackle this. ;)

Charlie
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] FPC for FreeBSD/PowerPC

2017-08-10 Thread Marco van de Voort
In our previous episode, Karoly Balogh (Charlie/SGR) said:
> > organic process, but unfortunately it doesn't happen in all of the BSDs at
> > the same time or even at all.
> 
> The questions is, can I just go in and upgrade our syscall interface to
> the newer calls (where makes sense), or do we intend to support older
> systems too?

To my knowledge there is no universal "newer" and "older" BSD syscall set. Are 
you
talking about something NetBSD specific? So the first thing would be to
qualify that, and/or verify in how much the other BSDs follow.

> I'd say should just upgrade to latest and greatest,
> especially if a given platform is neglected/was broken or barely
> maintained otherwise. Any objections?

If it is NetBSD specific, you can probably update the NetBSD part of the
port without qualms as long as all (relevant) architectures are supported by
current NetBSD and the version with the new calls is somewhat current (no
pre release stuff) Contrary to Linux, and to a lesser degree FreeBSD, the
syscalls don't differ between architectures.

It might require revalidating all ports, since e.g. structures might change
which in turn might mean validating them on all targets (mostly due to
padding)

I remembered btw that NetBSD did run briefly on PPC though, around FPC 1.9.2
on a PPC603, Florian helped with the assembler back then.  I remember the
main issue was some problem with fpu instructions needing alignment on 603
but not on 604e.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] FPC for FreeBSD/PowerPC

2017-08-10 Thread Karoly Balogh (Charlie/SGR)
Hi,

On Wed, 9 Aug 2017, Curtis Hamilton wrote:

> I just formally subscribed to this mailing list.
>
> I'm interested in fpc on FreeBSD/PowerPC, however, I don't want to
> create any additional work nor break something that's not broken. That
> being said, I'm willing to work on this alone or with anyone who is also
> interested. My personal work target is for PowerPC 64-bit (Power Mac
> G5), I do have 32-bit PowerPC (Power Mac G4) hardware available to me.
> FreeBSD runs on G4 and G5 Power Macs.
>
> FYI, I did the work on getting native java (OpenJDK8) support on powerpc64.

That sounds cool, welcome on board. The starting point would be this wiki
article about how to add a new target to the compiler, which would be
necessary for system_powerpc_freebsd and system_powerpc64_freebsd:

http://wiki.freepascal.org/Porting_Free_Pascal

Which is slightly obsolete, and it doesn't really cover the RTL part, but
the main points are still the same to do the first steps. Of course, you
have to take care that the compiler and libs sort of already works on
FreeBSD, so only implement the CPU specific parts, or include
PowerPC/PowerPC64 into the lists where necessary. It's nothing rocket
science. If you have specific questions, feel free to ask, also feel free
to send patches for review and upstream inclusion.

Cheers,
--
Charlie
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] FPC for FreeBSD/PowerPC

2017-08-10 Thread Curtis Hamilton

All,

I just formally subscribed to this mailing list.

I'm interested in fpc on FreeBSD/PowerPC, however, I don't want to 
create any additional work nor break something that's not broken. That 
being said, I'm willing to work on this alone or with anyone who is also 
interested. My personal work target is for PowerPC 64-bit (Power Mac 
G5), I do have 32-bit PowerPC (Power Mac G4) hardware available to me. 
FreeBSD runs on G4 and G5 Power Macs.


FYI, I did the work on getting native java (OpenJDK8) support on powerpc64.

Regards,
Curtis

On 08/08/17 07:25, Tomas Hajny wrote:


Hi Charlie,

Please note that the sender of the original post isn't subscribed to this
mailing list (although he hasn't mentioned it in his post unfortunately) -
forwarding this your post in Cc: now; I'll forward the other too without
including the list.

Tomas


 Original Message 
Subject: Re: [fpc-devel] FPC for FreeBSD/PowerPC
From:"Karoly Balogh (Charlie/SGR)" <char...@scenergy.dfmk.hu>
Date:Tue, August 8, 2017 12:32
To:  "FPC developers' list" <fpc-devel@lists.freepascal.org>


Hi,

On Mon, 7 Aug 2017, Curtis Hamilton wrote:


I'm interested to know if there has been work on fpc for
FreeBSD/PowerPC. I'm interested in the status and helping maintain fpc
for this platform.

FreeBSD for PowerPC never existed in FPC (it's not even in the internal
platform list, only FreeBSD/i386 and FreeBSD/x86-64). It's certainly
possible to add it though, especially if someone steps up as a regular
maintainer. I was recently thinking to revive and bring NetBSD for PowerPC
support up to speed, after recently fixing/reviving NetBSD for m68k. But
to be honest, even the far more popular x86_64 and i386 versions seem to
need some love, and I'd say that probably also goes for FreeBSD (Marco?
Any comments?). Maybe these efforts can be combined.

I never ran FreeBSD before, I might have the hardware for the PowerPC
version tho'. Does it run on one of the following: Mac mini G4, PowerBook
G4 (5,6), PowerMac QuickSilver G4, bPlan Pegasos II G4?

The main problem that most of the BSD and Unix platforms have a quite
entangled backend in the FPC RTL (and even Darwin is considered a BSD in
this case), so there's a high risk that one can break something else while
fixing a certain platform, and most of it uses a quite old COMPAT syscall
interface. So mapping up what's there and how to fix it for the future is
the difficulty, while not breaking other Unices and BSDs in the process.
:) But otherwise it's definitely doable.

Cheers,
--
Charlie
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel




___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] FPC for FreeBSD/PowerPC

2017-08-08 Thread Marco van de Voort
In our previous episode, Karoly Balogh (Charlie/SGR) said:
> > I'm interested to know if there has been work on fpc for
> > FreeBSD/PowerPC. I'm interested in the status and helping maintain fpc
> > for this platform.
> 
> FreeBSD for PowerPC never existed in FPC (it's not even in the internal
> platform list, only FreeBSD/i386 and FreeBSD/x86-64).

I started on it, but stopped due to lack of time.

> But to be honest, even the far more popular x86_64 and
> i386 versions seem to need some love, and I'd say that probably also goes
> for FreeBSD (Marco?  Any comments?).  Maybe these efforts can be combined.

FreeBSD is somewhat neglected too, but from a much better starting point
than open/netbsd. I fix know things once in a while, but don't use it
day-to-day anymore. FreeBSD is now a LLVM system, but I only did minimal
fixes for that.
 
> Mac mini G4, PowerBook G4 (5,6), PowerMac QuickSilver G4, bPlan Pegasos II
> G4?

I had it on a mini G4 1.25.
 
> The main problem that most of the BSD and Unix platforms have a quite
> entangled backend in the FPC RTL (and even Darwin is considered a BSD in
> this case), so there's a high risk that one can break something else while
> fixing a certain platform, and most of it uses a quite old COMPAT syscall
> interface. So mapping up what's there and how to fix it for the future is
> the difficulty, while not breaking other Unices and BSDs in the process.
> :) But otherwise it's definitely doable.

Most BSDs have syscalls that have an interface similar to a C function, and
often close the the (2) call of the same name. This is where the similarity
comes from.

Regularly older calls are replaced by newer calls, but while this is an
organic process, but unfortunately it doesn't happen in all of the BSDs at
the same time or even at all.

Darwin used the libc port from the beginning, so doesn't share the syscall
oriented stuff. And afaik most (3) definitions don't change that much.

I don't think there are general rules, best is to discuss it one specific
issue at a time with the relevant maintainers.

___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] FPC for FreeBSD/PowerPC

2017-08-08 Thread Tomas Hajny
Hi Charlie,

Please note that the sender of the original post isn't subscribed to this
mailing list (although he hasn't mentioned it in his post unfortunately) -
forwarding this your post in Cc: now; I'll forward the other too without
including the list.

Tomas


 Original Message 
Subject: Re: [fpc-devel] FPC for FreeBSD/PowerPC
From:"Karoly Balogh (Charlie/SGR)" <char...@scenergy.dfmk.hu>
Date:Tue, August 8, 2017 12:32
To:  "FPC developers' list" <fpc-devel@lists.freepascal.org>


Hi,

On Mon, 7 Aug 2017, Curtis Hamilton wrote:

> I'm interested to know if there has been work on fpc for
> FreeBSD/PowerPC. I'm interested in the status and helping maintain fpc
> for this platform.

FreeBSD for PowerPC never existed in FPC (it's not even in the internal
platform list, only FreeBSD/i386 and FreeBSD/x86-64). It's certainly
possible to add it though, especially if someone steps up as a regular
maintainer. I was recently thinking to revive and bring NetBSD for PowerPC
support up to speed, after recently fixing/reviving NetBSD for m68k. But
to be honest, even the far more popular x86_64 and i386 versions seem to
need some love, and I'd say that probably also goes for FreeBSD (Marco?
Any comments?). Maybe these efforts can be combined.

I never ran FreeBSD before, I might have the hardware for the PowerPC
version tho'. Does it run on one of the following: Mac mini G4, PowerBook
G4 (5,6), PowerMac QuickSilver G4, bPlan Pegasos II G4?

The main problem that most of the BSD and Unix platforms have a quite
entangled backend in the FPC RTL (and even Darwin is considered a BSD in
this case), so there's a high risk that one can break something else while
fixing a certain platform, and most of it uses a quite old COMPAT syscall
interface. So mapping up what's there and how to fix it for the future is
the difficulty, while not breaking other Unices and BSDs in the process.
:) But otherwise it's definitely doable.

Cheers,
--
Charlie
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] FPC for FreeBSD/PowerPC

2017-08-08 Thread Karoly Balogh (Charlie/SGR)
Hi,

On Tue, 8 Aug 2017, Karoly Balogh (Charlie/SGR) wrote:

> > I'm interested to know if there has been work on fpc for
> > FreeBSD/PowerPC. I'm interested in the status and helping maintain fpc
> > for this platform.
>
> FreeBSD for PowerPC never existed in FPC (it's not even in the internal
> platform list, only FreeBSD/i386 and FreeBSD/x86-64). It's certainly
> possible to add it though, especially if someone steps up as a regular
> maintainer.

BTW, while we're at it, does "powerpc" mean powerpc32 or powerpc64 or both
in FreeBSD's case? Also, what about the new little endian powerpc64le
stuff for the future? Because all of these need a separate ID and
platform support in FPC then.

Charlie
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] FPC for FreeBSD/PowerPC

2017-08-08 Thread Karoly Balogh (Charlie/SGR)
Hi,

On Mon, 7 Aug 2017, Curtis Hamilton wrote:

> I'm interested to know if there has been work on fpc for
> FreeBSD/PowerPC. I'm interested in the status and helping maintain fpc
> for this platform.

FreeBSD for PowerPC never existed in FPC (it's not even in the internal
platform list, only FreeBSD/i386 and FreeBSD/x86-64). It's certainly
possible to add it though, especially if someone steps up as a regular
maintainer. I was recently thinking to revive and bring NetBSD for PowerPC
support up to speed, after recently fixing/reviving NetBSD for m68k. But
to be honest, even the far more popular x86_64 and i386 versions seem to
need some love, and I'd say that probably also goes for FreeBSD (Marco?
Any comments?). Maybe these efforts can be combined.

I never ran FreeBSD before, I might have the hardware for the PowerPC
version tho'. Does it run on one of the following: Mac mini G4, PowerBook
G4 (5,6), PowerMac QuickSilver G4, bPlan Pegasos II G4?

The main problem that most of the BSD and Unix platforms have a quite
entangled backend in the FPC RTL (and even Darwin is considered a BSD in
this case), so there's a high risk that one can break something else while
fixing a certain platform, and most of it uses a quite old COMPAT syscall
interface. So mapping up what's there and how to fix it for the future is
the difficulty, while not breaking other Unices and BSDs in the process.
:) But otherwise it's definitely doable.

Cheers,
--
Charlie
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


[fpc-devel] FPC for FreeBSD/PowerPC

2017-08-08 Thread Curtis Hamilton
I'm interested to know if there has been work on fpc for 
FreeBSD/PowerPC. I'm interested in the status and helping maintain fpc 
for this platform.


Regards,

Curtis

___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


[fpc-devel] FPC on Freebsd

2010-06-04 Thread Leonardo M . Ramé
Hí, I'm trying to compile FPC 2.5.1 on FreeBsd 8.0 (i386-stable). To do this, I 
followed the instructions from here:

http://wiki.lazarus.freepascal.org/Installing_Lazarus#Installing_Free_Pascal_under_Linux.2FBSD_manually

The probem I'm facing now is when I do an make install from ports, I get FPC 
2.2.4, and the minimum version required to compile from trunk is 2.4.0 
according to this: 

http://www.mail-archive.com/fpc-devel@lists.freepascal.org/msg16836.html 

How can I get 2.4.0 binary to compile the svn version?.

Leonardo M. Ramé
http://leonardorame.blogspot.com




___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] FPC on Freebsd

2010-06-04 Thread Henry Vermaak
On 4 June 2010 13:08, Leonardo M. Ramé martinr...@yahoo.com wrote:
 Hí, I'm trying to compile FPC 2.5.1 on FreeBsd 8.0 (i386-stable). To do this, 
 I followed the instructions from here:

 http://wiki.lazarus.freepascal.org/Installing_Lazarus#Installing_Free_Pascal_under_Linux.2FBSD_manually

 The probem I'm facing now is when I do an make install from ports, I get 
 FPC 2.2.4, and the minimum version required to compile from trunk is 2.4.0 
 according to this:

 http://www.mail-archive.com/fpc-devel@lists.freepascal.org/msg16836.html

 How can I get 2.4.0 binary to compile the svn version?.

There are some bootstrap compilers here:

ftp://ftp.freepascal.org/pub/fpc/dist/2.4.0/bootstrap/

I see there is no freebsd 8, though.

Henry
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] FPC on Freebsd

2010-06-04 Thread Leonardo M . Ramé
Henry, just to confirm that ppc386-freebsd-7.bz2 was able to bootstrap 2.5.1 
i386 on FreeBsd 8.0

Thanks again.

Leonardo M. Ramé
http://leonardorame.blogspot.com


--- On Fri, 6/4/10, Leonardo M. Ramé martinr...@yahoo.com wrote:

 From: Leonardo M. Ramé martinr...@yahoo.com
 Subject: Re: [fpc-devel] FPC on Freebsd
 To: FPC developers' list fpc-devel@lists.freepascal.org
 Date: Friday, June 4, 2010, 9:19 AM
 Thanks, I'll try one of them.
 
 Leonardo M. Ramé
 http://leonardorame.blogspot.com
 
 
 --- On Fri, 6/4/10, Henry Vermaak henry.verm...@gmail.com
 wrote:
 
  From: Henry Vermaak henry.verm...@gmail.com
  Subject: Re: [fpc-devel] FPC on Freebsd
  To: FPC developers' list fpc-devel@lists.freepascal.org
  Date: Friday, June 4, 2010, 9:12 AM
  On 4 June 2010 13:08, Leonardo M.
  Ramé martinr...@yahoo.com
  wrote:
   Hí, I'm trying to compile FPC 2.5.1 on FreeBsd
 8.0
  (i386-stable). To do this, I followed the instructions
 from
  here:
  
   http://wiki.lazarus.freepascal.org/Installing_Lazarus#Installing_Free_Pascal_under_Linux.2FBSD_manually
  
   The probem I'm facing now is when I do an make
  install from ports, I get FPC 2.2.4, and the minimum
  version required to compile from trunk is 2.4.0
 according to
  this:
  
   http://www.mail-archive.com/fpc-devel@lists.freepascal.org/msg16836.html
  
   How can I get 2.4.0 binary to compile the svn
  version?.
  
  There are some bootstrap compilers here:
  
  ftp://ftp.freepascal.org/pub/fpc/dist/2.4.0/bootstrap/
  
  I see there is no freebsd 8, though.
  
  Henry
  ___
  fpc-devel maillist  -  fpc-devel@lists.freepascal.org
  http://lists.freepascal.org/mailman/listinfo/fpc-devel
  
 
 
 
 ___
 fpc-devel maillist  -  fpc-devel@lists.freepascal.org
 http://lists.freepascal.org/mailman/listinfo/fpc-devel
 



___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] FPC on Freebsd

2010-06-04 Thread Marco van de Voort
In our previous episode, Henry Vermaak said:
 
  How can I get 2.4.0 binary to compile the svn version?.
 
 There are some bootstrap compilers here:
 
 ftp://ftp.freepascal.org/pub/fpc/dist/2.4.0/bootstrap/
 
 I see there is no freebsd 8, though.

The bootstrap compilers are statically linked, so iirc they work even
when no COMPAT_ is installed.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel