View Issue Details

IDProjectCategoryView StatusLast Update
0024846LazarusPatchpublic2013-12-21 18:00
ReporterMark Morgan LloydAssigned ToMartin Friebe 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformPPC, SPARCOSLinuxOS Version
Product Version1.0.11 (SVN)Product Build 
Target Version1.1 (SVN)Fixed in Version1.1 (SVN) 
Summary0024846: Lazarus trunk fails to build for PPC Linux and for SPARC.
DescriptionAttached patch allows trunk to build for PPC Linux, at the expense of a one-time dialog(ue) warning at startup. Tested OK.

It also allows SPARC Linux to build, not fully tested due to other runtime issues.

TagsNo tags attached.
Fixed in Revision42381
LazTarget1.2
WidgetsetGTK 2
Attached Files
  • ppc-sparc-linux.diff (3,141 bytes)
    --- ./components/PascalScript/Source/uPSRuntime.pas~	2013-08-08 13:46:57.000000000 +0000
    +++ ./components/PascalScript/Source/uPSRuntime.pas	2013-08-08 13:47:16.000000000 +0000
    @@ -11489,7 +11489,7 @@
     {$ENDIF}
     
     {$ifdef fpc}
    -  {$if defined(cpupowerpc) or defined(cpuarm) or defined(cpu64)}
    +  {$if defined(cpupowerpc) or defined(cpuarm) or defined(cpu64) or defined(cpusparc)}
         {$define empty_methods_handler}
       {$ifend}
     {$endif}
    
    
    --- ./components/PascalScript/Source/powerpc.inc~	2013-08-08 13:46:55.000000000 +0000
    +++ ./components/PascalScript/Source/powerpc.inc	2013-08-09 08:31:45.000000000 +0000
    @@ -1,14 +1,6 @@
     { implementation of the powerpc osx abi for function calls in pascal script
       Copyright (c) 2007 by Henry Vermaak (henry.vermaak@gmail.com) }
     
    -{$ifndef darwin}
    -  {$fatal This code is Darwin specific at the moment!}
    -{$endif}
    -
    -{$ifndef cpu32}
    -  {$fatal This code is 32bit specific at the moment!}
    -{$endif}
    -
     // FPC does not always push a copy of r3 - r10 to the stack (24(r1) - 52(r1)
     // The API states that the space must be reserved, if the regiser contents are not placed there.
     {$define NeedRegCopyOnStack}
    @@ -266,6 +258,15 @@
       end;
     
     begin
    +
    +{$ifndef darwin}
    +  raise exception.create('This code is Darwin specific at the moment!');
    +{$endif}
    +
    +{$ifndef cpu32}
    +  raise exception.create('This code is 32bit specific at the moment!');
    +{$endif}
    +
       if (Integer(CallingConv) and 64) <> 0 then begin
         IsConstructor := true;
         CAllingConv := TPSCallingConvention(Integer(CallingConv) and not 64);
    
    
    --- ./components/PascalScript/Source/sparc.inc~	2013-08-08 13:46:56.000000000 +0000
    +++ ./components/PascalScript/Source/sparc.inc	2013-08-08 13:47:07.000000000 +0000
    @@ -0,0 +1,53 @@
    +{ Dummy file for SPARC, based on the
    +  implementation of the powerpc osx abi for function calls in pascal script
    +  Copyright (c) 2007 by Henry Vermaak (henry.vermaak@gmail.com) }
    +
    +// FPC does not always push a copy of r3 - r10 to the stack (24(r1) - 52(r1)
    +// The API states that the space must be reserved, if the regiser contents are not placed there.
    +{$define NeedRegCopyOnStack}
    +
    +const
    +  rtINT = 0;
    +  rtINT64 = 1;
    +  rtFLOAT = 2;
    +
    +type
    +  Trint = array[1..8] of dword;
    +  Trfloat = array[1..13] of double;
    +
    +{ call a function from a pointer }
    +{ resulttype: 0 = int, 1 = int64, 2 = float }
    +function ppcasmcall(rint: Trint; rfloat: Trfloat; proc, stack: pointer; stacksize, resulttype: integer): pointer; { assembler; nostackframe; }
    +
    +begin
    +  result := nil
    +end;
    +
    +function FlipHiLo(v: byte): byte;
    +var
    +  i: integer;
    +  j, k: byte;
    +begin
    +  Result := 0;
    +  k := $80;
    +  j := $01;
    +  for i := 0 to 7 do begin
    +    if (v and k) <> 0 then
    +      Result := Result or j;
    +    k := k div 2;
    +    j := j * 2;
    +  end;
    +end;
    +
    +function TPSExec.InnerfuseCall(_Self, Address: Pointer; CallingConv: TPSCallingConvention; Params: TPSList; res: PPSVariantIFC): Boolean;
    +
    +begin
    +
    +  raise exception.create('This code is not supported on SPARC at the moment!');
    +
    +{$ifndef cpu32}
    +  raise exception.create('This code is 32bit specific at the moment!');
    +{$endif}
    +
    +  Result := True;
    +end;
    
    ppc-sparc-linux.diff (3,141 bytes)

Activities

Mark Morgan Lloyd

2013-08-09 10:40

reporter  

ppc-sparc-linux.diff (3,141 bytes)
--- ./components/PascalScript/Source/uPSRuntime.pas~	2013-08-08 13:46:57.000000000 +0000
+++ ./components/PascalScript/Source/uPSRuntime.pas	2013-08-08 13:47:16.000000000 +0000
@@ -11489,7 +11489,7 @@
 {$ENDIF}
 
 {$ifdef fpc}
-  {$if defined(cpupowerpc) or defined(cpuarm) or defined(cpu64)}
+  {$if defined(cpupowerpc) or defined(cpuarm) or defined(cpu64) or defined(cpusparc)}
     {$define empty_methods_handler}
   {$ifend}
 {$endif}


--- ./components/PascalScript/Source/powerpc.inc~	2013-08-08 13:46:55.000000000 +0000
+++ ./components/PascalScript/Source/powerpc.inc	2013-08-09 08:31:45.000000000 +0000
@@ -1,14 +1,6 @@
 { implementation of the powerpc osx abi for function calls in pascal script
   Copyright (c) 2007 by Henry Vermaak (henry.vermaak@gmail.com) }
 
-{$ifndef darwin}
-  {$fatal This code is Darwin specific at the moment!}
-{$endif}
-
-{$ifndef cpu32}
-  {$fatal This code is 32bit specific at the moment!}
-{$endif}
-
 // FPC does not always push a copy of r3 - r10 to the stack (24(r1) - 52(r1)
 // The API states that the space must be reserved, if the regiser contents are not placed there.
 {$define NeedRegCopyOnStack}
@@ -266,6 +258,15 @@
   end;
 
 begin
+
+{$ifndef darwin}
+  raise exception.create('This code is Darwin specific at the moment!');
+{$endif}
+
+{$ifndef cpu32}
+  raise exception.create('This code is 32bit specific at the moment!');
+{$endif}
+
   if (Integer(CallingConv) and 64) <> 0 then begin
     IsConstructor := true;
     CAllingConv := TPSCallingConvention(Integer(CallingConv) and not 64);


--- ./components/PascalScript/Source/sparc.inc~	2013-08-08 13:46:56.000000000 +0000
+++ ./components/PascalScript/Source/sparc.inc	2013-08-08 13:47:07.000000000 +0000
@@ -0,0 +1,53 @@
+{ Dummy file for SPARC, based on the
+  implementation of the powerpc osx abi for function calls in pascal script
+  Copyright (c) 2007 by Henry Vermaak (henry.vermaak@gmail.com) }
+
+// FPC does not always push a copy of r3 - r10 to the stack (24(r1) - 52(r1)
+// The API states that the space must be reserved, if the regiser contents are not placed there.
+{$define NeedRegCopyOnStack}
+
+const
+  rtINT = 0;
+  rtINT64 = 1;
+  rtFLOAT = 2;
+
+type
+  Trint = array[1..8] of dword;
+  Trfloat = array[1..13] of double;
+
+{ call a function from a pointer }
+{ resulttype: 0 = int, 1 = int64, 2 = float }
+function ppcasmcall(rint: Trint; rfloat: Trfloat; proc, stack: pointer; stacksize, resulttype: integer): pointer; { assembler; nostackframe; }
+
+begin
+  result := nil
+end;
+
+function FlipHiLo(v: byte): byte;
+var
+  i: integer;
+  j, k: byte;
+begin
+  Result := 0;
+  k := $80;
+  j := $01;
+  for i := 0 to 7 do begin
+    if (v and k) <> 0 then
+      Result := Result or j;
+    k := k div 2;
+    j := j * 2;
+  end;
+end;
+
+function TPSExec.InnerfuseCall(_Self, Address: Pointer; CallingConv: TPSCallingConvention; Params: TPSList; res: PPSVariantIFC): Boolean;
+
+begin
+
+  raise exception.create('This code is not supported on SPARC at the moment!');
+
+{$ifndef cpu32}
+  raise exception.create('This code is 32bit specific at the moment!');
+{$endif}
+
+  Result := True;
+end;
ppc-sparc-linux.diff (3,141 bytes)

Martin Friebe

2013-08-10 13:43

manager   ~0069312

thanks for the patch

please test and close if ok.


I made some changes to the proposed patch:
- sparc.inc was not referred at all, so I added the necessary code in upsruntime
- I changed the macro script,not to warn, in case of unsuported

Mark Morgan Lloyd

2013-08-11 12:59

reporter   ~0069331

> sparc.inc was not referred at all, so I added the necessary code in upsruntime

That would be because I did the final test on a PPC system, and obviously didn't move across everything I should have. Will test on SPARC but not today.

Mark Morgan Lloyd

2013-11-22 20:16

reporter   ~0071499

Using FPC 2.6.2, trunk builds OK on SPARC, but doesn't run due to issue 23703.

Mark Morgan Lloyd

2013-12-21 18:00

reporter   ~0072003

Believed OK now that 23703 is resolved.

Issue History

Date Modified Username Field Change
2013-08-09 10:40 Mark Morgan Lloyd New Issue
2013-08-09 10:40 Mark Morgan Lloyd File Added: ppc-sparc-linux.diff
2013-08-09 15:52 Martin Friebe Assigned To => Martin Friebe
2013-08-09 15:52 Martin Friebe Status new => assigned
2013-08-10 13:43 Martin Friebe Fixed in Revision => 42381
2013-08-10 13:43 Martin Friebe LazTarget => 1.2
2013-08-10 13:43 Martin Friebe Note Added: 0069312
2013-08-10 13:43 Martin Friebe Status assigned => resolved
2013-08-10 13:43 Martin Friebe Fixed in Version => 1.1 (SVN)
2013-08-10 13:43 Martin Friebe Resolution open => fixed
2013-08-10 13:43 Martin Friebe Target Version => 1.1 (SVN)
2013-08-11 12:59 Mark Morgan Lloyd Note Added: 0069331
2013-11-22 20:16 Mark Morgan Lloyd Note Added: 0071499
2013-12-21 18:00 Mark Morgan Lloyd Note Added: 0072003
2013-12-21 18:00 Mark Morgan Lloyd Status resolved => closed