Browse Source

* synchronize with trunk

git-svn-id: branches/unicodekvm@41712 -
nickysn 6 years ago
parent
commit
9464139912

+ 13 - 0
.gitattributes

@@ -10282,7 +10282,11 @@ rtl/openbsd/errnostr.inc svneol=native#text/plain
 rtl/openbsd/i386/bsyscall.inc svneol=native#text/plain
 rtl/openbsd/i386/cprt0.as svneol=native#text/plain
 rtl/openbsd/i386/dllprt0.as svneol=native#text/plain
+rtl/openbsd/i386/openbsd_ident.inc svneol=native#text/plain
 rtl/openbsd/i386/prt0.as svneol=native#text/plain
+rtl/openbsd/i386/si_c.inc svneol=native#text/plain
+rtl/openbsd/i386/si_dll.inc svneol=native#text/plain
+rtl/openbsd/i386/si_prc.inc svneol=native#text/plain
 rtl/openbsd/i386/sighnd.inc svneol=native#text/plain
 rtl/openbsd/osdefs.inc svneol=native#text/plain
 rtl/openbsd/pmutext.inc svneol=native#text/plain
@@ -10290,6 +10294,11 @@ rtl/openbsd/pthread.inc svneol=native#text/plain
 rtl/openbsd/ptypes.inc svneol=native#text/plain
 rtl/openbsd/rtldefs.inc svneol=native#text/plain
 rtl/openbsd/setsysnr.inc svneol=native#text/plain
+rtl/openbsd/si_c.pp svneol=native#text/plain
+rtl/openbsd/si_dll.pp svneol=native#text/plain
+rtl/openbsd/si_impl.inc svneol=native#text/plain
+rtl/openbsd/si_intf.inc svneol=native#text/plain
+rtl/openbsd/si_prc.pp svneol=native#text/plain
 rtl/openbsd/signal.inc svneol=native#text/plain
 rtl/openbsd/syscalls.inc svneol=native#text/plain
 rtl/openbsd/sysconst.inc svneol=native#text/plain
@@ -10309,7 +10318,11 @@ rtl/openbsd/x86_64/cprt0.as svneol=native#text/plain
 rtl/openbsd/x86_64/crt0.s svneol=native#text/plain
 rtl/openbsd/x86_64/dllprt0.as svneol=native#text/plain
 rtl/openbsd/x86_64/gprt0.as svneol=native#text/plain
+rtl/openbsd/x86_64/openbsd_ident.inc svneol=native#text/plain
 rtl/openbsd/x86_64/prt0.as svneol=native#text/plain
+rtl/openbsd/x86_64/si_c.inc svneol=native#text/plain
+rtl/openbsd/x86_64/si_dll.inc svneol=native#text/plain
+rtl/openbsd/x86_64/si_prc.inc svneol=native#text/plain
 rtl/openbsd/x86_64/sighnd.inc svneol=native#text/plain
 rtl/os2/Makefile svneol=native#text/plain
 rtl/os2/Makefile.fpc svneol=native#text/plain

+ 2 - 1
compiler/systems.pas

@@ -351,7 +351,8 @@ interface
        systems_internal_sysinit = [system_i386_win32,system_x86_64_win64,
                                    system_i386_linux,system_powerpc64_linux,system_sparc64_linux,system_x86_64_linux,
                                    system_m68k_atari,system_m68k_palmos,
-                                   system_i386_haiku,system_x86_64_haiku
+                                   system_i386_haiku,system_x86_64_haiku,
+                                   system_x86_64_openbsd
                                   ]+systems_darwin+systems_amigalike;
 
        { all systems that use garbage collection for reference-counted types }

+ 84 - 47
compiler/systems/t_bsd.pas

@@ -60,6 +60,9 @@ implementation
     private
       LdSupportsNoResponseFile : boolean;
       LibrarySuffix : Char;
+      prtobj : string[80];
+      ReOrder : Boolean;
+      linklibc : boolean;
       Function  WriteResponseFile(isdll:boolean) : Boolean;
       function GetDarwinCrt1ObjName(isdll: boolean): TCmdStr;
       Function GetDarwinPrtobjName(isdll: boolean): TCmdStr;
@@ -73,6 +76,27 @@ implementation
     end;
 
 
+function ModulesLinkToLibc:boolean;
+var
+  hp: tmodule;
+begin
+  { This is called very early, ImportLibraryList is not yet merged into linkothersharedlibs.
+    The former contains library names qualified with prefix and suffix (coming from
+    "external 'c' name 'foo' declarations), the latter contains raw names (from "$linklib c"
+    directives). }
+  hp:=tmodule(loaded_units.first);
+  while assigned(hp) do
+    begin
+      result:=Assigned(hp.ImportLibraryList.find(target_info.sharedClibprefix+'c'+target_info.sharedClibext));
+      if result then break;
+      result:=hp.linkothersharedlibs.find(target_info.sharedClibprefix+'c'+target_info.sharedClibext);
+      if result then break;
+      result:=hp.linkothersharedlibs.find('c');
+      if result then break;
+      hp:=tmodule(hp.next);
+    end;
+end;
+
 
 {*****************************************************************************
                              TIMPORTLIBDARWIN
@@ -230,11 +254,67 @@ End;
 
 
 procedure TLinkerBSD.InitSysInitUnitName;
+var
+  cprtobj,
+  gprtobj,
+  si_cprt,
+  si_gprt : string[80];
 begin
   if target_info.system in systems_darwin then
-    SysInitUnit:='sysinit'
+    begin
+      { for darwin: always link dynamically against libc }
+      linklibc := true;
+      reorder:=reorderentries;
+      prtobj:='';
+      SysInitUnit:='sysinit';
+    end
   else
-    inherited InitSysInitUnitName;
+    begin
+      linklibc:=ModulesLinkToLibc;
+      if current_module.islibrary and
+         (target_info.system in systems_bsd) then
+        begin
+          prtobj:='dllprt0';
+          cprtobj:='dllprt0';
+          gprtobj:='dllprt0';
+          SysInitUnit:='si_dll';
+          si_cprt:='si_dll';
+          si_gprt:='si_dll';
+        end
+      else
+        begin
+          prtobj:='prt0';
+          cprtobj:='cprt0';
+          gprtobj:='gprt0';
+          SysInitUnit:='si_prc';
+          si_cprt:='si_c';
+          si_gprt:='si_g';
+        end;
+      // this one is a bit complex.
+      // Only reorder for now if -XL or -XO params are given
+      // or when -Xf.
+      reorder:= linklibc and
+                (
+                  ReorderEntries
+                   or
+                  (cs_link_pthread in current_settings.globalswitches));
+      if cs_profile in current_settings.moduleswitches then
+       begin
+         prtobj:=gprtobj;
+         SysInitUnit:=si_gprt;
+         AddSharedLibrary('c');
+         LibrarySuffix:='p';
+         linklibc:=true;
+       end
+      else
+       begin
+         if linklibc then
+           begin
+             prtobj:=cprtobj;
+             SysInitUnit:=si_cprt;
+           end;
+       end;
+    end;
 end;
 
 
@@ -392,16 +472,11 @@ Var
   linkres      : TLinkRes;
   FilesList    : TLinkRes;
   i            : longint;
-  cprtobj,
-  gprtobj,
-  prtobj       : string[80];
   HPath        : TCmdStrListItem;
   s,s1,s2      : TCmdStr;
-  linkdynamic,
-  linklibc     : boolean;
+  linkdynamic  : boolean;
   Fl1,Fl2      : Boolean;
   IsDarwin     : Boolean;
-  ReOrder      : Boolean;
 
 begin
   WriteResponseFile:=False;
@@ -411,47 +486,11 @@ begin
 { set special options for some targets }
   if not IsDarwin Then
     begin
-      if isdll and
-         (target_info.system in systems_bsd) then
-        begin
-          prtobj:='dllprt0';
-          cprtobj:='dllprt0';
-          gprtobj:='dllprt0';
-        end
-      else
-        begin
-          prtobj:='prt0';
-          cprtobj:='cprt0';
-          gprtobj:='gprt0';
-        end;
       linkdynamic:=not(SharedLibFiles.empty);
-      linklibc:=(SharedLibFiles.Find('c')<>nil);
-      // this one is a bit complex.
-      // Only reorder for now if -XL or -XO params are given
-      // or when -Xf.
-      reorder:= linklibc and
-                (
-                  ReorderEntries
-                   or
-                  (cs_link_pthread in current_settings.globalswitches));
-      if cs_profile in current_settings.moduleswitches then
-       begin
-         prtobj:=gprtobj;
-         AddSharedLibrary('c');
-         LibrarySuffix:='p';
-         linklibc:=true;
-       end
-      else
-       begin
-         if linklibc then
-          prtobj:=cprtobj;
-       end;
       // after this point addition of shared libs not allowed.
     end
   else
     begin
-      { for darwin: always link dynamically against libc }
-      linklibc := true;
 {$ifdef MACOSX104ORHIGHER}
       { not sure what this is for, but gcc always links against it }
       if not(cs_profile in current_settings.moduleswitches) then
@@ -459,8 +498,6 @@ begin
       else
         AddSharedLibrary('SystemStubs_profile');
 {$endif MACOSX104ORHIGHER}
-      reorder:=reorderentries;
-      prtobj:='';
     end;
 
   if reorder Then
@@ -571,7 +608,7 @@ begin
   if not LdSupportsNoResponseFile then
     LinkRes.Add('INPUT(');
   { add objectfiles, start with prt0 always }
-  if prtobj<>'' then
+  if not (target_info.system in systems_internal_sysinit) and (prtobj<>'') then
    LinkRes.AddFileName(FindObjectFile(prtobj,'',false));
   { try to add crti and crtbegin if linking to C }
   if linklibc and

+ 1 - 1
packages/fcl-passrc/src/pasresolver.pp

@@ -2024,7 +2024,7 @@ type
     function GetFunctionType(El: TPasElement): TPasFunctionType;
     function MethodIsStatic(El: TPasProcedure): boolean;
     function IsMethod(El: TPasProcedure): boolean;
-    function IsHelperMethod(El: TPasElement): boolean;
+    function IsHelperMethod(El: TPasElement): boolean; virtual;
     function IsHelper(El: TPasElement): boolean;
     function IsExternalClass_Name(aClass: TPasClassType; const ExtName: string): boolean;
     function IsProcedureType(const ResolvedEl: TPasResolverResult; HasValue: boolean): boolean;

+ 99 - 46
packages/pastojs/src/fppas2js.pp

@@ -1455,6 +1455,8 @@ type
     function IsForInExtArray(Loop: TPasImplForLoop; const VarResolved,
       InResolved: TPasResolverResult; out ArgResolved, LengthResolved,
       PropResultResolved: TPasResolverResult): boolean;
+    function IsHelperMethod(El: TPasElement): boolean; override;
+    function IsHelperForMember(El: TPasElement): boolean;
   end;
 
 //------------------------------------------------------------------------------
@@ -3987,19 +3989,25 @@ begin
                 RaiseMsg(20180329141108,nInvalidXModifierY,
                   sInvalidXModifierY,[Proc.ElementTypeName,ModifierNames[pm]],Proc);
             end;
-          okClassHelper:
+          okClassHelper,okRecordHelper,okTypeHelper:
             begin
             HelperForType:=ResolveAliasType(AClass.HelperForType);
-            if HelperForType.ClassType<>TPasClassType then
-              RaiseNotYetImplemented(20190201165157,El);
-            if TPasClassType(HelperForType).IsExternal then
+            if HelperForType.ClassType=TPasClassType then
               begin
-              // method of a class helper for external class
-              if IsClassMethod(El) and not (ptmStatic in El.Modifiers) then
-                RaiseMsg(20190201165259,nHelperClassMethodForExtClassMustBeStatic,
-                  sHelperClassMethodForExtClassMustBeStatic,[],El);
-              if El.ClassType=TPasConstructor then
-                RaiseNotYetImplemented(20190206153655,El);
+              if TPasClassType(HelperForType).IsExternal then
+                begin
+                // method of a class helper for external class
+                if IsClassMethod(El) and not (ptmStatic in El.Modifiers) then
+                  RaiseMsg(20190201165259,nHelperClassMethodForExtClassMustBeStatic,
+                    sHelperClassMethodForExtClassMustBeStatic,[],El);
+                if El.ClassType=TPasConstructor then
+                  RaiseNotYetImplemented(20190206153655,El);
+                end;
+              end;
+            if Proc.IsExternal then
+              begin
+              if not (HelperForType is TPasMembersType) then
+                RaiseMsg(20190314225457,nNotSupportedX,sNotSupportedX,['external method in type helper'],El);
               end;
             end;
           end;
@@ -5886,6 +5894,26 @@ begin
   CheckAssignResCompatibility(VarResolved,PropResultResolved,Loop.VariableName,true);
 end;
 
+function TPas2JSResolver.IsHelperMethod(El: TPasElement): boolean;
+begin
+  Result:=inherited IsHelperMethod(El);
+  if not Result then exit;
+  Result:=not TPasProcedure(El).IsExternal;
+end;
+
+function TPas2JSResolver.IsHelperForMember(El: TPasElement): boolean;
+begin
+  if (El=nil) or (El.Parent=nil) or (El.Parent.ClassType<>TPasClassType)
+      or (TPasClassType(El.Parent).HelperForType=nil) then
+    exit(false);
+  if El is TPasProcedure then
+    Result:=TPasProcedure(El).IsExternal
+  else if El is TPasVariable then
+    Result:=vmExternal in TPasVariable(El).VarModifiers
+  else
+    Result:=true;
+end;
+
 { TParamContext }
 
 constructor TParamContext.Create(PasEl: TPasElement; JSEl: TJSElement;
@@ -7896,7 +7924,8 @@ begin
   if aResolver.IsHelper(RightRefDecl.Parent) then
     begin
     // LeftJS.HelperMember
-    if RightRefDecl is TPasVariable then
+    if (RightRefDecl is TPasVariable)
+        and not (vmExternal in TPasVariable(RightRefDecl).VarModifiers) then
       begin
       // LeftJS.HelperField  -> HelperType.HelperField
       if Assigned(OnConvertRight) then
@@ -7907,7 +7936,10 @@ begin
       end
     else if RightRefDecl is TPasProcedure then
       begin
-      if rrfNoImplicitCallWithoutParams in RightRef.Flags then
+      Proc:=TPasProcedure(RightRefDecl);
+      if Proc.IsExternal then
+        // normal call
+      else if rrfNoImplicitCallWithoutParams in RightRef.Flags then
         begin
         Result:=CreateReferencePathExpr(RightRefDecl,AContext);
         exit;
@@ -7915,7 +7947,6 @@ begin
       else
         begin
         // call helper method
-        Proc:=TPasProcedure(RightRefDecl);
         Result:=CreateCallHelperMethod(Proc,El,AContext);
         exit;
         end;
@@ -8295,7 +8326,7 @@ begin
         Decl:=aResolver.GetPasPropertySetter(Prop);
         if Decl is TPasProcedure then
           begin
-          if aResolver.IsHelper(Decl.Parent) then
+          if aResolver.IsHelperMethod(Decl) then
             begin
             Result:=CreateCallHelperMethod(TPasProcedure(Decl),El,AContext);
             exit;
@@ -9768,7 +9799,7 @@ begin
       end
     else if C.InheritsFrom(TPasProcedure) then
       begin
-      if aResolver.IsHelper(Decl.Parent) then
+      if aResolver.IsHelperMethod(Decl) then
         begin
         // calling a helper method
         Result:=CreateCallHelperMethod(TPasProcedure(Decl),El.Value,AContext);
@@ -16187,7 +16218,7 @@ begin
     Result:=CreateReferencePathExpr(Proc,AContext);
     exit;
     end;
-  IsHelper:=aResolver.IsHelper(Proc.Parent);
+  IsHelper:=aResolver.IsHelperMethod(Proc);
   NeedClass:=aResolver.IsClassMethod(Proc) and not aResolver.MethodIsStatic(Proc);
 
   // an of-object method -> create "rtl.createCallback(Target,func)"
@@ -16599,7 +16630,7 @@ begin
   if Decl is TPasFunction then
     begin
     // call function
-    if aResolver.IsHelper(Decl.Parent) then
+    if aResolver.IsHelperMethod(Decl) then
       begin
       if (Expr=nil) then
         // implicit property read, e.g. enumerator property Current
@@ -21304,9 +21335,16 @@ var
   begin
     if (Ref=nil) or (Ref.WithExprScope=nil) then exit(false);
     Parent:=El.Parent;
-    if (Parent<>nil) and (Parent.ClassType=TPasClassType)
+    if (Parent.ClassType=TPasClassType)
         and (TPasClassType(Parent).HelperForType<>nil) then
-      exit(false);
+      begin
+      // e.g. with Obj do HelperMethod
+      if aResolver.IsHelperForMember(El) then
+        // e.g. with Obj do HelperExternalMethod  -> Obj.HelperCall
+      else
+        // e.g. with Obj do HelperMethod  -> THelper.HelperCall
+        exit(false);
+      end;
     Result:=true;
   end;
 
@@ -21403,6 +21441,8 @@ var
 begin
   Result:='';
   {$IFDEF VerbosePas2JS}
+  if SameText(El.Name,'Fly') then
+    writeln('AAA1 TPasToJSConverter.CreateReferencePath START El=',GetObjName(El),' Parent=',GetObjName(El.Parent),' Context=',GetObjName(AContext),' SelfContext=',GetObjName(AContext.GetSelfContext));
   //writeln('TPasToJSConverter.CreateReferencePath START El=',GetObjName(El),' Parent=',GetObjName(El.Parent),' Context=',GetObjName(AContext),' SelfContext=',GetObjName(AContext.GetSelfContext));
   //AContext.WriteStack;
   {$ENDIF}
@@ -21484,6 +21524,7 @@ begin
   else
     begin
     // need full path
+      writeln('AAA2 TPasToJSConverter.CreateReferencePath ');
     if El.Parent=nil then
       RaiseNotSupported(El,AContext,20170201172141,GetObjName(El));
     El:=ImplToDecl(El);
@@ -21493,38 +21534,26 @@ begin
       begin
       ParentEl:=ImplToDecl(ParentEl);
 
+      IsClassRec:=(ParentEl.ClassType=TPasClassType)
+               or (ParentEl.ClassType=TPasRecordType);
+
       // check if ParentEl has a JS var
       ShortName:=AContext.GetLocalName(ParentEl);
       //writeln('TPasToJSConverter.CreateReferencePath El=',GetObjName(El),' ParentEl=',GetObjName(ParentEl),' ShortName=',ShortName);
 
-      IsClassRec:=(ParentEl.ClassType=TPasClassType)
-               or (ParentEl.ClassType=TPasRecordType);
-
-      if (ShortName<>'') and not IsClassRec then
-        begin
-        Prepend(Result,ShortName);
-        break;
-        end
-      else if ParentEl.ClassType=TImplementationSection then
-        begin
-        // element is in an implementation section (not program/library section)
-        // in other unit -> use pas.unitname.$impl
-        FoundModule:=El.GetModule;
-        if FoundModule=nil then
-          RaiseInconsistency(20161024192755,El);
-        Prepend(Result,TransformModuleName(FoundModule,true,AContext)
-           +'.'+GetBIName(pbivnImplementation));
-        break;
-        end
-      else if ParentEl is TPasModule then
-        begin
-        // element is in an unit interface or program/library section
-        Prepend(Result,TransformModuleName(TPasModule(ParentEl),true,AContext));
-        break;
-        end
-      else if IsClassRec then
+      if IsClassRec then
         begin
         // parent is a class or record declaration
+          writeln('AAA3 TPasToJSConverter.CreateReferencePath ',GetObjName(ParentEl));
+        if (ParentEl.ClassType=TPasClassType)
+            and (TPasClassType(ParentEl).HelperForType<>nil)
+            and aResolver.IsHelperForMember(El) then
+          begin
+          // redirect to helper-for-type
+          ParentEl:=aResolver.ResolveAliasType(TPasClassType(ParentEl).HelperForType);
+          ShortName:=AContext.GetLocalName(ParentEl);
+          end;
+
         if Full then
           Prepend(Result,ParentEl.Name)
         else
@@ -21541,8 +21570,10 @@ begin
             Prepend(Result,ParentEl.Name)
           else if (ParentEl.ClassType=TPasClassType)
               and (TPasClassType(ParentEl).HelperForType<>nil) then
+            begin
             // helpers have no self
-            Prepend(Result,ParentEl.Name)
+            Prepend(Result,ParentEl.Name);
+            end
           else if (SelfContext<>nil)
               and IsA(TPasType(SelfContext.ThisPas),TPasMembersType(ParentEl)) then
             begin
@@ -21575,6 +21606,28 @@ begin
             break;
           end;
         end
+      else if (ShortName<>'') then
+        begin
+        Prepend(Result,ShortName);
+        break;
+        end
+      else if ParentEl.ClassType=TImplementationSection then
+        begin
+        // element is in an implementation section (not program/library section)
+        // in other unit -> use pas.unitname.$impl
+        FoundModule:=El.GetModule;
+        if FoundModule=nil then
+          RaiseInconsistency(20161024192755,El);
+        Prepend(Result,TransformModuleName(FoundModule,true,AContext)
+           +'.'+GetBIName(pbivnImplementation));
+        break;
+        end
+      else if ParentEl is TPasModule then
+        begin
+        // element is in an unit interface or program/library section
+        Prepend(Result,TransformModuleName(TPasModule(ParentEl),true,AContext));
+        break;
+        end
       else if ParentEl.ClassType=TPasEnumType then
         begin
         if (ShortName<>'') and not Full then

+ 20 - 22
packages/pastojs/src/pas2jscompiler.pp

@@ -462,36 +462,36 @@ type
   TPas2jsCompiler = class
   private
     FAllJSIntoMainJS: Boolean;
-    FConverterGlobals: TPasToJSConverterGlobals;
     FCompilerExe: string;
+    FConfigSupport: TPas2JSConfigSupport;
+    FConverterGlobals: TPasToJSConverterGlobals;
     FDefines: TStrings; // Objects can be TMacroDef
-    FFS: TPas2jsFS;
-    FOwnsFS: boolean;
     FFiles: TPasAnalyzerKeySet; // set of TPas2jsCompilerFile, key is UnitFilename
-    FReadingModules: TFPList; // list of TPas2jsCompilerFile ordered by uses sections
+    FFS: TPas2jsFS;
     FHasShownEncoding: boolean;
     FHasShownLogo: boolean;
+    FInsertFilenames: TStringList;
+    FInterfaceType: TPasClassInterfaceType;
     FLog: TPas2jsLogger;
     FMainFile: TPas2jsCompilerFile;
-    FMainJSFileResolved: String;
-    FMainJSFileIsResolved: Boolean;
     FMainJSFile: String;
+    FMainJSFileIsResolved: Boolean;
+    FMainJSFileResolved: String;
     FMainSrcFile: String;
     FMode: TP2jsMode;
+    FNamespaces: TStringList;
+    FNamespacesFromCmdLine: integer;
     FOptions: TP2jsCompilerOptions;
+    FOwnsFS: boolean;
     FParamMacros: TPas2jsMacroEngine;
+    FPostProcessorSupport: TPas2JSPostProcessorSupport;
+    FPrecompileGUID: TGUID;
+    FReadingModules: TFPList; // list of TPas2jsCompilerFile ordered by uses sections
+    FRTLVersionCheck: TP2jsRTLVersionCheck;
+    FSrcMapBaseDir: string;
     FSrcMapSourceRoot: string;
     FUnits: TPasAnalyzerKeySet; // set of TPas2jsCompilerFile, key is PasUnitName
     FWPOAnalyzer: TPas2JSAnalyzer;
-    FInterfaceType: TPasClassInterfaceType;
-    FPrecompileGUID: TGUID;
-    FInsertFilenames: TStringList;
-    FNamespaces: TStringList;
-    FNamespacesFromCmdLine: integer;
-    FConfigSupport: TPas2JSConfigSupport;
-    FSrcMapBaseDir: string;
-    FRTLVersionCheck: TP2jsRTLVersionCheck;
-    FPostProcessorSupport: TPas2JSPostProcessorSupport;
     procedure AddInsertJSFilename(const aFilename: string);
     Procedure AddNamespaces(const Paths: string; FromCmdLine: boolean);
     function GetDefaultNamespace: String;
@@ -4404,22 +4404,20 @@ begin
 end;
 
 procedure TPas2jsCompiler.WriteUsedTools;
-
 begin
-  If Assigned(FPostProcessorSupport) then
+  if Assigned(FPostProcessorSupport) then
     FPostProcessorSupport.WriteUsedTools;
 end;
 
 procedure TPas2jsCompiler.WriteFoldersAndSearchPaths;
-
-Var
+var
   I: integer;
-
 begin
+  Log.LogMsgIgnoreFilter(nNameValue,['Compiler exe',QuoteStr(CompilerExe)]);
   FS.WriteFoldersAndSearchPaths;
   for i:=0 to Namespaces.Count-1 do
-    Log.LogMsgIgnoreFilter(nUsingPath,['unit scope',Namespaces[i]]);
-  Log.LogMsgIgnoreFilter(nNameValue,['output file',QuoteStr(MainJSFile)]);
+    Log.LogMsgIgnoreFilter(nUsingPath,['Unit scope',Namespaces[i]]);
+  Log.LogMsgIgnoreFilter(nNameValue,['Output file',QuoteStr(MainJSFile)]);
 end;
 
 procedure TPas2jsCompiler.WriteInfo;

+ 1 - 0
packages/pastojs/src/pas2jsfilecache.pp

@@ -1494,6 +1494,7 @@ procedure TPas2jsFilesCache.WriteFoldersAndSearchPaths;
 var
   i: Integer;
 begin
+  WriteFolder('working directory',GetCurrentDirPJ);
   for i:=0 to ForeignUnitPaths.Count-1 do
     WriteFolder('foreign unit path',ForeignUnitPaths[i]);
   for i:=0 to UnitPaths.Count-1 do

+ 67 - 12
packages/pastojs/tests/tcmodules.pas

@@ -455,7 +455,7 @@ type
     Procedure TestRecordElementFromFuncResult_AsParams;
     Procedure TestRecordElementFromWith_AsParams;
     Procedure TestRecord_Equal;
-    Procedure TestRecord_TypeCastJSValueToRecord;
+    Procedure TestRecord_JSValue;
     Procedure TestRecord_VariantFail;
     Procedure TestRecord_FieldArray;
     Procedure TestRecord_Const;
@@ -680,6 +680,7 @@ type
     Procedure TestTypeHelper_ClassProperty;
     Procedure TestTypeHelper_ClassProperty_Array;
     Procedure TestTypeHelper_ClassMethod;
+    Procedure TestTypeHelper_ExtClassMethodFail;
     Procedure TestTypeHelper_Constructor;
     Procedure TestTypeHelper_Word;
     Procedure TestTypeHelper_Double;
@@ -10355,20 +10356,28 @@ begin
     '']));
 end;
 
-procedure TTestModule.TestRecord_TypeCastJSValueToRecord;
+procedure TTestModule.TestRecord_JSValue;
 begin
   StartProgram(false);
-  Add('type');
-  Add('  TRecord = record');
-  Add('    i: longint;');
-  Add('  end;');
-  Add('var');
-  Add('  Jv: jsvalue;');
-  Add('  Rec: trecord;');
-  Add('begin');
-  Add('  rec:=trecord(jv);');
+  Add([
+  'type',
+  '  TRecord = record',
+  '    i: longint;',
+  '  end;',
+  'procedure Fly(d: jsvalue; const c: jsvalue);',
+  'begin',
+  'end;',
+  'var',
+  '  Jv: jsvalue;',
+  '  Rec: trecord;',
+  'begin',
+  '  rec:=trecord(jv);',
+  '  jv:=rec;',
+  '  Fly(rec,rec);',
+  '  Fly(@rec,@rec);',
+  '']);
   ConvertProgram;
-  CheckSource('TestRecord_TypeCastJSValueToRecord',
+  CheckSource('TestRecord_JSValue',
     LinesToStr([ // statements
     'rtl.recNewT($mod, "TRecord", function () {',
     '  this.i = 0;',
@@ -10380,11 +10389,16 @@ begin
     '    return this;',
     '  };',
     '});',
+    'this.Fly = function (d, c) {',
+    '};',
     'this.Jv = undefined;',
     'this.Rec = $mod.TRecord.$new();',
     '']),
     LinesToStr([
     '$mod.Rec.$assign(rtl.getObject($mod.Jv));',
+    '$mod.Jv = $mod.Rec;',
+    '$mod.Fly($mod.TRecord.$clone($mod.Rec), $mod.Rec);',
+    '$mod.Fly($mod.Rec, $mod.Rec);',
     '']));
 end;
 
@@ -21184,12 +21198,15 @@ begin
   Add([
   '{$modeswitch externalclass}',
   'type',
+  '  TFly = function(w: word): word of object;',
   '  TExtA = class external name ''ExtObj''',
   '    procedure Run(w: word = 10);',
   '  end;',
   '  THelper = class helper for TExtA',
   '    function Foo(w: word = 1): word;',
+  '    function Fly(w: word = 2): word; external name ''Fly'';',
   '  end;',
+  'var p: TFly;',
   'function THelper.foo(w: word): word;',
   'begin',
   '  Run;',
@@ -21201,22 +21218,32 @@ begin
   '  Self.Foo;',
   '  Self.Foo();',
   '  Self.Foo(13);',
+  '  Fly;',
+  '  Fly();',
   '  with Self do begin',
   '    Foo;',
   '    Foo();',
   '    Foo(14);',
+  '    Fly;',
+  '    Fly();',
   '  end;',
+  '  p:=@Fly;',
   'end;',
   'var Obj: TExtA;',
   'begin',
   '  obj.Foo;',
   '  obj.Foo();',
   '  obj.Foo(21);',
+  '  obj.Fly;',
+  '  obj.Fly();',
   '  with obj do begin',
   '    Foo;',
   '    Foo();',
   '    Foo(22);',
+  '    Fly;',
+  '    Fly();',
   '  end;',
+  '  p:[email protected];',
   '']);
   ConvertProgram;
   CheckSource('TestExtClassHelper_Method_Call',
@@ -21233,22 +21260,33 @@ begin
     '    $mod.THelper.Foo.call(this, 1);',
     '    $mod.THelper.Foo.call(this, 1);',
     '    $mod.THelper.Foo.call(this, 13);',
+    '    this.Fly(2);',
+    '    this.Fly(2);',
     '    $mod.THelper.Foo.call(this, 1);',
     '    $mod.THelper.Foo.call(this, 1);',
     '    $mod.THelper.Foo.call(this, 14);',
+    '    this.Fly(2);',
+    '    this.Fly(2);',
+    '    $mod.p = rtl.createCallback(this, "Fly");',
     '    return Result;',
     '  };',
     '});',
+    'this.p = null;',
     'this.Obj = null;',
     '']),
     LinesToStr([ // $mod.$main
     '$mod.THelper.Foo.call($mod.Obj, 1);',
     '$mod.THelper.Foo.call($mod.Obj, 1);',
     '$mod.THelper.Foo.call($mod.Obj, 21);',
+    '$mod.Obj.Fly(2);',
+    '$mod.Obj.Fly(2);',
     'var $with1 = $mod.Obj;',
     '$mod.THelper.Foo.call($with1, 1);',
     '$mod.THelper.Foo.call($with1, 1);',
     '$mod.THelper.Foo.call($with1, 22);',
+    '$with1.Fly(2);',
+    '$with1.Fly(2);',
+    '$mod.p = rtl.createCallback($mod.Obj, "Fly");',
     '']));
 end;
 
@@ -23009,6 +23047,23 @@ begin
     '']));
 end;
 
+procedure TTestModule.TestTypeHelper_ExtClassMethodFail;
+begin
+  StartProgram(false);
+  Add([
+  '{$modeswitch typehelpers}',
+  'type',
+  '  THelper = type helper for word',
+  '    procedure Run; external name ''Run'';',
+  '  end;',
+  'var w: word;',
+  'begin',
+  '  w.Run;',
+  '']);
+  SetExpectedPasResolverError('Not supported: external method in type helper',nNotSupportedX);
+  ConvertProgram;
+end;
+
 procedure TTestModule.TestTypeHelper_Constructor;
 begin
   StartProgram(false);

+ 195 - 184
rtl/openbsd/Makefile

@@ -353,11 +353,16 @@ endif
 ifdef RELEASE
 override FPCOPT+=-Ur
 endif
+CPU_UNITS=
+SYSINIT_UNITS=
+LOADERS=prt0 cprt0 dllprt0
 ifeq ($(ARCH),x86_64)
 CPU_UNITS=x86 ports cpu
+SYSINIT_UNITS=si_prc si_c si_dll
 endif
 ifeq ($(ARCH),i386)
 CPU_UNITS=x86 ports cpu mmx
+SYSINIT_UNITS=si_prc si_c si_dll
 endif
 OBJPASDIR=$(RTL)/objpas
 GRAPHDIR=$(INC)/graph
@@ -365,280 +370,280 @@ ifndef USELIBGGI
 USELIBGGI=NO
 endif
 ifeq ($(FULL_TARGET),i386-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),i386-go32v2)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),i386-win32)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),i386-os2)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),i386-freebsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),i386-beos)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),i386-haiku)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),i386-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),i386-solaris)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),i386-netware)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),i386-openbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),i386-wdosx)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),i386-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),i386-emx)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),i386-watcom)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),i386-netwlibc)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),i386-wince)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),i386-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),i386-symbian)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),i386-nativent)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),i386-iphonesim)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),i386-android)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),i386-aros)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),m68k-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),m68k-amiga)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),m68k-atari)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),m68k-palmos)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),m68k-macos)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),m68k-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),powerpc-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),powerpc-amiga)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),powerpc-macos)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),powerpc-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),powerpc-morphos)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),powerpc-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),powerpc-wii)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),powerpc-aix)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),sparc-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),sparc-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),sparc-solaris)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),sparc-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),x86_64-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),x86_64-haiku)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),x86_64-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),x86_64-openbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),x86_64-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),x86_64-win64)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),x86_64-iphonesim)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),x86_64-android)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),x86_64-aros)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),x86_64-dragonfly)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),arm-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),arm-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),arm-palmos)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),arm-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),arm-wince)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),arm-gba)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),arm-nds)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),arm-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),arm-symbian)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),arm-android)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),arm-aros)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),powerpc64-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),powerpc64-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),powerpc64-aix)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),avr-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),armeb-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),armeb-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),mips-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),mipsel-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),mipsel-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),mipsel-android)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),jvm-java)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),jvm-android)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),i8086-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),i8086-msdos)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),i8086-win16)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),aarch64-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),aarch64-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),aarch64-android)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),wasm-wasm)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),sparc64-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),riscv32-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),riscv32-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),riscv64-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),riscv64-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc $(CPU_UNITS) dos rtlconsts sysutils sortbase fgl classes typinfo math charset cpall character getopts heaptrc lineinfo lnfodwrf errors types sysctl sysconst fpintres dynlibs cwstring cmem dl termio cthreads unixcp fpwidestring
 endif
 ifeq ($(FULL_TARGET),i386-linux)
 override TARGET_IMPLICITUNITS+=exeinfo cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp737 cp775 cp850 cp852 cp855 cp856 cp857 cp860 cp861 cp862 cp863 cp864 cp865 cp866 cp869 cp874 cp3021 cp8859_1 cp8859_2 cp8859_3 cp8859_4 cp8859_5 cp8859_6 cp8859_7 cp8859_8 cp8859_9 cp8859_10 cp8859_11 cp8859_13 cp8859_14 cp8859_15 cp8859_16 cpkoi8_r cpkoi8_u unicodedata  unicodenumtable
@@ -917,280 +922,280 @@ ifeq ($(FULL_TARGET),riscv64-embedded)
 override TARGET_IMPLICITUNITS+=exeinfo cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp737 cp775 cp850 cp852 cp855 cp856 cp857 cp860 cp861 cp862 cp863 cp864 cp865 cp866 cp869 cp874 cp3021 cp8859_1 cp8859_2 cp8859_3 cp8859_4 cp8859_5 cp8859_6 cp8859_7 cp8859_8 cp8859_9 cp8859_10 cp8859_11 cp8859_13 cp8859_14 cp8859_15 cp8859_16 cpkoi8_r cpkoi8_u unicodedata  unicodenumtable
 endif
 ifeq ($(FULL_TARGET),i386-linux)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),i386-go32v2)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),i386-win32)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),i386-os2)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),i386-freebsd)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),i386-beos)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),i386-haiku)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),i386-netbsd)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),i386-solaris)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),i386-netware)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),i386-openbsd)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),i386-wdosx)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),i386-darwin)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),i386-emx)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),i386-watcom)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),i386-netwlibc)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),i386-wince)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),i386-embedded)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),i386-symbian)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),i386-nativent)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),i386-iphonesim)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),i386-android)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),i386-aros)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),m68k-netbsd)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),m68k-amiga)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),m68k-atari)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),m68k-palmos)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),m68k-macos)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),m68k-embedded)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),powerpc-linux)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),powerpc-amiga)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),powerpc-macos)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),powerpc-darwin)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),powerpc-morphos)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),powerpc-embedded)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),powerpc-wii)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),powerpc-aix)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),sparc-linux)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),sparc-netbsd)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),sparc-solaris)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),sparc-embedded)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),x86_64-linux)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),x86_64-haiku)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),x86_64-netbsd)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),x86_64-openbsd)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),x86_64-darwin)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),x86_64-win64)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),x86_64-iphonesim)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),x86_64-android)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),x86_64-aros)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),x86_64-dragonfly)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),arm-linux)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),arm-netbsd)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),arm-palmos)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),arm-darwin)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),arm-wince)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),arm-gba)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),arm-nds)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),arm-embedded)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),arm-symbian)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),arm-android)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),arm-aros)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),powerpc64-darwin)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),powerpc64-embedded)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),powerpc64-aix)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),avr-embedded)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),armeb-linux)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),armeb-embedded)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),mips-linux)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),mipsel-linux)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),mipsel-embedded)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),mipsel-android)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),jvm-java)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),jvm-android)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),i8086-embedded)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),i8086-msdos)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),i8086-win16)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),aarch64-linux)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),aarch64-darwin)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),aarch64-android)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),wasm-wasm)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),sparc64-linux)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),riscv32-linux)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),riscv32-embedded)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),riscv64-linux)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),riscv64-embedded)
-override TARGET_LOADERS+=prt0 cprt0 dllprt0
+override TARGET_LOADERS+=$(LOADERS)
 endif
 ifeq ($(FULL_TARGET),i386-linux)
 override TARGET_RSTS+=math typinfo classes sysconst
@@ -3260,6 +3265,12 @@ cprt0$(OEXT) : $(CPU_TARGET)/cprt0.as
 	$(AS) -o $(UNITTARGETDIRPREFIX)cprt0$(OEXT) $(CPU_TARGET)/cprt0.as
 dllprt0$(OEXT) : $(CPU_TARGET)/dllprt0.as
 	$(AS) -o $(UNITTARGETDIRPREFIX)dllprt0$(OEXT) $(CPU_TARGET)/dllprt0.as
+si_prc$(PPUEXT) : si_prc.pp si_intf.inc si_impl.inc $(ARCH)/openbsd_ident.inc $(ARCH)/si_prc.inc $(SYSTEMUNIT)$(PPUEXT)
+	$(COMPILER) $<
+si_c$(PPUEXT) : si_c.pp si_intf.inc si_impl.inc $(ARCH)/openbsd_ident.inc $(ARCH)/si_c.inc $(SYSTEMUNIT)$(PPUEXT)
+	$(COMPILER) $<
+si_dll$(PPUEXT) : si_dll.pp si_intf.inc si_impl.inc $(ARCH)/openbsd_ident.inc $(ARCH)/si_dll.inc $(SYSTEMUNIT)$(PPUEXT)
+	$(COMPILER) $<
 $(SYSTEMUNIT)$(PPUEXT) : $(BSDINC)/$(SYSTEMUNIT).pp sysconst.inc systypes.inc syscalls.inc $(SYSDEPS)
 	$(COMPILER) $(FPC_SYSTEM_OPT) -Us -Sg $(BSDINC)/$(SYSTEMUNIT).pp
 uuchar$(PPUEXT): $(INC)/uuchar.pp $(SYSTEMUNIT)$(PPUEXT)

+ 23 - 2
rtl/openbsd/Makefile.fpc

@@ -9,8 +9,8 @@ main=rtl
 fpcpackage=y
 
 [target]
-loaders=prt0 cprt0 dllprt0
-units=$(SYSTEMUNIT) uuchar objpas macpas iso7185 extpas strings syscall baseunix \
+loaders=$(LOADERS)
+units=$(SYSTEMUNIT) $(SYSINIT_UNITS) uuchar objpas macpas iso7185 extpas strings syscall baseunix \
       $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc \
       $(CPU_UNITS) dos rtlconsts \
       sysutils sortbase fgl classes typinfo math \
@@ -82,11 +82,18 @@ ifdef RELEASE
 override FPCOPT+=-Ur
 endif
 
+CPU_UNITS=
+SYSINIT_UNITS=
+
+LOADERS=prt0 cprt0 dllprt0
+
 ifeq ($(ARCH),x86_64)
 CPU_UNITS=x86 ports cpu
+SYSINIT_UNITS=si_prc si_c si_dll
 endif
 ifeq ($(ARCH),i386)
 CPU_UNITS=x86 ports cpu mmx
+SYSINIT_UNITS=si_prc si_c si_dll
 endif
 
 # Paths
@@ -134,6 +141,20 @@ cprt0$(OEXT) : $(CPU_TARGET)/cprt0.as
 dllprt0$(OEXT) : $(CPU_TARGET)/dllprt0.as
         $(AS) -o $(UNITTARGETDIRPREFIX)dllprt0$(OEXT) $(CPU_TARGET)/dllprt0.as
 
+
+#
+# $(SYSINIT_UNITS) Units
+#
+si_prc$(PPUEXT) : si_prc.pp si_intf.inc si_impl.inc $(ARCH)/openbsd_ident.inc $(ARCH)/si_prc.inc $(SYSTEMUNIT)$(PPUEXT)
+	$(COMPILER) $<
+
+si_c$(PPUEXT) : si_c.pp si_intf.inc si_impl.inc $(ARCH)/openbsd_ident.inc $(ARCH)/si_c.inc $(SYSTEMUNIT)$(PPUEXT)
+	$(COMPILER) $<
+
+si_dll$(PPUEXT) : si_dll.pp si_intf.inc si_impl.inc $(ARCH)/openbsd_ident.inc $(ARCH)/si_dll.inc $(SYSTEMUNIT)$(PPUEXT)
+	$(COMPILER) $<
+
+
 #
 # System Units (System, Objpas, Strings)
 #

+ 14 - 0
rtl/openbsd/i386/openbsd_ident.inc

@@ -0,0 +1,14 @@
+{$asmmode att}
+
+procedure OpenBSDIdentTag;nostackframe;assembler;
+  asm
+    .section ".note.openbsd.ident", "a"
+    .p2align 2
+    .long    8
+    .long    4
+    .long    1
+    .asciz   "OpenBSD"
+    .long    0
+
+    .text
+  end;

+ 17 - 0
rtl/openbsd/i386/si_c.inc

@@ -0,0 +1,17 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2019 by Free Pascal development team
+
+    This file implements parts of the startup code for OpenBSD
+    programs that link to the C library.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+

+ 17 - 0
rtl/openbsd/i386/si_dll.inc

@@ -0,0 +1,17 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2019 by Free Pascal development team
+
+    This file implements parts of the startup code for OpenBSD
+    shared object (.so) libraries.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+

+ 17 - 0
rtl/openbsd/i386/si_prc.inc

@@ -0,0 +1,17 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2019 by Free Pascal development team
+
+    This file implements parts of the startup code for OpenBSD
+    programs that don't link to the C library.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+

+ 28 - 0
rtl/openbsd/si_c.pp

@@ -0,0 +1,28 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2019 by Free Pascal development team
+
+    This file implements the startup code for OpenBSD programs that
+    link to the C library.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+unit si_c;
+
+interface
+
+{$i si_intf.inc}
+
+implementation
+
+{$i si_impl.inc}
+{$i si_c.inc}
+
+end.

+ 28 - 0
rtl/openbsd/si_dll.pp

@@ -0,0 +1,28 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2019 by Free Pascal development team
+
+    This file implements the startup code for OpenBSD shared object
+    (.so) libraries.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+unit si_dll;
+
+interface
+
+{$i si_intf.inc}
+
+implementation
+
+{$i si_impl.inc}
+{$i si_dll.inc}
+
+end.

+ 22 - 0
rtl/openbsd/si_impl.inc

@@ -0,0 +1,22 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2015 by Sven Barth, member of the Free Pascal development
+    team.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+{$IFNDEF VER3_0}
+  {$I openbsd_ident.inc}
+{$ENDIF VER3_0}
+
+procedure PascalMain; external name 'PASCALMAIN';
+
+var
+  operatingsystem_result: longint; external name 'operatingsystem_result';

+ 26 - 0
rtl/openbsd/si_intf.inc

@@ -0,0 +1,26 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2019 by Free Pascal development team
+
+    This file implements the public interface parts of the startup
+    code for OpenBSD programs or shared object (.so) libraries.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+{$SMARTLINK OFF}
+{$GOTO ON}
+
+var
+  operatingsystem_parameter_envp: ppchar; public name 'operatingsystem_parameter_envp';
+  operatingsystem_parameter_argc: longint; public name 'operatingsystem_parameter_argc';
+  operatingsystem_parameter_argv: ppchar; public name 'operatingsystem_parameter_argv';
+  environ: ppchar; public name 'environ';
+  __progname: pchar = ''; public name '__progname';
+  __progname_storage: array [0..255] of char; public name '__progname_storage';

+ 29 - 0
rtl/openbsd/si_prc.pp

@@ -0,0 +1,29 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2019 by Free Pascal development team
+
+    This file implements the startup code for OpenBSD programs that
+    don't link to the C library.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+
+unit si_prc;
+
+interface
+
+{$i si_intf.inc}
+
+implementation
+
+{$i si_impl.inc}
+{$i si_prc.inc}
+
+end.

+ 14 - 0
rtl/openbsd/x86_64/openbsd_ident.inc

@@ -0,0 +1,14 @@
+{$asmmode gas}
+
+procedure OpenBSDIdentTag;nostackframe;assembler;
+  asm
+    .section ".note.openbsd.ident", "a"
+    .p2align 2
+    .long    8
+    .long    4
+    .long    1
+    .asciz   "OpenBSD"
+    .long    0
+
+    .text
+  end;

+ 176 - 0
rtl/openbsd/x86_64/si_c.inc

@@ -0,0 +1,176 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2019 by Free Pascal development team
+
+    This file implements parts of the startup code for OpenBSD
+    programs that link to the C library.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+{$asmmode gas}
+
+var
+  _etext: Byte; external name '_etext';
+  _eprol: Byte; external name '_eprol';
+
+procedure _mcleanup; external name '_mcleanup';
+procedure atexit; external name 'atexit';
+procedure monstartup; external name 'monstartup';
+procedure _init; external name '_init';
+
+procedure _FPC_proc___start; forward;
+
+procedure _FPC_proc_start; assembler; nostackframe; public name '_start'; public name '__start';
+  asm
+    movq    %rbx,%r9
+    movq    %rcx,%r8
+    movq    %rdx,%rcx
+    movq    (%rsp),%rdi
+    leaq    16(%rsp,%rdi,8),%rdx
+    leaq    8(%rsp),%rsi
+    subq    $8,%rsp
+    andq    $0xFFFFFFFFFFFFFFF0,%rsp
+    addq    $8,%rsp
+    jmp     _FPC_proc___start
+  end;
+
+procedure _FPC_proc_haltproc; forward;
+function _strrchr(str: PChar; character: LongInt): PChar; forward;
+
+procedure _FPC_proc___start; assembler; nostackframe; public name '___start';
+  asm
+    pushq   %rbp
+    movq    %rsp, %rbp
+    subq    $64, %rsp
+    movl    %edi, -20(%rbp)
+    movq    %rsi, -32(%rbp)
+    movq    %rdx, -40(%rbp)
+    movq    %rcx, -48(%rbp)
+    movq    %r8, -56(%rbp)
+    movq    %r9, -64(%rbp)
+    movq    -40(%rbp), %rax
+    movq    %rax, environ(%rip)
+    movq    %rax,operatingsystem_parameter_envp(%rip)
+    movq    -32(%rbp), %rax
+    movq    (%rax), %rax
+    movq    %rax, -8(%rbp)
+    cmpq    $0, -8(%rbp)
+    je      .L2
+    movq    -8(%rbp), %rdi
+    movl    $47, %esi
+    call    _strrchr
+    movq    %rax, __progname(%rip)
+    movq    __progname(%rip), %rax
+    testq   %rax, %rax
+    jne     .L4
+    movq    -8(%rbp), %rax
+    movq    %rax, __progname(%rip)
+    jmp     .L6
+.L4:
+    movq    __progname(%rip), %rax
+    addq    $1, %rax
+    movq    %rax, __progname(%rip)
+.L6:
+    leaq    __progname_storage(%rip), %rax
+    movq    %rax, -16(%rbp)
+    jmp     .L7
+.L8:
+    movq    __progname(%rip), %rcx
+    movzbl  (%rcx), %edx
+    movq    -16(%rbp), %rax
+    movb    %dl, (%rax)
+    addq    $1, -16(%rbp)
+    leaq    1(%rcx), %rax
+    movq    %rax, __progname(%rip)
+.L7:
+    movq    __progname(%rip), %rax
+    movzbl  (%rax), %eax
+    testb   %al, %al
+    je      .L9
+    leaq    __progname_storage+255(%rip), %rax
+    cmpq    %rax, -16(%rbp)
+    jb      .L8
+.L9:
+    leaq    __progname_storage(%rip), %rax
+    movq    %rax, __progname(%rip)
+    movq    -16(%rbp), %rax
+    movb    $0, (%rax)
+.L2:
+    movq    _mcleanup@GOTPCREL(%rip), %rdi
+    call    atexit
+    movq    _etext@GOTPCREL(%rip), %rsi
+    movq    _eprol(%rip), %rdi
+    call    monstartup@plt
+    movl    $0, %eax
+    call    _init
+    movq    environ(%rip), %rdx
+    movq    -32(%rbp), %rsi
+    movl    -20(%rbp), %edi
+    movq    %rdi,operatingsystem_parameter_argc(%rip)
+    movq    %rsi,operatingsystem_parameter_argv(%rip)
+    movl    $0, %eax
+    call    PASCALMAIN
+    // movl    %eax, %edi
+    // call    exit
+    jmp     _FPC_proc_haltproc
+  end;
+
+procedure _FPC_proc_haltproc; assembler; nostackframe; public name '_haltproc';
+  asm
+    movq    $1,%rax
+    movl    operatingsystem_result(%rip),%ebx
+    pushq   %rbx
+    call    .Lactualsyscall
+    addq    $8,%rsp
+    jmp     _FPC_proc_haltproc
+
+.Lactualsyscall:
+    int     $0x80
+    jb      .LErrorcode
+    xor     %rbx,%rbx
+    ret
+.LErrorcode:
+    movq    %rax,%rbx
+    movq    $-1,%rax
+  end;
+
+function _strrchr(str: PChar; character: LongInt): PChar; assembler; nostackframe; public name '_strrchr';
+  asm
+    pushq   %rbp
+    movq    %rsp, %rbp
+    movq    %rdi, -24(%rbp)
+    movb    %sil, -25(%rbp)
+    movq    $0, -8(%rbp)
+.L13:
+    movq    -24(%rbp), %rdx
+    movzbl  (%rdx), %eax
+    cmpb    -25(%rbp), %al
+    jne     .L14
+    movq    -24(%rbp), %rax
+    movq    %rax, -8(%rbp)
+.L14:
+    movq    -24(%rbp), %rdx
+    movzbl  (%rdx), %eax
+    testb   %al, %al
+    jne     .L16
+    movq    -8(%rbp), %rax
+    movq    %rax, -16(%rbp)
+    jmp     .L12
+.L16:
+    addq    $1, -24(%rbp)
+    jmp     .L13
+.L12:
+    movq    -16(%rbp), %rax
+    leave
+  end;
+
+procedure MD_EPROL_LABEL; assembler; nostackframe; public name '_eprol';
+  asm
+  end;

+ 182 - 0
rtl/openbsd/x86_64/si_dll.inc

@@ -0,0 +1,182 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2019 by Free Pascal development team
+
+    This file implements parts of the startup code for OpenBSD
+    shared object (.so) libraries.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+{$asmmode gas}
+
+procedure _init; external name '_init';
+
+procedure _FPC_proc___start; forward;
+
+procedure _FPC_proc_start; assembler; nostackframe; public name '_start'; public name '__start';
+  asm
+    movq    %rbx,%r9
+    movq    %rcx,%r8
+    movq    %rdx,%rcx
+    movq    (%rsp),%rdi
+    leaq    16(%rsp,%rdi,8),%rdx
+    leaq    8(%rsp),%rsi
+    subq    $8,%rsp
+    andq    $0xFFFFFFFFFFFFFFF0,%rsp
+    addq    $8,%rsp
+    jmp     _FPC_proc___start
+  end;
+
+procedure _FPC_proc_haltproc; forward;
+function _strrchr(str: PChar; character: LongInt): PChar; forward;
+
+procedure _FPC_proc___start; assembler; nostackframe; public name '___start';
+  asm
+    pushq   %rbp
+    movq    %rsp, %rbp
+    subq    $64, %rsp
+    movl    %edi, -20(%rbp)
+    movq    %rsi, -32(%rbp)
+    movq    %rdx, -40(%rbp)
+    movq    %rcx, -48(%rbp)
+    movq    %r8, -56(%rbp)
+    movq    %r9, -64(%rbp)
+    movq    environ@GOTPCREL(%rip), %rdx
+    movq    -40(%rbp), %rax
+    movq    %rax, (%rdx)
+    movq    operatingsystem_parameter_envp@GOTPCREL(%rip), %rdx
+    movq    -40(%rbp), %rax
+    movq    %rax, (%rdx)
+
+    movl    -20(%rbp), %eax
+    movslq  %eax,%rdx
+    movq    operatingsystem_parameter_argc@GOTPCREL(%rip), %rax
+    movq    %rdx, (%rax)
+    movq    operatingsystem_parameter_argv@GOTPCREL(%rip), %rdx
+    movq    -32(%rbp), %rax
+    movq    %rax, (%rdx)
+    movq    -32(%rbp), %rax
+    movq    (%rax), %rax
+    movq    %rax, -8(%rbp)
+    cmpq    $0, -8(%rbp)
+    je      .L2
+    movq    -8(%rbp), %rdi
+    movl    $47, %esi
+    call    _strrchr
+    movq    %rax, %rdx
+    movq    __progname@GOTPCREL(%rip), %rax
+    movq    %rdx, (%rax)
+    movq    __progname@GOTPCREL(%rip), %rax
+    movq    (%rax), %rax
+    testq   %rax, %rax
+    jne     .L4
+    movq    __progname@GOTPCREL(%rip), %rdx
+    movq    -8(%rbp), %rax
+    movq    %rax, (%rdx)
+    jmp     .L6
+.L4:
+    movq    __progname@GOTPCREL(%rip), %rax
+    movq    (%rax), %rax
+    leaq    1(%rax), %rdx
+    movq    __progname@GOTPCREL(%rip), %rax
+    movq    %rdx, (%rax)
+.L6:
+    movq    __progname_storage@GOTPCREL(%rip), %rax
+    movq    %rax, -16(%rbp)
+    jmp     .L7
+.L8:
+    movq    __progname@GOTPCREL(%rip), %rax
+    movq    (%rax), %rcx
+    movzbl  (%rcx), %edx
+    movq    -16(%rbp), %rax
+    movb    %dl, (%rax)
+    addq    $1, -16(%rbp)
+    leaq    1(%rcx), %rdx
+    movq    __progname@GOTPCREL(%rip), %rax
+    movq    %rdx, (%rax)
+.L7:
+    movq    __progname@GOTPCREL(%rip), %rax
+    movq    (%rax), %rax
+    movzbl  (%rax), %eax
+    testb   %al, %al
+    je      .L9
+    movq    __progname_storage@GOTPCREL(%rip), %rax
+    leaq    255(%rax), %rax
+    cmpq    %rax, -16(%rbp)
+    jb      .L8
+.L9:
+    movq    -16(%rbp), %rax
+    movb    $0, (%rax)
+    movq    __progname@GOTPCREL(%rip), %rdx
+    movq    __progname_storage@GOTPCREL(%rip), %rax
+    movq    %rax, (%rdx)
+.L2:
+    movl    $0, %eax
+    call    _init@PLT
+    movq    environ@GOTPCREL(%rip), %rax
+    movq    (%rax), %rdx
+    movq    -32(%rbp), %rsi
+    movl    -20(%rbp), %edi
+    movl    $0, %eax
+    call    PASCALMAIN@PLT
+    // movl    %eax, %edi
+    // call    exit
+    jmp     _FPC_proc_haltproc@PLT
+  end;
+
+procedure _FPC_proc_haltproc; assembler; nostackframe; public name '_haltproc';
+  asm
+    movq    $1,%rax
+    movl    operatingsystem_result(%rip),%ebx
+    pushq   %rbx
+    call    .Lactualsyscall
+    addq    $8,%rsp
+    jmp     _FPC_proc_haltproc
+
+.Lactualsyscall:
+    int     $0x80
+    jb      .LErrorcode
+    xor     %rbx,%rbx
+    ret
+.LErrorcode:
+    movq    %rax,%rbx
+    movq    $-1,%rax
+  end;
+
+function _strrchr(str: PChar; character: LongInt): PChar; assembler; nostackframe; public name '_strrchr';
+  asm
+    pushq   %rbp
+    movq    %rsp, %rbp
+    movq    %rdi, -24(%rbp)
+    movb    %sil, -25(%rbp)
+    movq    $0, -8(%rbp)
+.L13:
+    movq    -24(%rbp), %rdx
+    movzbl  (%rdx), %eax
+    cmpb    -25(%rbp), %al
+    jne     .L14
+    movq    -24(%rbp), %rax
+    movq    %rax, -8(%rbp)
+.L14:
+    movq    -24(%rbp), %rdx
+    movzbl  (%rdx), %eax
+    testb   %al, %al
+    jne     .L16
+    movq    -8(%rbp), %rax
+    movq    %rax, -16(%rbp)
+    jmp     .L12
+.L16:
+    addq    $1, -24(%rbp)
+    jmp     .L13
+.L12:
+    movq    -16(%rbp), %rax
+    leave
+  end;
+

+ 165 - 0
rtl/openbsd/x86_64/si_prc.inc

@@ -0,0 +1,165 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2019 by Free Pascal development team
+
+    This file implements parts of the startup code for OpenBSD
+    programs that don't link to the C library.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+{$asmmode gas}
+
+procedure _FPC_proc___start; forward;
+
+procedure _FPC_proc_start; assembler; nostackframe; public name '_start'; public name '__start';
+  asm
+    movq    %rbx,%r9
+    movq    %rcx,%r8
+    movq    %rdx,%rcx
+    movq    (%rsp),%rdi
+    leaq    16(%rsp,%rdi,8),%rdx
+    leaq    8(%rsp),%rsi
+    subq    $8,%rsp
+    andq    $0xFFFFFFFFFFFFFFF0,%rsp
+    addq    $8,%rsp
+    jmp     _FPC_proc___start
+  end;
+
+procedure _FPC_proc_haltproc; forward;
+function _strrchr(str: PChar; character: LongInt): PChar; forward;
+
+procedure _FPC_proc___start; assembler; nostackframe; public name '___start';
+  asm
+    pushq   %rbp
+    movq    %rsp, %rbp
+    subq    $64, %rsp
+    movl    %edi, -20(%rbp)
+    movq    %rsi, -32(%rbp)
+    movq    %rdx, -40(%rbp)
+    movq    %rcx, -48(%rbp)
+    movq    %r8, -56(%rbp)
+    movq    %r9, -64(%rbp)
+    movq    -40(%rbp), %rax
+    movq    %rax, environ(%rip)
+    movq    %rax,operatingsystem_parameter_envp(%rip)
+    movq    -32(%rbp), %rax
+    movq    (%rax), %rax
+    movq    %rax, -8(%rbp)
+    cmpq    $0, -8(%rbp)
+    je      .L2
+    movq    -8(%rbp), %rdi
+    movl    $47, %esi
+    call    _strrchr
+    movq    %rax, __progname(%rip)
+    movq    __progname(%rip), %rax
+    testq   %rax, %rax
+    jne     .L4
+    movq    -8(%rbp), %rax
+    movq    %rax, __progname(%rip)
+    jmp     .L6
+.L4:
+    movq    __progname(%rip), %rax
+    addq    $1, %rax
+    movq    %rax, __progname(%rip)
+.L6:
+    leaq    __progname_storage(%rip), %rax
+    movq    %rax, -16(%rbp)
+    jmp     .L7
+.L8:
+    movq    __progname(%rip), %rcx
+    movzbl  (%rcx), %edx
+    movq    -16(%rbp), %rax
+    movb    %dl, (%rax)
+    addq    $1, -16(%rbp)
+    leaq    1(%rcx), %rax
+    movq    %rax, __progname(%rip)
+.L7:
+    movq    __progname(%rip), %rax
+    movzbl  (%rax), %eax
+    testb   %al, %al
+    je      .L9
+    leaq    __progname_storage+255(%rip), %rax
+    cmpq    %rax, -16(%rbp)
+    jb      .L8
+.L9:
+    leaq    __progname_storage(%rip), %rax
+    movq    %rax, __progname(%rip)
+    movq    -16(%rbp), %rax
+    movb    $0, (%rax)
+.L2:
+    // movl    $_mcleanup, %edi
+    // call    atexit
+    // movl    $_etext, %eax
+    // movq    %rax, %rsi
+    // movl    $_eprol, %eax
+    // movq    %rax, %rdi
+    // call    monstartup
+    // movl    $0, %eax
+    // call    __init
+    movq    environ(%rip), %rdx
+    movq    -32(%rbp), %rsi
+    movl    -20(%rbp), %edi
+    movq    %rdi,operatingsystem_parameter_argc(%rip)
+    movq    %rsi,operatingsystem_parameter_argv(%rip)
+    movl    $0, %eax
+    call    PASCALMAIN
+    // movl    %eax, %edi
+    // call    exit
+    jmp     _FPC_proc_haltproc
+  end;
+
+procedure _FPC_proc_haltproc; assembler; nostackframe; public name '_haltproc';
+  asm
+    movq    $1,%rax
+    movl    operatingsystem_result(%rip),%ebx
+    pushq   %rbx
+    call    .Lactualsyscall
+    addq    $8,%rsp
+    jmp     _FPC_proc_haltproc
+
+.Lactualsyscall:
+    int     $0x80
+    jb      .LErrorcode
+    xor     %rbx,%rbx
+    ret
+.LErrorcode:
+    movq    %rax,%rbx
+    movq    $-1,%rax
+  end;
+
+function _strrchr(str: PChar; character: LongInt): PChar; assembler; nostackframe; public name '_strrchr';
+  asm
+    pushq   %rbp
+    movq    %rsp, %rbp
+    movq    %rdi, -24(%rbp)
+    movb    %sil, -25(%rbp)
+    movq    $0, -8(%rbp)
+.L13:
+    movq    -24(%rbp), %rdx
+    movzbl  (%rdx), %eax
+    cmpb    -25(%rbp), %al
+    jne     .L14
+    movq    -24(%rbp), %rax
+    movq    %rax, -8(%rbp)
+.L14:
+    movq    -24(%rbp), %rdx
+    movzbl  (%rdx), %eax
+    testb   %al, %al
+    jne     .L16
+    movq    -8(%rbp), %rax
+    movq    %rax, -16(%rbp)
+    jmp     .L12
+.L16:
+    addq    $1, -24(%rbp)
+    jmp     .L13
+.L12:
+    movq    -16(%rbp), %rax
+    leave
+  end;

+ 5 - 2
utils/pas2js/docs/translation.html

@@ -1867,8 +1867,9 @@ function(){
       <li>A <b>record helper</b> can "extend" a record type. In $mode delphi a
         record helper can extend other types as well, see <i>type helper</i></li>
       <li>A <b>type helper</b> can extend all base types like integer, string,
-        char, boolean, double, currency, and some user types like enumeration,
-        set, range and array types. It cannot extend interfaces or helpers.<br>
+        char, boolean, double, currency, and user types like enumeration,
+        set, range, array, class, record and interface types.
+        It cannot extend helpers and procedural types.<br>
         Type helpers are enabled by default in <i>$mode delphi</i> and disabled in <i>$mode objfpc</i>.
         You can enable them with <b>{$modeswitch typehelpers}</b>.
         </li>
@@ -1929,6 +1930,8 @@ function(){
         <li><i>with value do ;</i> : uses a temporary variable. Delphi/FPC do not support it.</li>
         </ul>
       </li>
+      <li>A method with <i>external name</i> modifier is treated as an external
+        method of the helped type.</li>
     </ul>
     </div>
 

+ 1 - 1
utils/pas2js/httpcompiler.pp

@@ -285,7 +285,7 @@ end;
 procedure THTTPCompilerApplication.LoadDefaultMimeTypes;
 begin
   MimeTypes.AddType('application/xhtml+xml','xhtml;xht');
-  MimeTypes.AddType('text/html','htmll;htm');
+  MimeTypes.AddType('text/html','html;htm');
   MimeTypes.AddType('text/plain','txt');
   MimeTypes.AddType('application/javascript','js');
   MimeTypes.AddType('text/plain','map');