Просмотр исходного кода

# revisions: 44426,44562,45115,45371,45375,45511,44641,44559,47746

git-svn-id: branches/fixes_3_2@47934 -
marco 4 лет назад
Родитель
Сommit
fd02f9b727

+ 1 - 0
.gitattributes

@@ -962,6 +962,7 @@ packages/amunits/Makefile svneol=native#text/plain
 packages/amunits/Makefile.fpc svneol=native#text/plain
 packages/amunits/Makefile.fpc.fpcmake svneol=native#text/plain
 packages/amunits/README.txt svneol=native#text/plain
+packages/amunits/examples/amicube.pas svneol=native#text/plain
 packages/amunits/examples/asltest.pas svneol=native#text/plain
 packages/amunits/examples/bezier.pas svneol=native#text/plain
 packages/amunits/examples/bezier2.pas svneol=native#text/plain

+ 8 - 3
compiler/systems/t_amiga.pas

@@ -82,7 +82,7 @@ begin
      end
     else
      begin
-      ExeCmd[1]:='vlink -b amigahunk $GCSECTIONS $OPT $STRIP -o $EXE -T $RES';
+      ExeCmd[1]:='vlink -b amigahunk -e_start $MAP $GCSECTIONS $OPT $STRIP -o $EXE -T $RES';
      end;
    end;
 end;
@@ -97,7 +97,7 @@ begin
      end
     else
      begin
-      ExeCmd[1]:='vlink -q -n -b elf32amigaos -P_start -P__amigaos4__ -nostdlib $GCSECTIONS $OPT $STRIP -o $EXE -T $RES';
+      ExeCmd[1]:='vlink -q -n -b elf32amigaos -P_start -P__amigaos4__ -nostdlib $MAP $GCSECTIONS $OPT $STRIP -o $EXE -T $RES';
      end;
   end;
 end;
@@ -347,11 +347,15 @@ var
   StripStr: string[40];
   DynLinkStr : string;
   GCSectionsStr : string;
+  MapStr: string;
 begin
   StripStr:='';
   GCSectionsStr:='';
   DynLinkStr:='';
+  MapStr:='';
 
+  if UseVlink and (cs_link_map in current_settings.globalswitches) then
+    MapStr:='-M'+Unix2AmigaPath(maybequoted(ScriptFixFilename(current_module.mapfilename)));
   if (cs_link_strip in current_settings.globalswitches) then
     StripStr:='-s';
   if rlinkpath<>'' Then
@@ -359,7 +363,7 @@ begin
   if UseVLink then
     begin
       if create_smartlink_sections then
-        GCSectionsStr:='-gc-all -sc -sd';
+        GCSectionsStr:='-gc-all -mtype';
     end;
 
   { Call linker }
@@ -368,6 +372,7 @@ begin
   Replace(cmdstr,'$OPT',Info.ExtraOptions);
   Replace(cmdstr,'$EXE',Unix2AmigaPath(maybequoted(ScriptFixFileName(current_module.exefilename))));
   Replace(cmdstr,'$RES',Unix2AmigaPath(maybequoted(ScriptFixFileName(outputexedir+Info.ResName))));
+  Replace(cmdstr,'$MAP',MapStr);
   Replace(cmdstr,'$STRIP',StripStr);
   Replace(cmdstr,'$GCSECTIONS',GCSectionsStr);
   Replace(cmdstr,'$DYNLINK',DynLinkStr);

+ 339 - 0
packages/amunits/examples/amicube.pas

@@ -0,0 +1,339 @@
+{
+    Copyright (c) 2020 Karoly Balogh
+
+    Rotating 3D cube in a Workbench window
+    Example program for Free Pascal's Amiga bindings
+    on legacy systems (OS1.x)
+
+    This example program is in the Public Domain under the terms of
+    Unlicense: http://unlicense.org/
+
+ **********************************************************************}
+{$MEMORY 32768,4096}
+program amicube;
+
+uses
+  exec, intuition, agraphics;
+
+type
+  tvertex = record
+    x: longint;
+    y: longint;
+    z: longint;
+    pad: longint;
+  end;
+
+const
+  cube: array[0..7] of tvertex = (
+     ( x: -1; y: -1; z: -1; pad: 0), // 0
+     ( x:  1; y: -1; z: -1; pad: 0), // 1
+     ( x:  1; y:  1; z: -1; pad: 0), // 2
+     ( x: -1; y:  1; z: -1; pad: 0), // 3
+
+     ( x: -1; y: -1; z:  1; pad: 0), // 4
+     ( x:  1; y: -1; z:  1; pad: 0), // 5
+     ( x:  1; y:  1; z:  1; pad: 0), // 6
+     ( x: -1; y:  1; z:  1; pad: 0)  // 7
+  );
+
+type
+  tface = record
+    v1, v2, v3: longint;
+    edge: longint;
+  end;
+
+const
+  faces: array[0..11] of tface = (
+    ( v1: 0; v2: 2; v3: 1; edge: 6),  // front
+    ( v1: 2; v2: 0; v3: 3; edge: 6),
+
+    ( v1: 0; v2: 1; v3: 4; edge: 5),  // top
+    ( v1: 1; v2: 5; v3: 4; edge: 3),
+
+    ( v1: 3; v2: 0; v3: 7; edge: 5),  // left
+    ( v1: 0; v2: 4; v3: 7; edge: 3),
+
+    ( v1: 1; v2: 2; v3: 5; edge: 5),  // right
+    ( v1: 1; v2: 6; v3: 5; edge: 6),
+
+    ( v1: 2; v2: 3; v3: 6; edge: 5),  // bottom
+    ( v1: 3; v2: 7; v3: 6; edge: 3),
+
+    ( v1: 4; v2: 5; v3: 6; edge: 3),  // back
+    ( v1: 6; v2: 7; v3: 4; edge: 3)
+  );
+
+const
+  sincos_table: array[0..255] of longint = (
+         0,  1608,  3216,  4821,  6424,  8022,  9616, 11204,
+     12785, 14359, 15924, 17479, 19024, 20557, 22078, 23586,
+     25079, 26557, 28020, 29465, 30893, 32302, 33692, 35061,
+     36409, 37736, 39039, 40319, 41575, 42806, 44011, 45189,
+     46340, 47464, 48558, 49624, 50659, 51664, 52638, 53580,
+     54490, 55367, 56211, 57021, 57797, 58537, 59243, 59913,
+     60546, 61144, 61704, 62227, 62713, 63161, 63571, 63943,
+     64276, 64570, 64826, 65042, 65219, 65357, 65456, 65515,
+     65535, 65515, 65456, 65357, 65219, 65042, 64826, 64570,
+     64276, 63943, 63571, 63161, 62713, 62227, 61704, 61144,
+     60546, 59913, 59243, 58537, 57797, 57021, 56211, 55367,
+     54490, 53580, 52638, 51664, 50659, 49624, 48558, 47464,
+     46340, 45189, 44011, 42806, 41575, 40319, 39039, 37736,
+     36409, 35061, 33692, 32302, 30893, 29465, 28020, 26557,
+     25079, 23586, 22078, 20557, 19024, 17479, 15924, 14359,
+     12785, 11204,  9616,  8022,  6424,  4821,  3216,  1608,
+         0, -1608, -3216, -4821, -6424, -8022, -9616,-11204,
+    -12785,-14359,-15924,-17479,-19024,-20557,-22078,-23586,
+    -25079,-26557,-28020,-29465,-30893,-32302,-33692,-35061,
+    -36409,-37736,-39039,-40319,-41575,-42806,-44011,-45189,
+    -46340,-47464,-48558,-49624,-50659,-51664,-52638,-53580,
+    -54490,-55367,-56211,-57021,-57797,-58537,-59243,-59913,
+    -60546,-61144,-61704,-62227,-62713,-63161,-63571,-63943,
+    -64276,-64570,-64826,-65042,-65219,-65357,-65456,-65515,
+    -65535,-65515,-65456,-65357,-65219,-65042,-64826,-64570,
+    -64276,-63943,-63571,-63161,-62713,-62227,-61704,-61144,
+    -60546,-59913,-59243,-58537,-57797,-57021,-56211,-55367,
+    -54490,-53580,-52638,-51664,-50659,-49624,-48558,-47464,
+    -46340,-45189,-44011,-42806,-41575,-40319,-39039,-37736,
+    -36409,-35061,-33692,-32302,-30893,-29465,-28020,-26557,
+    -25079,-23586,-22078,-20557,-19024,-17479,-15924,-14359,
+    -12785,-11204, -9616, -8022, -6424, -4821, -3216, -1608
+  );
+
+function sin(x: longint): longint; inline;
+begin
+  sin:=sincos_table[x and 255];
+end;
+
+function cos(x: longint): longint; inline;
+begin
+  cos:=sincos_table[(x + 64) and 255];
+end;
+
+function mulfp(a, b: longint): longint; inline;
+begin
+  mulfp:=sarint64((int64(a) * b),16);
+end;
+
+function divfp(a, b: longint): longint;
+begin
+  divfp:=(int64(a) shl 16) div b;
+end;
+
+procedure rotate_vertex(const v: tvertex; var vr: tvertex; xa, ya, za: longint);
+var
+  x,y,z: longint;
+  s,c: longint;
+begin
+  s   :=sin(ya);
+  c   :=cos(ya);
+  x   :=mulfp(c,v.x) - mulfp(s,v.z);
+  z   :=mulfp(s,v.x) + mulfp(c,v.z);
+  if za <> 0 then
+    begin
+      vr.x:=mulfp(cos(za),x)   + mulfp(sin(za),v.y);
+      y   :=mulfp(cos(za),v.y) - mulfp(sin(za),x);
+    end
+  else
+    begin
+      vr.x:=x;
+      y:=v.y;
+    end;
+  vr.z:=mulfp(cos(xa),z)   - mulfp(sin(xa),y);
+  vr.y:=mulfp(sin(xa),z)   + mulfp(cos(xa),y);
+end;
+
+procedure perspective_vertex(const v: tvertex; zc: longint; var xr,yr: longint);
+var
+  rzc: longint;
+begin
+  rzc:=divfp(1 shl 16,(v.z - zc));
+  xr:=mulfp(mulfp(v.x,zc),rzc);
+  yr:=mulfp(mulfp(v.y,zc),rzc);
+end;
+
+procedure init_cube;
+var
+  i: longint;
+begin
+  for i:=low(cube) to high(cube) do
+    begin
+      cube[i].x:=cube[i].x shl 16;
+      cube[i].y:=cube[i].y shl 16;
+      cube[i].z:=cube[i].z shl 16;
+    end;
+end;
+
+const
+  win_info: array[0..63] of char = '';
+
+var
+  win: PWindow;
+
+const
+  IDCMPS = IDCMP_CLOSEWINDOW or IDCMP_NEWSIZE or IDCMP_INTUITICKS;
+  WFLGS = WFLG_DRAGBAR or WFLG_DEPTHGADGET or WFLG_CLOSEGADGET or WFLG_SIZEGADGET or WFLG_ACTIVATE or WFLG_NOCAREREFRESH;
+  WINTITLE = 'FPC Amiga Cube';
+
+const
+  winlayout: TNewWindow = (
+    LeftEdge: 20;
+    TopEdge: 20;
+    Width: 240;
+    Height: 150;
+    DetailPen: 0;
+    BlockPen: 1;
+    IDCMPFlags: IDCMPS;
+    Flags: WFLGS;
+    FirstGadget: nil;
+    CheckMark: nil;
+    Title: WINTITLE;
+    Screen: nil;
+    BitMap: nil;
+    MinWidth: 0;
+    MinHeight: 0;
+    MaxWidth: 320;
+    MaxHeight: 200;
+    WType: WBENCHSCREEN_F;
+  );
+
+function open_win: PWindow;
+var
+  newwin: TNewWindow;
+begin
+  newwin:=winlayout;
+  open_win:=OpenWindow(@newwin);
+end;
+
+function min(a, b: smallint): smallint;
+begin
+  if a < b then
+    min:=a
+  else
+    min:=b;
+end;
+
+procedure win_redraw(mx, my: longint);
+var
+  sx,sy: string[16];
+  i,cx,cy,vx,vy: longint;
+  rcube: array[low(cube)..high(cube)] of tvertex;
+  vr: tvertex;
+  scale: longint;
+  wx,wy,ww,wh: longint;
+begin
+  wx:=win^.borderleft;
+  ww:=win^.width-(win^.borderleft+win^.borderright);
+  wy:=win^.bordertop;
+  wh:=win^.height-(win^.bordertop+win^.borderbottom);
+
+  scale:=(min(wh,ww) div 4) shl 16;
+  cx:=wx + ww div 2;
+  cy:=wy + wh div 2;
+  for i:=low(cube) to high(cube) do
+    begin
+      rotate_vertex(cube[i],vr,-my,-mx,0);
+      perspective_vertex(vr,3 shl 16,vx,vy);
+      rcube[i].x:=cx + sarlongint(mulfp(vx,scale),16);
+      rcube[i].y:=cy + sarlongint(mulfp(vy,scale div 2),16);
+      // the div 2 part above is a hack, to make the cube look
+      // less distorted on a 640x256 screen...
+    end;
+
+  str(mx,sx);
+  str(my,sy);
+  win_info:='Spinning... X:'+sx+' Y:'+sy;
+
+  SetAPen(win^.rport,0);
+  RectFill(win^.rport,wx,wy,wx+ww,wy+wh);
+  SetAPen(win^.rport,1);
+  gfxMove(win^.rport,wx+5,wy+10);
+
+  gfxText(win^.rport, win_info, strlen(win_info));
+
+  for i:=low(faces) to high(faces) do
+    begin
+      with faces[i] do
+        begin
+          if (edge and 1) > 0 then
+            begin
+              gfxMove(win^.rport,rcube[v1].x,rcube[v1].y);
+              draw(win^.rport,rcube[v2].x,rcube[v2].y);
+            end;
+          if (edge and 2) > 0 then
+            begin
+              gfxMove(win^.rport,rcube[v2].x,rcube[v2].y);
+              draw(win^.rport,rcube[v3].x,rcube[v3].y);
+            end;
+          if (edge and 4) > 0 then
+            begin
+              gfxMove(win^.rport,rcube[v3].x,rcube[v3].y);
+              draw(win^.rport,rcube[v1].x,rcube[v1].y);
+            end;
+        end;
+    end;
+end;
+
+procedure event_loop;
+var
+  quit: boolean;
+  IMsg: PIntuiMessage;
+
+  //ICode: Word;
+  //IQual: Word;
+  IClass: LongWord;
+  MouseX: LongInt;
+  MouseY: LongInt;
+  OldMouseX: LongInt;
+  OldMouseY: LongInt;
+begin
+  quit:=false;
+  OldMouseX:=-1;
+  OldMouseY:=-1;
+
+  repeat
+    IMsg:=PIntuiMessage(WaitPort(win^.UserPort));
+    IMsg:=PIntuiMessage(GetMsg(win^.UserPort));
+    while IMsg <> nil do
+      begin
+        //ICode:=IMsg^.Code;
+        //IQual:=IMsg^.Qualifier;
+        IClass:=IMsg^.iClass;
+        MouseX:=IMsg^.MouseX;
+        MouseY:=IMsg^.MouseY;
+        ReplyMsg(PMessage(IMsg));
+
+        case IClass of
+            IDCMP_NEWSIZE:
+                begin
+                  win_redraw(OldMouseX,OldMouseY);
+                end;
+            IDCMP_CLOSEWINDOW:
+                begin
+                  quit:=true;
+                end;
+            IDCMP_INTUITICKS:
+                begin
+                  if (MouseX <> OldMouseX) or (MouseY <> OldMouseY) then
+                    begin
+                      OldMouseX:=MouseX;
+                      OldMouseY:=MouseY;
+                      win_redraw(OldMouseX,OldMouseY);
+                    end;
+                end;
+        end;
+
+        IMsg:=PIntuiMessage(GetMsg(win^.UserPort));
+      end;
+  until quit;
+end;
+
+begin
+  init_cube;
+
+  win:=open_win;
+  if win <> nil then
+    begin
+      event_loop;
+      CloseWindow(win);
+    end;
+end.

+ 1 - 1
packages/amunits/src/coreunits/workbench.pas

@@ -852,7 +852,7 @@ VAR
 
 FUNCTION AddAppIconA(id : ULONG location 'd0'; userdata : ULONG location 'd1'; text_ : pCHAR location 'a0'; msgport : pMsgPort location 'a1'; lock : BPTR location 'a2'; diskobj : pDiskObject location 'a3'; const taglist : pTagItem location 'a4') : pAppIcon; syscall WorkbenchBase 060;
 FUNCTION AddAppMenuItemA(id : ULONG location 'd0'; userdata : ULONG location 'd1'; text_ : pCHAR location 'a0'; msgport : pMsgPort location 'a1'; const taglist : pTagItem location 'a2') : pAppMenuItem; syscall WorkbenchBase 072;
-FUNCTION AddAppWindowA(id : ULONG location 'd0'; userdata : ULONG location 'd1'; window : pWindow location 'a0'; msgport : pMsgPort location 'a1'; const taglist : pTagItem location 'a2') : pAppWindow; syscall WorkbenchBase 042;
+FUNCTION AddAppWindowA(id : ULONG location 'd0'; userdata : ULONG location 'd1'; window : pWindow location 'a0'; msgport : pMsgPort location 'a1'; const taglist : pTagItem location 'a2') : pAppWindow; syscall WorkbenchBase 048;
 FUNCTION RemoveAppIcon(appIcon : pAppIcon location 'a0') : longbool; syscall WorkbenchBase 066;
 FUNCTION RemoveAppMenuItem(appMenuItem : pAppMenuItem location 'a0') : longbool; syscall WorkbenchBase 078;
 FUNCTION RemoveAppWindow(appWindow : pAppWindow location 'a0') : longbool; syscall WorkbenchBase 054;

+ 3 - 3
packages/morphunits/src/exec.pas

@@ -2136,9 +2136,9 @@ function AllocPooled(poolHeader: Pointer  location 'a0';
                      memSize   : Cardinal location 'd0'): Pointer;
 SysCall MOS_ExecBase 708;
 
-function FreePooled(poolHeader: Pointer  location 'a0';
-                    memory    : Pointer  location 'a1';
-                    memSize   : Cardinal location 'd0'): Pointer;
+procedure FreePooled(poolHeader: Pointer  location 'a0';
+                     memory    : Pointer  location 'a1';
+                     memSize   : Cardinal location 'd0');
 SysCall MOS_ExecBase 714;
 
 function AttemptSemaphoreShared(sigSem: pSignalSemaphore location 'a0'): Cardinal;

+ 1 - 1
packages/morphunits/src/workbench.pas

@@ -466,7 +466,7 @@ var
 
 function AddAppIconA(Id: LongWord location 'd0'; UserData: LongWord location 'd1'; Text_: PChar location 'a0'; MsgPort: PMsgPort location 'a1'; Lock: BPTR location 'a2'; DiskObj: PDiskObject location 'a3'; const TagList: PTagItem location 'a4'): PAppIcon; syscall WorkbenchBase 060;
 function AddAppMenuItemA(Id: LongWord location 'd0'; UserData: LongWord location 'd1'; Text_: PChar location 'a0'; MsgPort: PMsgPort location 'a1'; const TagList: PTagItem location 'a2'): PAppMenuItem; syscall WorkbenchBase 072;
-function AddAppWindowA(Id: LongWord location 'd0'; UserData: LongWord location 'd1'; Window: PWindow location 'a0'; MsgPort: PMsgPort location 'a1'; const TagList: PTagItem location 'a2'): PAppWindow; syscall WorkbenchBase 042;
+function AddAppWindowA(Id: LongWord location 'd0'; UserData: LongWord location 'd1'; Window: PWindow location 'a0'; MsgPort: PMsgPort location 'a1'; const TagList: PTagItem location 'a2'): PAppWindow; syscall WorkbenchBase 048;
 function RemoveAppIcon(AppIcon: PAppIcon location 'a0'): LongBool; syscall WorkbenchBase 066;
 function RemoveAppMenuItem(AppMenuItem: PAppMenuItem location 'a0'): LongBool; syscall WorkbenchBase 078;
 function RemoveAppWindow(AppWindow: PAppWindow location 'a0'): LongBool; syscall WorkbenchBase 054;

+ 31 - 40
packages/os4units/src/amigados.pas

@@ -1407,46 +1407,37 @@ Type
        END;
 
 // COMBINED structure for all types.
-  PDosList = ^TDosList;
-  TDosList = record
-    dol_Next: BPTR;      // bptr to next device on list
-    dol_Type: LongInt;   // see DLT below
-    dol_Port: PMsgPort;  // ptr to handler task
-    case smallint of
-    0:(
-        dol_Device: record
-          dol_Reserved1: LongInt; // Reserved for use by DOS.
-          dol_Handler: BSTR;      // BSTR file name to LoadSeg if dol_Seglist = nil.
-          dol_StackSize: LongInt; // Stacksize to use when starting process.
-          dol_Priority: LongInt;  // Task priority when starting process
-          dol_Startup: BPTR;      // Startup msg: FileSysStartupMsg for disks
-          dol_SegList: BPTR;      // Already loaded seglist for new process.
-          dol_GlobVec: LongInt;   // Global vector locking method key (-1 or -2)
-        end;
-    );
-    1 : (
-        dol_Volume: record
-          dol_Reserved2: LongInt;     // Reserved for use by DOS.
-          dol_VolumeDate: TDateStamp; // creation date
-          dol_LockList: BPTR;         // Unused, leave as 0
-          dol_DiskType: LongInt;      // 'DOS\0' - 32 bit hex identity
-          dol_FSPrivate: LongInt;     // Used privately by filesystems.
-        end;
-    );
-    2 : (
-        dol_Assign       :  record
-          dol_Lock: BPTR;         // Used by DLT_LOCK assign type only.
-          dol_AssignName: STRPTR; // name for non-OR-late-binding assign
-          dol_List: PAssignList;  // for multi-directory assigns (regular)
-          dol_MultiAssignList: PMultiAssign;   // Chain of DLT_LOCK multi-assigns
-          dol_NBMultiAssignList: PMultiAssign; // Chain of DLT_NONBINDING multi-assigns (V54)
-          dol_Unused: array[0..2] of LongInt;  // Not used for assigns, leave as 0
-        END;
-    dol_Name: BSTR;          // BSTR formatted name string
-    dol_StructSize: LongInt; // (See NOTES) FULL allocated size of struct
-    dol_Reserved: array[0..3] of LongInt; // DOS reserved expansion space.
-    );
-   END;
+  PDOSList = ^TDOSList;
+  TDOSList = record
+      dol_Next: DWord;    { BPTR }
+      dol_Type: LongInt;
+      dol_Task: PMsgPort;
+      dol_Lock: DWord;    { BPTR }
+      case Byte of
+      0: ( dol_handler : record
+             dol_Handler  : DWord;    { BSTR }
+             dol_StackSize: LongInt;
+             dol_Priority : LongInt;
+             dol_Startup  : DWord;
+             dol_SegList  : DWord;    { BPTR }
+             dol_GlobVec  : DWord;    { BPTR }
+           end;
+         );
+      1: ( dol_volume : record
+             dol_VolumeDate: TDateStamp;
+             dol_LockList  : DWord;   { BPTR }
+             dol_DiskType  : LongInt;
+           end;
+         );
+      2: ( dol_assign : record
+             dol_AssignName: PChar;
+             dol_List      : PAssignList;
+           end;
+         );
+      3: ( dol_Misc: array[0..23] of Byte;
+           dol_Name: DWord;    { BPTR }
+         );
+    end; 
 
 
 { This structure can take on different values depending on whether it is

+ 1 - 1
packages/os4units/src/clipboard.pas

@@ -13,7 +13,7 @@
 
  **********************************************************************}
 unit clipboard;
-
+{$PACKRECORDS 2}
 interface
 
 uses

+ 8 - 3
rtl/amicommon/paramhandling.inc

@@ -240,10 +240,15 @@ begin
     if l = 0 then
     begin
       s1 := GetProgDir;
-      if s1[Length(s1)] = ':' then
-        paramstr := s1 + GetProgramName
+      if length(s1) > 0 then
+      begin
+        if s1[Length(s1)] = ':' then
+          paramstr := s1 + GetProgramName
+        else
+          paramstr:=s1+'/'+GetProgramName;
+      end
       else
-        paramstr:=s1+'/'+GetProgramName;
+        paramstr:=GetProgramName;
     end
     else
     begin

+ 3 - 3
rtl/amiga/m68k/execf.inc

@@ -400,9 +400,9 @@ function AllocPooled(poolHeader: Pointer  location 'a0';
                      memSize   : Cardinal location 'd0'): Pointer;
 SysCall AOS_ExecBase 708;
 
-function FreePooled(poolHeader: Pointer  location 'a0';
-                    memory    : Pointer  location 'a1';
-                    memSize   : Cardinal location 'd0'): Pointer;
+procedure FreePooled(poolHeader: Pointer  location 'a0';
+                      memory    : Pointer  location 'a1';
+                      memSize   : Cardinal location 'd0');
 SysCall AOS_ExecBase 714;
 
 function AttemptSemaphoreShared(sigSem: pSignalSemaphore location 'a0'): Cardinal;

+ 3 - 3
rtl/morphos/execf.inc

@@ -403,9 +403,9 @@ function AllocPooled(poolHeader: Pointer  location 'a0';
                      memSize   : Cardinal location 'd0'): Pointer;
 SysCall MOS_ExecBase 708;
 
-function FreePooled(poolHeader: Pointer  location 'a0';
-                    memory    : Pointer  location 'a1';
-                    memSize   : Cardinal location 'd0'): Pointer;
+procedure FreePooled(poolHeader: Pointer  location 'a0';
+                     memory    : Pointer  location 'a1';
+                     memSize   : Cardinal location 'd0');
 SysCall MOS_ExecBase 714;
 
 function AttemptSemaphoreShared(sigSem: pSignalSemaphore location 'a0'): Cardinal;

+ 3 - 0
rtl/morphos/si_prc.pp

@@ -42,6 +42,9 @@ var
   newStack: Pointer;
   newStackAligned: Pointer;
 begin
+  // prevent removal of the __abox__ symbol by --gc-sections
+  abox_signature := 1;
+  //
   MOS_ExecBase:=realExecBase;
 
   newStack:=AllocVecTaskPooled(StkLen+16);