Re: [fpc-pascal] Compiling FPC for SPARC

2006-08-03 Thread Mark Morgan Lloyd
Peter Vreman wrote:

> There is only one correct solution: Fix the building of the 2.0.4 by
> looking up the correct syscall in the C headers.
> 
> Forget about old stable releases like 2.0.2, only work with current svn
> (2.0.4 or 2.1.1).

The only thing that bothers me here is that while this is the correct solution
it might not be possible. With the major caveat that I'm a beginner at this but
I've demonstrated that 2.0.0 can't compile 2.0.2, and I suspect that once I've
fixed the missing syscall I still might be left with something that the existing
compiler can't process :-(

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Compiling FPC for SPARC

2006-08-03 Thread Jonas Maebe


On 3 aug 2006, at 11:11, Mark Morgan Lloyd wrote:

Forget about old stable releases like 2.0.2, only work with  
current svn

(2.0.4 or 2.1.1).


The only thing that bothers me here is that while this is the  
correct solution
it might not be possible. With the major caveat that I'm a beginner  
at this but
I've demonstrated that 2.0.0 can't compile 2.0.2, and I suspect  
that once I've
fixed the missing syscall I still might be left with something that  
the existing

compiler can't process :-(


This is not a case of something the existing compiler cannot process,  
but a platform-specific include file which was not updated while  
others were. The SPARC exit_group syscall is 188 according to

  http://lxr.linux.no/source/include/asm-sparc/unistd.h#L207

But yes, it's possible you'll find a few more things like this before  
everything compiles, since the SPARC/Linux port has not been  
maintained for a while.



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


Re: [fpc-pascal] Compiling FPC for SPARC

2006-08-03 Thread Mark Morgan Lloyd
Vincent Snijders wrote:

> Look up the syscall_nr_exit_group (the number for exit_group syscall) for 
> sparc and
> add it to rtl/linux/sparc/sysnr.inc and try to compile again.
> 
> This syscall was not used in fpc 2.0.2, but was added afterwards. You might 
> find
> more of those.

Thanks. I'll follow that up as the main thrust but I think I'll backtrack first
and check compilation on an i386 without UML in case I was doing something
really dumb. If I can get that working it gives me at least the possibility of a
2.0.2 cross-compiler, so that I could work on 2.0.4 with something more recent
than a 2.0.0 compiler.

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Compiling FPC for SPARC

2006-08-03 Thread Peter Vreman
> Vincent Snijders wrote:
>
>> Look up the syscall_nr_exit_group (the number for exit_group syscall)
>> for sparc and
>> add it to rtl/linux/sparc/sysnr.inc and try to compile again.
>>
>> This syscall was not used in fpc 2.0.2, but was added afterwards. You
>> might find
>> more of those.
>
> Thanks. I'll follow that up as the main thrust but I think I'll backtrack
> first
> and check compilation on an i386 without UML in case I was doing something
> really dumb. If I can get that working it gives me at least the
> possibility of a
> 2.0.2 cross-compiler, so that I could work on 2.0.4 with something more
> recent
> than a 2.0.0 compiler.

2.0.4 (and also the current 2.1.1) can still be build by 2.0.0.



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


Re: [fpc-pascal] Compiling FPC for SPARC

2006-08-03 Thread Mark Morgan Lloyd
Jonas Maebe wrote:

> > The only thing that bothers me here is that while this is the
> > correct solution
> > it might not be possible. With the major caveat that I'm a beginner
> > at this but
> > I've demonstrated that 2.0.0 can't compile 2.0.2, and I suspect
> > that once I've
> > fixed the missing syscall I still might be left with something that
> > the existing
> > compiler can't process :-(
> 
> This is not a case of something the existing compiler cannot process,
> but a platform-specific include file which was not updated while
> others were. The SPARC exit_group syscall is 188 according to
>http://lxr.linux.no/source/include/asm-sparc/unistd.h#L207
> 
> But yes, it's possible you'll find a few more things like this before
> everything compiles, since the SPARC/Linux port has not been
> maintained for a while.

Working on it. I know that this particular problem is not related to a compiler
problem, but I've already (I think) demonstrated that the 2.0.0 compiler on
SPARC has problems with the 2.0.2 sources. I've got a horrid feeling that once
the missing stuff is fixed I'll hit the same problem :-(

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Compiling FPC for SPARC

2006-08-03 Thread Vincent Snijders

Mark Morgan Lloyd schreef:

Jonas Maebe wrote:


The only thing that bothers me here is that while this is the
correct solution
it might not be possible. With the major caveat that I'm a beginner
at this but
I've demonstrated that 2.0.0 can't compile 2.0.2, and I suspect
that once I've
fixed the missing syscall I still might be left with something that
the existing
compiler can't process :-(

This is not a case of something the existing compiler cannot process,
but a platform-specific include file which was not updated while
others were. The SPARC exit_group syscall is 188 according to
   http://lxr.linux.no/source/include/asm-sparc/unistd.h#L207

But yes, it's possible you'll find a few more things like this before
everything compiles, since the SPARC/Linux port has not been
maintained for a while.


Working on it. I know that this particular problem is not related to a compiler
problem, but I've already (I think) demonstrated that the 2.0.0 compiler on
SPARC has problems with the 2.0.2 sources. I've got a horrid feeling that once
the missing stuff is fixed I'll hit the same problem :-(



Such problem will need to be fixed anyway, maybe with some ifdefs in the RTL. So it 
is a good thing you find them, as long as you fix them in the latest source.


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


Re: [fpc-pascal] Compiling FPC for SPARC

2006-08-03 Thread Tomas Hajny
Mark Morgan Lloyd wrote:
> Jonas Maebe wrote:
>
>> > The only thing that bothers me here is that while this is the
>> > correct solution
>> > it might not be possible. With the major caveat that I'm a beginner
>> > at this but
>> > I've demonstrated that 2.0.0 can't compile 2.0.2, and I suspect
>> > that once I've
>> > fixed the missing syscall I still might be left with something that
>> > the existing
>> > compiler can't process :-(
>>
>> This is not a case of something the existing compiler cannot process,
>> but a platform-specific include file which was not updated while
>> others were. The SPARC exit_group syscall is 188 according to
>>http://lxr.linux.no/source/include/asm-sparc/unistd.h#L207
>>
>> But yes, it's possible you'll find a few more things like this before
>> everything compiles, since the SPARC/Linux port has not been
>> maintained for a while.
>
> Working on it. I know that this particular problem is not related to a
> compiler
> problem, but I've already (I think) demonstrated that the 2.0.0 compiler
> on
> SPARC has problems with the 2.0.2 sources. I've got a horrid feeling that
> once
> the missing stuff is fixed I'll hit the same problem :-(

Even if you hit the same problem with 2.0.4, you should still better try
it with the latest available compiler (e.g. 2.0.4-rc2 or snapshot compiled
from the current SVN sources) and try to fix possibly existing issues in
that one (either directly yourself or by discussing with other people who
can provide more insight in the technical details) rather than trying to
create non-existing 2.0.2 SPARC compiler, because the problem might still
exist in 2.0.2, but could be e.g. resolved in 2.0.4 or the current 2.1.1
sources. Trying to fix the history usually doesn't work very well, you
know. ;-)

Tomas

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


Re: [fpc-pascal] Compiling FPC for SPARC

2006-08-03 Thread Mark Morgan Lloyd
Peter Vreman wrote:

> 2.0.4 (and also the current 2.1.1) can still be build by 2.0.0.

Sure- on an Intel platform.

Running on i386- I've just had another session and can confirm that 2.0.2 can
build both its own sources and those of 2.0.4, so my earlier problem was
definitely something to do with the User Mode Linux kernel. I'll investigate
that at some indeterminate point in the future if I have to (UML is useful once
you're used to having it).

On SPARC- specifically, a 32-bit SPARCstation- trying to compile 2.0.2 using
2.0.0 results in an exception. I've just checked that again and can confirm
that. However it occurs to me that it could possibly be the same problem as in
the 2.0.4 source but for some reason the error handling is bombing.

Whatever, I'll move onto the 2.0.4 source as suggested and see if I can do
anything useful there. I'll also investigate building a cross-compiler.

I'm hoping to have a couple of newer machines in a few days courtesy of a
certain hardware manufacturer who is interested in keeping open source projects
going.

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Compiling FPC for SPARC

2006-08-03 Thread Mark Morgan Lloyd
OK, 4x calls missing as below

1 1>[EMAIL PROTECTED]:~/pascal/src/fpcsrc/rtl/linux/sparc$ diff -u sysnr.inc~
sysnr.inc
--- sysnr.inc~  2006-02-15 07:19:26.0 +
+++ sysnr.inc   2006-08-03 13:49:10.0 +
@@ -207,14 +207,14 @@
   syscall_nr_setpgid  = 185 ; // Common
 //   syscall_nr_pathconf  = 186SunOS Specific
   syscall_nr_tkill= 187 ; // SunOS: fpathconf
-//   syscall_nr_sysconf   = 188SunOS Specific
+  syscall_nr_exit_group   = 188 ; // SunOS sysconf
   syscall_nr_uname= 189 ; // Linux Specific
   syscall_nr_init_module  = 190 ; // Linux Specific
   syscall_nr_personality  = 191 ; // Linux Specific
 //   syscall_nr_prof  = 192Linux Specific
-//   syscall_nr_break = 193Linux Specific
-//   syscall_nr_lock  = 194Linux Specific
-//   syscall_nr_mpx   = 195Linux Specific
+  syscall_nr_epoll_create = 193 ; // Linux Specific - was break
+  syscall_nr_epoll_ctl= 194 ; // Linux Specific - was lock
+  syscall_nr_epoll_wait   = 195 ; // Linux Specific - was mpx
 //   syscall_nr_ulimit= 196Linux Specific
   syscall_nr_getppid  = 197 ; // Linux Specific
   syscall_nr_sigaction= 198 ; // Linux Specific

I think I've got those right, I was referring to
/usr/include/asm-sparc/unistd.h. Can't find them in the 2.4 kernel tree so I
assume they're 2.6-specific.


Compilation (make cycle) now progresses beyond that one and gets to this:

/home/markMLl/pascal/src/fpcsrc/compiler/ppc1 -Fi../inc -Fi../sparc -Fi../unix
-Fisparc -FE. -FU../../rtl/units/sparc-linux -dsparc -Us -Sg system.pp
Free Pascal Compiler version 2.0.4-rc2 [2006/08/03] for sparc
Copyright (c) 1993-2006 by Florian Klaempfl
Target OS: Linux for SPARC
Compiling system.pp
generic.inc(559,13) Warning: Mixing signed expressions and longwords gives a
64bit result
genmath.inc(286,9) Warning: unreachable code
genmath.inc(299,8) Warning: unreachable code
astrings.inc(157,5) Fatal: Internal error 200310092
astrings.inc(157,5) Fatal: Compilation aborted
make[5]: *** [system.ppu] Error 1
make[5]: Leaving directory `/home/markMLl/pascal/src/fpcsrc/rtl/linux'
make[4]: *** [linux_all] Error 2

As discussed earlier I was starting off with the released 2.0.0 compiler. Source
files from fpcbuild_2_0_4_rc2.zip downloaded about 24 hours ago- I've got
limited free bandwidth here.

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Compiling FPC for SPARC

2006-08-03 Thread Jonas Maebe


On 3 aug 2006, at 16:10, Mark Morgan Lloyd wrote:

As discussed earlier I was starting off with the released 2.0.0  
compiler. Source
files from fpcbuild_2_0_4_rc2.zip downloaded about 24 hours ago-  
I've got

limited free bandwidth here.


I can reproduce the problem under SPARC/Solaris. I'll try to get at  
least that one compiling (don't have access to a sparc/linux machine)  
and commit the needed patches.



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


[fpc-pascal] Abstract class implementation on different platforms

2006-08-03 Thread Graeme Geldenhuys

Hi,

How do I do the following using FPC with Makefile's or a Lazarus Package?

I have a TGfxCanvas abstract class (something like the TFPCustomCanvas
class in the graphics.pp unit) and it gets implemented differently for
different platforms. Currently Win32 and X11, but others will follow
later.

How do I structure my source directories and units so that I can
compile my library under both platforms with the same Makefile or
Lazarus Package.

At the moment I have two different Lazarus Packages. One for each
platform, but this is really not ideal, because if an application uses
the Linux package, all is fine.  Now if you want to compile that
project under Windows, you need to change the Project Requirement, to
now include the Windows package.  :-(

I don't want to use IFDEF's in my code if possible.  A bad example is
the gfxbase.pp unit in Lazarus's LCL, which I think is a nightmare...
It is full of {$IFDEF Win32} ... {$else}  statements.  What
happens to all that code, when more platforms get added?

At the moment my library is in the following directory structure:

src/
  /common <- some common units for all platforms.
  /x11 <- X11 implementation of TGfxBase
 /gfximpl.pp
 /gfx_x11.pp
  /win32gdi  <- win32 implementation of TGfxBase
 /gfximpl.pp
 /gfx_gdi.pp
  /gfxbase.pp   <- initial library unit (start of project)


The library includes a unit called "gfximpl.pp" which gets set
differently for each platform, aliasing the classes to a common
classname.

example "gfximpl.pp" for X11:
 type
   TDefWindow = TXWindow;
   TDefDisplay = TXDisplay;

example "gfximpl.pp" for Win32 GDI:
 type
   TDefWindow = TGDIWindow;
   TDefDisplay = TGDIDisplay;


So now any project using this library can refer to TDefWindow, and
depending on which platform it was compiled, it will include the
correct implementation of TGfxCanvas.
I still have the issue with the Lazarus Packages though. Each platform
needs a different search path to find the "gfximpl" unit, hence the
two packages (one for each platform).

Is there a better way to do this?  Makefiles or Lazarus Packages?
Surely it is done somehow in FPC considering it supports so many
platforms...

Many thanks for any help.

Regards,
 - Graeme -


--
There's no place like 127.0.0.1
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Compiling FPC for SPARC

2006-08-03 Thread Mark Morgan Lloyd
Jonas Maebe wrote:

> I can reproduce the problem under SPARC/Solaris. I'll try to get at
> least that one compiling (don't have access to a sparc/linux machine)
> and commit the needed patches.

Thanks, every bit helps. I'm hoping to look at Solaris at some point but I've
only got v8 running here at present- I'm hoping there'll be a v10 with the new
machines.

Please could you let me know when/where the fixes are- I'll try and progress
some other work in the interim.

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Compiling FPC for SPARC

2006-08-03 Thread Jonas Maebe


On 3 aug 2006, at 17:14, Mark Morgan Lloyd wrote:

Thanks, every bit helps. I'm hoping to look at Solaris at some  
point but I've
only got v8 running here at present- I'm hoping there'll be a v10  
with the new

machines.


Don't bother with Solaris in 2.0.x, it won't work at all. None of the  
Solaris fixes from 2.1.1 have been merged (some date back to  
February). I've attached a patch which enables me to compile at least  
the rtl and the compiler (and fixing sparc actually made me discover  
a quite serious generic bug) for Sparc/Linux. I can't test whether  
the result actually runs though, since I don't have access to a Sparc/ 
Linux system.


The diff was taken from the root of the fpcsrc directory.


Jonas


sparc.patch
Description: Binary data
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

[fpc-pascal] Re: [lazarus] Abstract class implementation on different platforms

2006-08-03 Thread Graeme Geldenhuys

Apologies!  That unit came from a different project (LPTK) and not
Lazarus.  To many files open at once in the editor.

Regards,
 Graeme


On 8/3/06, Vincent Snijders <[EMAIL PROTECTED]> wrote:

Graeme Geldenhuys schreef:
> I don't want to use IFDEF's in my code if possible.  A bad example is
> the gfxbase.pp unit in Lazarus's LCL, which I think is a nightmare...
> It is full of {$IFDEF Win32} ... {$else}  statements.  What
> happens to all that code, when more platforms get added?

gfxbase.pp?

Vincent




--
There's no place like 127.0.0.1
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: Minor issue compiling FPC from sources [fpc-pascal]

2006-08-03 Thread Eugene Mayevski
Hello!
You (Пётр Косаревский с mail.ru
[mailto:[EMAIL PROTECTED]) wrote about "Re[2]: Minor
issue compiling FPC from sources [fpc-pascal]" on 08/3/2006 at 00:16:

ПК> Well, there is a system command "echo" under windows, there is "echo"
ПК> program in "cygwin" (so, I guess it is present in most unices), so you
ПК> have unusual system.

Thanks, now I know where to look :). Most likely, it's incomplete set of
cygwin tools, that causes troubles. 

Sincerely yours,
Eugene Mayevski

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