Prechádzať zdrojové kódy

* refactor booleans in systeminfo structure, they are now flags
* support for case aware filesystems (Windows), they do now only
one lookup if a file exists
* add -WI option to generate import section for DLL imports or
let the linker handle it. Default is still import section until
the Makefiles are fixed, then the generation can be left to the
linker

git-svn-id: trunk@2274 -

peter 19 rokov pred
rodič
commit
66f8276445

+ 1 - 1
compiler/assemble.pas

@@ -865,7 +865,7 @@ Implementation
                 relocsym:=nil;
                 relocsym:=nil;
               end;
               end;
             if (nidx=N_Function) and
             if (nidx=N_Function) and
-               target_info.use_function_relative_addresses then
+               (tf_use_function_relative_addresses in target_info.flags) then
               ofs:=0;
               ofs:=0;
             objectdata.writestab(ofs,relocsym,nidx,nother,nline,pstr);
             objectdata.writestab(ofs,relocsym,nidx,nother,nline,pstr);
           end;
           end;

+ 3 - 3
compiler/dbgstabs.pas

@@ -989,7 +989,7 @@ implementation
             strpcopy(p,'192,0,0,');
             strpcopy(p,'192,0,0,');
             {$IFDEF POWERPC64}strpcopy(strend(p), '.');{$ENDIF POWERPC64}
             {$IFDEF POWERPC64}strpcopy(strend(p), '.');{$ENDIF POWERPC64}
             strpcopy(strend(p),pd.mangledname);
             strpcopy(strend(p),pd.mangledname);
-            if (target_info.use_function_relative_addresses) then
+            if (tf_use_function_relative_addresses in target_info.flags) then
               begin
               begin
                 strpcopy(strend(p),'-');
                 strpcopy(strend(p),'-');
                 {$IFDEF POWERPC64}strpcopy(strend(p), '.');{$ENDIF POWERPC64}
                 {$IFDEF POWERPC64}strpcopy(strend(p), '.');{$ENDIF POWERPC64}
@@ -997,7 +997,7 @@ implementation
               end;
               end;
             templist.concat(Tai_stab.Create(stab_stabn,strnew(p)));
             templist.concat(Tai_stab.Create(stab_stabn,strnew(p)));
             strpcopy(p,'224,0,0,'+stabsendlabel.name);
             strpcopy(p,'224,0,0,'+stabsendlabel.name);
-            if (target_info.use_function_relative_addresses) then
+            if (tf_use_function_relative_addresses in target_info.flags) then
               begin
               begin
                 strpcopy(strend(p),'-');
                 strpcopy(strend(p),'-');
                 {$IFDEF POWERPC64}strpcopy(strend(p), '.');{$ENDIF POWERPC64}
                 {$IFDEF POWERPC64}strpcopy(strend(p), '.');{$ENDIF POWERPC64}
@@ -1491,7 +1491,7 @@ implementation
                 if (lastfileinfo.line<>currfileinfo.line) and (currfileinfo.line<>0) then
                 if (lastfileinfo.line<>currfileinfo.line) and (currfileinfo.line<>0) then
                   begin
                   begin
                      if assigned(currfuncname) and
                      if assigned(currfuncname) and
-                        (target_info.use_function_relative_addresses) then
+                        (tf_use_function_relative_addresses in target_info.flags) then
                       begin
                       begin
                         objectlibrary.getlabel(hlabel,alt_dbgline);
                         objectlibrary.getlabel(hlabel,alt_dbgline);
                         list.insertbefore(Tai_stab.Create_str(stab_stabn,tostr(n_textline)+',0,'+tostr(currfileinfo.line)+','+
                         list.insertbefore(Tai_stab.Create_str(stab_stabn,tostr(n_textline)+',0,'+tostr(currfileinfo.line)+','+

+ 5 - 0
compiler/fmodule.pas

@@ -140,6 +140,7 @@ interface
         linkunitofiles,
         linkunitofiles,
         linkunitstaticlibs,
         linkunitstaticlibs,
         linkunitsharedlibs,
         linkunitsharedlibs,
+        linkdlls,
         linkotherofiles,           { objects,libs loaded from the source }
         linkotherofiles,           { objects,libs loaded from the source }
         linkothersharedlibs,       { using $L or $LINKLIB or import lib (for linux) }
         linkothersharedlibs,       { using $L or $LINKLIB or import lib (for linux) }
         linkotherstaticlibs  : tlinkcontainer;
         linkotherstaticlibs  : tlinkcontainer;
@@ -418,6 +419,7 @@ implementation
         linkotherofiles:=TLinkContainer.Create;
         linkotherofiles:=TLinkContainer.Create;
         linkotherstaticlibs:=TLinkContainer.Create;
         linkotherstaticlibs:=TLinkContainer.Create;
         linkothersharedlibs:=TLinkContainer.Create;
         linkothersharedlibs:=TLinkContainer.Create;
+        linkdlls:=TLinkContainer.Create;
         crc:=0;
         crc:=0;
         interface_crc:=0;
         interface_crc:=0;
         flags:=0;
         flags:=0;
@@ -507,6 +509,7 @@ implementation
         linkotherofiles.Free;
         linkotherofiles.Free;
         linkotherstaticlibs.Free;
         linkotherstaticlibs.Free;
         linkothersharedlibs.Free;
         linkothersharedlibs.Free;
+        linkdlls.Free;
         stringdispose(objfilename);
         stringdispose(objfilename);
         stringdispose(newfilename);
         stringdispose(newfilename);
         stringdispose(ppufilename);
         stringdispose(ppufilename);
@@ -641,6 +644,8 @@ implementation
         linkotherstaticlibs:=TLinkContainer.Create;
         linkotherstaticlibs:=TLinkContainer.Create;
         linkothersharedlibs.Free;
         linkothersharedlibs.Free;
         linkothersharedlibs:=TLinkContainer.Create;
         linkothersharedlibs:=TLinkContainer.Create;
+        linkdlls.Free;
+        linkdlls:=TLinkContainer.Create;
         uses_imports:=false;
         uses_imports:=false;
         do_compile:=false;
         do_compile:=false;
         do_reload:=false;
         do_reload:=false;

+ 4 - 1
compiler/fppu.pas

@@ -356,7 +356,7 @@ uses
                Message1(unit_t_unitsearch,AddExtension(sourcefn^,pasext));
                Message1(unit_t_unitsearch,AddExtension(sourcefn^,pasext));
                fnd:=FindFile(AddExtension(sourcefn^,pasext),'',hs);
                fnd:=FindFile(AddExtension(sourcefn^,pasext),'',hs);
              end;
              end;
-            if not fnd and ((m_mac in aktmodeswitches) or target_info.p_ext_support) then
+            if not fnd and ((m_mac in aktmodeswitches) or (tf_p_ext_support in target_info.flags)) then
              begin
              begin
                Message1(unit_t_unitsearch,AddExtension(sourcefn^,pext));
                Message1(unit_t_unitsearch,AddExtension(sourcefn^,pext));
                fnd:=FindFile(AddExtension(sourcefn^,pext),'',hs);
                fnd:=FindFile(AddExtension(sourcefn^,pext),'',hs);
@@ -930,6 +930,8 @@ uses
                readlinkcontainer(LinkotherStaticLibs);
                readlinkcontainer(LinkotherStaticLibs);
              iblinkothersharedlibs :
              iblinkothersharedlibs :
                readlinkcontainer(LinkotherSharedLibs);
                readlinkcontainer(LinkotherSharedLibs);
+             iblinkdlls :
+               readlinkcontainer(LinkDlls);
              ibderefmap :
              ibderefmap :
                readderefmap;
                readderefmap;
              ibderefdata :
              ibderefdata :
@@ -1038,6 +1040,7 @@ uses
          writelinkcontainer(linkotherofiles,iblinkotherofiles,false);
          writelinkcontainer(linkotherofiles,iblinkotherofiles,false);
          writelinkcontainer(linkotherstaticlibs,iblinkotherstaticlibs,true);
          writelinkcontainer(linkotherstaticlibs,iblinkotherstaticlibs,true);
          writelinkcontainer(linkothersharedlibs,iblinkothersharedlibs,true);
          writelinkcontainer(linkothersharedlibs,iblinkothersharedlibs,true);
+         writelinkcontainer(linkdlls,iblinkdlls,true);
          ppufile.do_crc:=true;
          ppufile.do_crc:=true;
 
 
          { generate implementation deref data, the interface deref data is
          { generate implementation deref data, the interface deref data is

+ 27 - 5
compiler/globals.pas

@@ -178,6 +178,7 @@ interface
        dllrevision   : word;  { revision only for netware }
        dllrevision   : word;  { revision only for netware }
        UseDeffileForExports    : boolean;
        UseDeffileForExports    : boolean;
        UseDeffileForExportsSetExplicitly : boolean;
        UseDeffileForExportsSetExplicitly : boolean;
+       GenerateImportSection,
        RelocSection : boolean;
        RelocSection : boolean;
        RelocSectionSetExplicitly : boolean;
        RelocSectionSetExplicitly : boolean;
        LinkTypeSetExplicitly : boolean;
        LinkTypeSetExplicitly : boolean;
@@ -628,7 +629,7 @@ implementation
         fn2 : string;
         fn2 : string;
       begin
       begin
         result:=false;
         result:=false;
-        if source_info.files_case_relevent then
+        if tf_files_case_sensitive in source_info.flags then
           begin
           begin
             {
             {
               Search order for case sensitive systems:
               Search order for case sensitive systems:
@@ -663,6 +664,20 @@ implementation
                  end;
                  end;
               end;
               end;
           end
           end
+        else
+          if tf_files_case_aware in source_info.flags then
+            begin
+              {
+                Search order for case aware systems:
+                 1. NormalCase
+              }
+              FoundFile:=path+fn;
+              If FileExists(FoundFile) then
+               begin
+                 result:=true;
+                 exit;
+               end;
+           end
         else
         else
           begin
           begin
             { None case sensitive only lowercase }
             { None case sensitive only lowercase }
@@ -841,7 +856,8 @@ implementation
         if (not allowdot) and (s='.'+source_info.DirSep) then
         if (not allowdot) and (s='.'+source_info.DirSep) then
          s:='';
          s:='';
         { return }
         { return }
-        if source_info.files_case_relevent then
+        if (tf_files_case_aware in source_info.flags) or
+           (tf_files_case_sensitive in source_info.flags) then
          FixPath:=s
          FixPath:=s
         else
         else
          FixPath:=Lower(s);
          FixPath:=Lower(s);
@@ -979,7 +995,9 @@ implementation
      begin
      begin
        if source_info.system = system_powerpc_MACOS then
        if source_info.system = system_powerpc_MACOS then
          FixFileName:= TranslatePathToMac(s, true)
          FixFileName:= TranslatePathToMac(s, true)
-       else if source_info.files_case_relevent then
+       else
+        if (tf_files_case_aware in source_info.flags) or
+           (tf_files_case_sensitive in source_info.flags) then
         begin
         begin
           for i:=1 to length(s) do
           for i:=1 to length(s) do
            begin
            begin
@@ -1026,7 +1044,8 @@ implementation
         if (not allowdot) and (s='.'+target_info.DirSep) then
         if (not allowdot) and (s='.'+target_info.DirSep) then
          s:='';
          s:='';
         { return }
         { return }
-        if target_info.files_case_relevent then
+        if (tf_files_case_aware in target_info.flags) or
+           (tf_files_case_sensitive in target_info.flags) then
          TargetFixPath:=s
          TargetFixPath:=s
         else
         else
          TargetFixPath:=Lower(s);
          TargetFixPath:=Lower(s);
@@ -1039,7 +1058,9 @@ implementation
      begin
      begin
        if target_info.system = system_powerpc_MACOS then
        if target_info.system = system_powerpc_MACOS then
          TargetFixFileName:= TranslatePathToMac(s, true)
          TargetFixFileName:= TranslatePathToMac(s, true)
-       else if target_info.files_case_relevent then
+       else
+        if (tf_files_case_aware in target_info.flags) or
+           (tf_files_case_sensitive in target_info.flags) then
          begin
          begin
            for i:=1 to length(s) do
            for i:=1 to length(s) do
            begin
            begin
@@ -2177,6 +2198,7 @@ end;
         nwcopyright  := '';
         nwcopyright  := '';
         UseDeffileForExports:=false;
         UseDeffileForExports:=false;
         UseDeffileForExportsSetExplicitly:=false;
         UseDeffileForExportsSetExplicitly:=false;
+        GenerateImportSection:=true;
         RelocSection:=false;
         RelocSection:=false;
         RelocSectionSetExplicitly:=false;
         RelocSectionSetExplicitly:=false;
         LinkTypeSetExplicitly:=false;
         LinkTypeSetExplicitly:=false;

+ 45 - 5
compiler/link.pas

@@ -44,12 +44,14 @@ Type
     TLinker = class(TAbstractLinker)
     TLinker = class(TAbstractLinker)
     public
     public
        ObjectFiles,
        ObjectFiles,
+       DLLFiles,
        SharedLibFiles,
        SharedLibFiles,
        StaticLibFiles  : TStringList;
        StaticLibFiles  : TStringList;
        Constructor Create;virtual;
        Constructor Create;virtual;
        Destructor Destroy;override;
        Destructor Destroy;override;
        procedure AddModuleFiles(hp:tmodule);
        procedure AddModuleFiles(hp:tmodule);
        Procedure AddObject(const S,unitpath : String;isunit:boolean);
        Procedure AddObject(const S,unitpath : String;isunit:boolean);
+       Procedure AddDLL(const S : String);
        Procedure AddStaticLibrary(const S : String);
        Procedure AddStaticLibrary(const S : String);
        Procedure AddSharedLibrary(S : String);
        Procedure AddSharedLibrary(S : String);
        Procedure AddStaticCLibrary(const S : String);
        Procedure AddStaticCLibrary(const S : String);
@@ -85,6 +87,7 @@ var
 
 
 function FindObjectFile(s : string;const unitpath:string;isunit:boolean) : string;
 function FindObjectFile(s : string;const unitpath:string;isunit:boolean) : string;
 function FindLibraryFile(s:string;const prefix,ext:string;var foundfile : string) : boolean;
 function FindLibraryFile(s:string;const prefix,ext:string;var foundfile : string) : boolean;
+function FindDLL(const s:string;var founddll:string):boolean;
 
 
 procedure InitLinker;
 procedure InitLinker;
 procedure DoneLinker;
 procedure DoneLinker;
@@ -177,6 +180,34 @@ begin
 end;
 end;
 
 
 
 
+    { searches a (windows) DLL file }
+    function FindDLL(const s:string;var founddll:string):boolean;
+      var
+        sysdir : string;
+        Found : boolean;
+      begin
+        Found:=false;
+        { Look for DLL in:
+          1. Current dir
+          2. Library Path
+          3. windir,windir/system,windir/system32 }
+        Found:=FindFile(s,'.'+source_info.DirSep,founddll);
+        if (not found) then
+         Found:=librarysearchpath.FindFile(s,founddll);
+        if (not found) then
+         begin
+           sysdir:=FixPath(GetEnv('windir'),false);
+           Found:=FindFile(s,sysdir+';'+sysdir+'system'+source_info.DirSep+';'+sysdir+'system32'+source_info.DirSep,founddll);
+         end;
+        if (not found) then
+         begin
+           message1(exec_w_libfile_not_found,s);
+           FoundDll:=s;
+         end;
+        FindDll:=Found;
+      end;
+
+
 { searches an library file }
 { searches an library file }
 function FindLibraryFile(s:string;const prefix,ext:string;var foundfile : string) : boolean;
 function FindLibraryFile(s:string;const prefix,ext:string;var foundfile : string) : boolean;
 var
 var
@@ -231,6 +262,7 @@ Constructor TLinker.Create;
 begin
 begin
   Inherited Create;
   Inherited Create;
   ObjectFiles:=TStringList.Create_no_double;
   ObjectFiles:=TStringList.Create_no_double;
+  DLLFiles:=TStringList.Create_no_double;
   SharedLibFiles:=TStringList.Create_no_double;
   SharedLibFiles:=TStringList.Create_no_double;
   StaticLibFiles:=TStringList.Create_no_double;
   StaticLibFiles:=TStringList.Create_no_double;
 end;
 end;
@@ -239,6 +271,7 @@ end;
 Destructor TLinker.Destroy;
 Destructor TLinker.Destroy;
 begin
 begin
   ObjectFiles.Free;
   ObjectFiles.Free;
+  DLLFiles.Free;
   SharedLibFiles.Free;
   SharedLibFiles.Free;
   StaticLibFiles.Free;
   StaticLibFiles.Free;
 end;
 end;
@@ -308,15 +341,13 @@ begin
          end;
          end;
         { unit files }
         { unit files }
         while not linkunitofiles.empty do
         while not linkunitofiles.empty do
-        begin
           AddObject(linkunitofiles.getusemask(mask),path^,true);
           AddObject(linkunitofiles.getusemask(mask),path^,true);
-        end;
         while not linkunitstaticlibs.empty do
         while not linkunitstaticlibs.empty do
-         AddStaticLibrary(linkunitstaticlibs.getusemask(mask));
+          AddStaticLibrary(linkunitstaticlibs.getusemask(mask));
         while not linkunitsharedlibs.empty do
         while not linkunitsharedlibs.empty do
-         AddSharedLibrary(linkunitsharedlibs.getusemask(mask));
+          AddSharedLibrary(linkunitsharedlibs.getusemask(mask));
       end;
       end;
-   { Other needed .o and libs, specified using $L,$LINKLIB,external }
+     { Other needed .o and libs, specified using $L,$LINKLIB,external }
      mask:=link_allways;
      mask:=link_allways;
      while not linkotherofiles.empty do
      while not linkotherofiles.empty do
       AddObject(linkotherofiles.Getusemask(mask),path^,false);
       AddObject(linkotherofiles.Getusemask(mask),path^,false);
@@ -324,6 +355,9 @@ begin
       AddStaticCLibrary(linkotherstaticlibs.Getusemask(mask));
       AddStaticCLibrary(linkotherstaticlibs.Getusemask(mask));
      while not linkothersharedlibs.empty do
      while not linkothersharedlibs.empty do
       AddSharedCLibrary(linkothersharedlibs.Getusemask(mask));
       AddSharedCLibrary(linkothersharedlibs.Getusemask(mask));
+     { (Windows) DLLs }
+     while not linkdlls.empty do
+      AddDLL(linkdlls.Getusemask(mask));
    end;
    end;
 end;
 end;
 
 
@@ -334,6 +368,12 @@ begin
 end;
 end;
 
 
 
 
+Procedure TLinker.AddDLL(const S : String);
+begin
+  DLLFiles.Concat(s);
+end;
+
+
 Procedure TLinker.AddSharedLibrary(S:String);
 Procedure TLinker.AddSharedLibrary(S:String);
 begin
 begin
   if s='' then
   if s='' then

+ 1 - 1
compiler/ncgutil.pas

@@ -1772,7 +1772,7 @@ implementation
             list.concat(Tai_symbol.createname_global(hs,AT_FUNCTION,0))
             list.concat(Tai_symbol.createname_global(hs,AT_FUNCTION,0))
           else
           else
             list.concat(Tai_symbol.createname(hs,AT_FUNCTION,0));
             list.concat(Tai_symbol.createname(hs,AT_FUNCTION,0));
-          if target_info.use_function_relative_addresses then
+          if tf_use_function_relative_addresses in target_info.flags then
             list.concat(Tai_function_name.create(hs));
             list.concat(Tai_function_name.create(hs));
         until false;
         until false;
 
 

+ 11 - 6
compiler/options.pas

@@ -1125,12 +1125,9 @@ begin
                         else
                         else
                           apptype:=app_gui;
                           apptype:=app_gui;
                       end;
                       end;
-                    'T':
+                    'I':
                       begin
                       begin
-                        if UnsetBool(More, j) then
-                          apptype:=app_cui
-                        else
-                          apptype:=app_tool;
+                        GenerateImportSection:=UnsetBool(More,j);
                       end;
                       end;
                     'N':
                     'N':
                       begin
                       begin
@@ -1143,6 +1140,13 @@ begin
                         RelocSection:=not UnsetBool(More,j);
                         RelocSection:=not UnsetBool(More,j);
                         RelocSectionSetExplicitly:=true;
                         RelocSectionSetExplicitly:=true;
                       end;
                       end;
+                    'T':
+                      begin
+                        if UnsetBool(More, j) then
+                          apptype:=app_cui
+                        else
+                          apptype:=app_tool;
+                      end;
                     else
                     else
                       IllegalPara(opt);
                       IllegalPara(opt);
                   end;
                   end;
@@ -1993,7 +1997,8 @@ begin
       inputextension:=sourceext
       inputextension:=sourceext
      else if FileExists(inputdir+inputfile+pasext) then
      else if FileExists(inputdir+inputfile+pasext) then
        inputextension:=pasext
        inputextension:=pasext
-     else if ((m_mac in aktmodeswitches) or target_info.p_ext_support)
+     else if ((m_mac in aktmodeswitches) or
+              (tf_p_ext_support in target_info.flags))
              and FileExists(inputdir+inputfile+pext) then
              and FileExists(inputdir+inputfile+pext) then
        inputextension:=pext;
        inputextension:=pext;
    end;
    end;

+ 39 - 18
compiler/pdecsub.pas

@@ -1343,7 +1343,7 @@ begin
         end;
         end;
       (paramanager as tm68kparamanager).create_funcretloc_info(pd,calleeside);
       (paramanager as tm68kparamanager).create_funcretloc_info(pd,calleeside);
       (paramanager as tm68kparamanager).create_funcretloc_info(pd,callerside);
       (paramanager as tm68kparamanager).create_funcretloc_info(pd,callerside);
-  
+
       tprocdef(pd).extnumber:=get_intconst;
       tprocdef(pd).extnumber:=get_intconst;
     end;
     end;
 {$endif m68k}
 {$endif m68k}
@@ -1351,11 +1351,11 @@ begin
    if target_info.system = system_powerpc_amiga then
    if target_info.system = system_powerpc_amiga then
     begin
     begin
       include(pd.procoptions,po_syscall_sysv);
       include(pd.procoptions,po_syscall_sysv);
-      
+
       (paramanager as tppcparamanager).create_funcretloc_info(pd,calleeside);
       (paramanager as tppcparamanager).create_funcretloc_info(pd,calleeside);
       (paramanager as tppcparamanager).create_funcretloc_info(pd,callerside);
       (paramanager as tppcparamanager).create_funcretloc_info(pd,callerside);
     end else
     end else
-    
+
    if target_info.system = system_powerpc_morphos then
    if target_info.system = system_powerpc_morphos then
     begin
     begin
       if idtoken=_LEGACY then
       if idtoken=_LEGACY then
@@ -1376,7 +1376,7 @@ begin
       else if idtoken=_SYSVBASE then
       else if idtoken=_SYSVBASE then
         begin
         begin
           consume(_SYSVBASE);
           consume(_SYSVBASE);
-          include(pd.procoptions,po_syscall_sysvbase);    
+          include(pd.procoptions,po_syscall_sysvbase);
         end
         end
       else if idtoken=_R12BASE then
       else if idtoken=_R12BASE then
         begin
         begin
@@ -1814,7 +1814,7 @@ const
     ),(
     ),(
       idtok:_SYSCALL;
       idtok:_SYSCALL;
       { Different kind of syscalls are valid for AOS68k, AOSPPC and MOS. }
       { Different kind of syscalls are valid for AOS68k, AOSPPC and MOS. }
-      { FIX ME!!! MorphOS/AOS68k pd_flags should be: 
+      { FIX ME!!! MorphOS/AOS68k pd_flags should be:
         pd_interface, pd_implemen, pd_notobject, pd_notobjintf (KB) }
         pd_interface, pd_implemen, pd_notobject, pd_notobjintf (KB) }
       pd_flags : [pd_interface,pd_implemen,pd_procvar];
       pd_flags : [pd_interface,pd_implemen,pd_procvar];
       handler  : @pd_syscall;
       handler  : @pd_syscall;
@@ -2023,6 +2023,15 @@ const
 
 
 
 
     function proc_get_importname(pd:tprocdef):string;
     function proc_get_importname(pd:tprocdef):string;
+
+       function maybe_cprefix(const s:string):string;
+         begin
+           if not(pd.proccalloption in [pocall_cdecl,pocall_cppdecl]) then
+             result:=s
+           else
+             result:=target_info.Cprefix+s;
+         end;
+
       begin
       begin
         result:='';
         result:='';
         if not(po_external in pd.procoptions) then
         if not(po_external in pd.procoptions) then
@@ -2036,20 +2045,32 @@ const
         { external name specified }
         { external name specified }
           if assigned(pd.import_name) then
           if assigned(pd.import_name) then
             begin
             begin
-              { Win32 imports need to use the normal name since to functions
-                can refer to the same DLL function. This is also needed for compatability
-                with Delphi and TP7 }
-              if not(
-                     assigned(pd.import_dll) and
-                     (target_info.system in [system_i386_win32,system_i386_wdosx,
-                                             system_i386_emx,system_i386_os2,system_arm_wince,system_i386_wince])
-                    ) then
+              if assigned(pd.import_dll) then
                 begin
                 begin
-                  if not(pd.proccalloption in [pocall_cdecl,pocall_cppdecl]) then
-                    result:=pd.import_name^
-                  else
-                    result:=target_info.Cprefix+pd.import_name^;
-                end;
+                  { If we are not using direct dll linking under win32 then imports
+                    need to use the normal name since to functions can refer to the
+                    same DLL function. This is also needed for compatability
+                    with Delphi and TP7 }
+                  case target_info.system of
+                    system_i386_win32 :
+                      begin
+                        { We need to use the name with a _ prefix if we let ld.exe do
+                          the importing for us }
+                        if not GenerateImportSection then
+                          result:=target_info.Cprefix+pd.import_name^;
+                      end;
+                    system_i386_wdosx,
+                    system_i386_emx,system_i386_os2,
+                    system_arm_wince,system_i386_wince :
+                      begin
+                        { keep normal mangledname }
+                      end;
+                    else
+                      result:=maybe_cprefix(pd.import_name^);
+                  end;
+                end
+              else
+                result:=maybe_cprefix(pd.import_name^);
             end
             end
         else
         else
           begin
           begin

+ 1 - 1
compiler/pdecvar.pas

@@ -1146,7 +1146,7 @@ implementation
                              importlib.importvariable(tglobalvarsym(vs),C_name,dll_name);
                              importlib.importvariable(tglobalvarsym(vs),C_name,dll_name);
                            end
                            end
                           else
                           else
-                           if target_info.DllScanSupported then
+                           if tf_has_dllscanner in target_info.flags then
                             current_module.Externals.insert(tExternalsItem.create(vs.mangledname));
                             current_module.Externals.insert(tExternalsItem.create(vs.mangledname));
                         end;
                         end;
                      end
                      end

+ 2 - 2
compiler/pmodules.pas

@@ -52,7 +52,7 @@ implementation
         KeepShared      : TStringList;
         KeepShared      : TStringList;
       begin
       begin
         { try to create import entries from system dlls }
         { try to create import entries from system dlls }
-        if target_info.DllScanSupported and
+        if (tf_has_dllscanner in target_info.flags) and
            (not current_module.linkOtherSharedLibs.Empty) then
            (not current_module.linkOtherSharedLibs.Empty) then
          begin
          begin
            { Init DLLScanner }
            { Init DLLScanner }
@@ -366,7 +366,7 @@ implementation
         new_section(asmlist[al_globals],sec_data,'__stklen', sizeof(aint));
         new_section(asmlist[al_globals],sec_data,'__stklen', sizeof(aint));
         asmlist[al_globals].concat(Tai_symbol.Createname_global('__stklen',AT_DATA,sizeof(aint)));
         asmlist[al_globals].concat(Tai_symbol.Createname_global('__stklen',AT_DATA,sizeof(aint)));
         asmlist[al_globals].concat(Tai_const.Create_aint(stacksize));
         asmlist[al_globals].concat(Tai_const.Create_aint(stacksize));
-{$IFDEF POWERPC} 
+{$IFDEF POWERPC}
         { AmigaOS4 "stack cookie" support }
         { AmigaOS4 "stack cookie" support }
         if ( target_info.system = system_powerpc_amiga ) then
         if ( target_info.system = system_powerpc_amiga ) then
          begin
          begin

+ 2 - 1
compiler/ppu.pas

@@ -43,7 +43,7 @@ type
 {$endif Test_Double_checksum}
 {$endif Test_Double_checksum}
 
 
 const
 const
-  CurrentPPUVersion=51;
+  CurrentPPUVersion=52;
 
 
 { buffer sizes }
 { buffer sizes }
   maxentrysize = 1024;
   maxentrysize = 1024;
@@ -73,6 +73,7 @@ const
   iblinkotherofiles      = 8;
   iblinkotherofiles      = 8;
   iblinkotherstaticlibs  = 9;
   iblinkotherstaticlibs  = 9;
   iblinkothersharedlibs  = 10;
   iblinkothersharedlibs  = 10;
+  iblinkdlls             = 11;
   ibsymref               = 12;
   ibsymref               = 12;
   ibdefref               = 13;
   ibdefref               = 13;
   ibendsymtablebrowser   = 14;
   ibendsymtablebrowser   = 14;

+ 1 - 1
compiler/psub.pas

@@ -1496,7 +1496,7 @@ implementation
                  else
                  else
                    begin
                    begin
                      { add import name to external list for DLL scanning }
                      { add import name to external list for DLL scanning }
-                     if target_info.DllScanSupported then
+                     if tf_has_dllscanner in target_info.flags then
                        current_module.externals.insert(tExternalsItem.create(proc_get_importname(pd)));
                        current_module.externals.insert(tExternalsItem.create(proc_get_importname(pd)));
                    end;
                    end;
                end;
                end;

+ 8 - 7
compiler/systems.pas

@@ -259,7 +259,12 @@ interface
             tf_pic_uses_got,
             tf_pic_uses_got,
             tf_library_needs_pic,
             tf_library_needs_pic,
             tf_needs_symbol_type,
             tf_needs_symbol_type,
-            tf_section_threadvars
+            tf_section_threadvars,
+            tf_files_case_sensitive,
+            tf_files_case_aware,
+            tf_p_ext_support,
+            tf_has_dllscanner,
+            tf_use_function_relative_addresses
        );
        );
 
 
        psysteminfo = ^tsysteminfo;
        psysteminfo = ^tsysteminfo;
@@ -290,11 +295,9 @@ interface
           staticClibext,
           staticClibext,
           staticClibprefix : string[4];
           staticClibprefix : string[4];
           sharedClibprefix : string[4];
           sharedClibprefix : string[4];
-          p_ext_support:Boolean; {Whether extension .p is supported by default}
           Cprefix      : string[2];
           Cprefix      : string[2];
           newline      : string[2];
           newline      : string[2];
           dirsep       : char;
           dirsep       : char;
-          files_case_relevent : boolean;
           assem        : tasm;
           assem        : tasm;
           assemextern  : tasm; { external assembler, used by -a }
           assemextern  : tasm; { external assembler, used by -a }
           link         : tabstractlinkerclass;
           link         : tabstractlinkerclass;
@@ -312,10 +315,8 @@ interface
             (see also FIRST_PARM_OFFSET in GCC source)
             (see also FIRST_PARM_OFFSET in GCC source)
           }
           }
           first_parm_offset : longint;
           first_parm_offset : longint;
-          stacksize       : longint;
-          DllScanSupported : boolean;
-          use_function_relative_addresses : boolean;
-          abi : tabi;
+          stacksize    : longint;
+          abi          : tabi;
        end;
        end;
 
 
     const
     const

+ 4 - 12
compiler/systems/i_amiga.pas

@@ -32,7 +32,7 @@ unit i_amiga;
             system       : system_m68k_Amiga;
             system       : system_m68k_Amiga;
             name         : 'Commodore Amiga';
             name         : 'Commodore Amiga';
             shortname    : 'amiga';
             shortname    : 'amiga';
-            flags        : [];
+            flags        : [tf_files_case_sensitive,tf_use_function_relative_addresses];
             cpu          : cpu_m68k;
             cpu          : cpu_m68k;
             unit_env     : '';
             unit_env     : '';
             extradefines : '';
             extradefines : '';
@@ -54,11 +54,9 @@ unit i_amiga;
             staticClibext : '.a';
             staticClibext : '.a';
             staticClibprefix : 'lib';
             staticClibprefix : 'lib';
             sharedClibprefix : '';
             sharedClibprefix : '';
-            p_ext_support : false;
             Cprefix      : '';
             Cprefix      : '';
             newline      : #10;
             newline      : #10;
             dirsep       : '/';
             dirsep       : '/';
-            files_case_relevent : true;
             assem        : as_gas;
             assem        : as_gas;
             assemextern  : as_gas;
             assemextern  : as_gas;
             link         : nil;
             link         : nil;
@@ -85,9 +83,7 @@ unit i_amiga;
               );
               );
             first_parm_offset : 8;
             first_parm_offset : 8;
             stacksize    : 262144;
             stacksize    : 262144;
-            DllScanSupported:false;
-            use_function_relative_addresses : true;
-	    abi : abi_default;
+    	    abi : abi_default;
           );
           );
 
 
        system_powerpc_amiga_info : tsysteminfo =
        system_powerpc_amiga_info : tsysteminfo =
@@ -95,7 +91,7 @@ unit i_amiga;
             system       : system_powerpc_Amiga;
             system       : system_powerpc_Amiga;
             name         : 'AmigaOS for PowerPC';
             name         : 'AmigaOS for PowerPC';
             shortname    : 'amiga';
             shortname    : 'amiga';
-            flags        : [];
+            flags        : [tf_files_case_sensitive,tf_use_function_relative_addresses];
             cpu          : cpu_powerpc;
             cpu          : cpu_powerpc;
             unit_env     : '';
             unit_env     : '';
             extradefines : '';
             extradefines : '';
@@ -117,11 +113,9 @@ unit i_amiga;
             staticClibext : '.a';
             staticClibext : '.a';
             staticClibprefix : 'lib';
             staticClibprefix : 'lib';
             sharedClibprefix : '';
             sharedClibprefix : '';
-	    p_ext_support : false;
             Cprefix      : '';
             Cprefix      : '';
             newline      : #10;
             newline      : #10;
             dirsep       : '/';
             dirsep       : '/';
-            files_case_relevent : true;
             assem        : as_gas;
             assem        : as_gas;
             assemextern  : as_gas;
             assemextern  : as_gas;
             link         : nil;
             link         : nil;
@@ -148,9 +142,7 @@ unit i_amiga;
               );
               );
             first_parm_offset : 8;
             first_parm_offset : 8;
             stacksize    : 262144;
             stacksize    : 262144;
-            DllScanSupported:false;
-            use_function_relative_addresses : true;
-	    abi : abi_powerpc_sysv;
+	        abi : abi_powerpc_sysv;
           );
           );
 
 
   implementation
   implementation

+ 1 - 5
compiler/systems/i_beos.pas

@@ -32,7 +32,7 @@ unit i_beos;
             system       : system_i386_BeOS;
             system       : system_i386_BeOS;
             name         : 'Beos for i386';
             name         : 'Beos for i386';
             shortname    : 'Beos';
             shortname    : 'Beos';
-            flags        : [tf_under_development,tf_needs_symbol_size];
+            flags        : [tf_under_development,tf_needs_symbol_size,tf_files_case_sensitive,tf_use_function_relative_addresses];
             cpu          : cpu_i386;
             cpu          : cpu_i386;
             unit_env     : 'BEOSUNITS';
             unit_env     : 'BEOSUNITS';
             extradefines : 'UNIX;HASUNIX';
             extradefines : 'UNIX;HASUNIX';
@@ -54,11 +54,9 @@ unit i_beos;
             staticClibext : '.a';
             staticClibext : '.a';
             staticClibprefix : 'lib';
             staticClibprefix : 'lib';
             sharedClibprefix : 'lib';
             sharedClibprefix : 'lib';
-            p_ext_support : false;
             Cprefix      : '';
             Cprefix      : '';
             newline      : #10;
             newline      : #10;
             dirsep       : '/';
             dirsep       : '/';
-            files_case_relevent : true;
             assem        : as_gas;
             assem        : as_gas;
             assemextern  : as_gas;
             assemextern  : as_gas;
             link         : nil;
             link         : nil;
@@ -85,8 +83,6 @@ unit i_beos;
               );
               );
             first_parm_offset : 8;
             first_parm_offset : 8;
             stacksize    : 8192;
             stacksize    : 8192;
-            DllScanSupported:false;
-            use_function_relative_addresses : true
           );
           );
 
 
   implementation
   implementation

+ 14 - 40
compiler/systems/i_bsd.pas

@@ -35,7 +35,7 @@ unit i_bsd;
             system       : system_i386_FreeBSD;
             system       : system_i386_FreeBSD;
             name         : 'FreeBSD/ELF for i386';
             name         : 'FreeBSD/ELF for i386';
             shortname    : 'FreeBSD';
             shortname    : 'FreeBSD';
-            flags        : [tf_pic_uses_got];
+            flags        : [tf_pic_uses_got,tf_files_case_sensitive,tf_use_function_relative_addresses];
             cpu          : cpu_i386;
             cpu          : cpu_i386;
             unit_env     : 'BSDUNITS';
             unit_env     : 'BSDUNITS';
             extradefines : 'UNIX;BSD;HASUNIX';
             extradefines : 'UNIX;BSD;HASUNIX';
@@ -57,11 +57,9 @@ unit i_bsd;
             staticClibext : '.a';
             staticClibext : '.a';
             staticClibprefix : 'lib';
             staticClibprefix : 'lib';
             sharedClibprefix : 'lib';
             sharedClibprefix : 'lib';
-            p_ext_support : false;
             Cprefix      : '';
             Cprefix      : '';
             newline      : #10;
             newline      : #10;
             dirsep       : '/';
             dirsep       : '/';
-            files_case_relevent : true;
             assem        : as_i386_elf32;
             assem        : as_i386_elf32;
             assemextern  : as_gas;
             assemextern  : as_gas;
             link         : nil;
             link         : nil;
@@ -88,8 +86,7 @@ unit i_bsd;
               );
               );
             first_parm_offset : 8;
             first_parm_offset : 8;
             stacksize   : 262144;
             stacksize   : 262144;
-            DllScanSupported:false;
-            use_function_relative_addresses : true
+            abi          : abi_default;
           );
           );
 
 
 
 
@@ -98,7 +95,7 @@ unit i_bsd;
             system       : system_x86_64_freebsd;
             system       : system_x86_64_freebsd;
             name         : 'FreeBSD for x86-64';
             name         : 'FreeBSD for x86-64';
             shortname    : 'FreeBSD';
             shortname    : 'FreeBSD';
-            flags        : [tf_needs_symbol_size,tf_pic_uses_got{,tf_smartlink_sections}];
+            flags        : [tf_needs_symbol_size,tf_pic_uses_got,tf_files_case_sensitive,tf_use_function_relative_addresses{,tf_smartlink_sections}];
             cpu          : cpu_x86_64;
             cpu          : cpu_x86_64;
             unit_env     : 'BSDUNITS';
             unit_env     : 'BSDUNITS';
             extradefines : 'UNIX;HASUNIX';
             extradefines : 'UNIX;HASUNIX';
@@ -120,11 +117,9 @@ unit i_bsd;
             staticClibext : '.a';
             staticClibext : '.a';
             staticClibprefix : 'lib';
             staticClibprefix : 'lib';
             sharedClibprefix : 'lib';
             sharedClibprefix : 'lib';
-            p_ext_support : false;
             Cprefix      : '';
             Cprefix      : '';
             newline      : #10;
             newline      : #10;
             dirsep       : '/';
             dirsep       : '/';
-            files_case_relevent : true;
             assem        : as_gas;
             assem        : as_gas;
             assemextern  : as_gas;
             assemextern  : as_gas;
             link         : nil;
             link         : nil;
@@ -151,8 +146,7 @@ unit i_bsd;
               );
               );
             first_parm_offset : 16;
             first_parm_offset : 16;
             stacksize    : 256*1024;
             stacksize    : 256*1024;
-            DllScanSupported:false;
-            use_function_relative_addresses : true
+            abi          : abi_default;
           );
           );
 
 
 
 
@@ -161,7 +155,7 @@ unit i_bsd;
             system       : system_i386_NetBSD;
             system       : system_i386_NetBSD;
             name         : 'NetBSD for i386';
             name         : 'NetBSD for i386';
             shortname    : 'NetBSD';
             shortname    : 'NetBSD';
-            flags        : [tf_under_development];
+            flags        : [tf_under_development,tf_files_case_sensitive,tf_use_function_relative_addresses];
             cpu          : cpu_i386;
             cpu          : cpu_i386;
             unit_env     : 'BSDUNITS';
             unit_env     : 'BSDUNITS';
             extradefines : 'UNIX;BSD;HASUNIX';
             extradefines : 'UNIX;BSD;HASUNIX';
@@ -183,11 +177,9 @@ unit i_bsd;
             staticClibext : '.a';
             staticClibext : '.a';
             staticClibprefix : 'lib';
             staticClibprefix : 'lib';
             sharedClibprefix : 'lib';
             sharedClibprefix : 'lib';
-            p_ext_support : false;
             Cprefix      : '_';
             Cprefix      : '_';
             newline      : #10;
             newline      : #10;
             dirsep       : '/';
             dirsep       : '/';
-            files_case_relevent : true;
             assem        : as_gas;
             assem        : as_gas;
             assemextern  : as_gas;
             assemextern  : as_gas;
             link         : nil;
             link         : nil;
@@ -214,8 +206,7 @@ unit i_bsd;
               );
               );
             first_parm_offset : 8;
             first_parm_offset : 8;
             stacksize   : 262144;
             stacksize   : 262144;
-            DllScanSupported:false;
-            use_function_relative_addresses : true
+            abi          : abi_default;
           );
           );
 
 
        system_i386_openbsd_info : tsysteminfo =
        system_i386_openbsd_info : tsysteminfo =
@@ -223,7 +214,7 @@ unit i_bsd;
             system       : system_i386_OpenBSD;
             system       : system_i386_OpenBSD;
             name         : 'OpenBSD for i386';
             name         : 'OpenBSD for i386';
             shortname    : 'OpenBSD';
             shortname    : 'OpenBSD';
-            flags        : [tf_under_development];
+            flags        : [tf_under_development,tf_files_case_sensitive,tf_use_function_relative_addresses];
             cpu          : cpu_i386;
             cpu          : cpu_i386;
             unit_env     : 'BSDUNITS';
             unit_env     : 'BSDUNITS';
             extradefines : 'UNIX;BSD;HASUNIX';
             extradefines : 'UNIX;BSD;HASUNIX';
@@ -245,11 +236,9 @@ unit i_bsd;
             staticClibext : '.a';
             staticClibext : '.a';
             staticClibprefix : 'lib';
             staticClibprefix : 'lib';
             sharedClibprefix : 'lib';
             sharedClibprefix : 'lib';
-            p_ext_support : false;
             Cprefix      : '_';
             Cprefix      : '_';
             newline      : #10;
             newline      : #10;
             dirsep       : '/';
             dirsep       : '/';
-            files_case_relevent : true;
             assem        : as_gas;
             assem        : as_gas;
             assemextern  : as_gas;
             assemextern  : as_gas;
             link         : nil;
             link         : nil;
@@ -276,8 +265,7 @@ unit i_bsd;
               );
               );
             first_parm_offset : 8;
             first_parm_offset : 8;
             stacksize   : 262144;
             stacksize   : 262144;
-            DllScanSupported:false;
-            use_function_relative_addresses : true
+            abi          : abi_default;
           );
           );
 
 
        system_m68k_netbsd_info : tsysteminfo =
        system_m68k_netbsd_info : tsysteminfo =
@@ -285,7 +273,7 @@ unit i_bsd;
             system       : system_m68k_NetBSD;
             system       : system_m68k_NetBSD;
             name         : 'NetBSD for m68k';
             name         : 'NetBSD for m68k';
             shortname    : 'NetBSD';
             shortname    : 'NetBSD';
-            flags        : [tf_under_development];
+            flags        : [tf_under_development,tf_files_case_sensitive,tf_use_function_relative_addresses];
             cpu          : cpu_m68k;
             cpu          : cpu_m68k;
             unit_env     : 'BSDUNITS';
             unit_env     : 'BSDUNITS';
             extradefines : 'UNIX;BSD;HASUNIX';
             extradefines : 'UNIX;BSD;HASUNIX';
@@ -307,11 +295,9 @@ unit i_bsd;
             staticClibext : '.a';
             staticClibext : '.a';
             staticClibprefix : 'lib';
             staticClibprefix : 'lib';
             sharedClibprefix : 'lib';
             sharedClibprefix : 'lib';
-            p_ext_support : false;
             Cprefix      : '';
             Cprefix      : '';
             newline      : #10;
             newline      : #10;
             dirsep       : '/';
             dirsep       : '/';
-            files_case_relevent : true;
             assem        : as_gas;
             assem        : as_gas;
             assemextern  : as_gas;
             assemextern  : as_gas;
             link         : nil;
             link         : nil;
@@ -338,8 +324,7 @@ unit i_bsd;
               );
               );
             first_parm_offset : 8;
             first_parm_offset : 8;
             stacksize   : 262144;
             stacksize   : 262144;
-            DllScanSupported:false;
-            use_function_relative_addresses : true
+            abi          : abi_default;
           );
           );
 
 
        system_powerpc_netbsd_info : tsysteminfo =
        system_powerpc_netbsd_info : tsysteminfo =
@@ -347,7 +332,7 @@ unit i_bsd;
             system       : system_powerpc_netbsd;
             system       : system_powerpc_netbsd;
             name         : 'NetBSD for PowerPC';
             name         : 'NetBSD for PowerPC';
             shortname    : 'NetBSD';
             shortname    : 'NetBSD';
-            flags        : [tf_under_development];
+            flags        : [tf_under_development,tf_files_case_sensitive,tf_use_function_relative_addresses];
             cpu          : cpu_powerpc;
             cpu          : cpu_powerpc;
             unit_env     : '';
             unit_env     : '';
             extradefines : 'UNIX;BSD;HASUNIX';
             extradefines : 'UNIX;BSD;HASUNIX';
@@ -369,11 +354,9 @@ unit i_bsd;
             staticClibext : '.a';
             staticClibext : '.a';
             staticClibprefix : 'lib';
             staticClibprefix : 'lib';
             sharedClibprefix : 'lib';
             sharedClibprefix : 'lib';
-            p_ext_support : false;
             Cprefix      : '';
             Cprefix      : '';
             newline      : #10;
             newline      : #10;
             dirsep       : '/';
             dirsep       : '/';
-            files_case_relevent : true;
             assem        : as_gas;
             assem        : as_gas;
             assemextern  : as_gas;
             assemextern  : as_gas;
             link         : nil;
             link         : nil;
@@ -400,8 +383,6 @@ unit i_bsd;
               );
               );
             first_parm_offset : 8;
             first_parm_offset : 8;
             stacksize    : 32*1024*1024;
             stacksize    : 32*1024*1024;
-            DllScanSupported:false;
-            use_function_relative_addresses : true;
             { abi_powerpc_sysv doesn't work yet }
             { abi_powerpc_sysv doesn't work yet }
             abi : abi_powerpc_aix;
             abi : abi_powerpc_aix;
           );
           );
@@ -412,7 +393,7 @@ unit i_bsd;
             system       : system_powerpc_darwin;
             system       : system_powerpc_darwin;
             name         : 'Darwin for PowerPC';
             name         : 'Darwin for PowerPC';
             shortname    : 'Darwin';
             shortname    : 'Darwin';
-            flags        : [];
+            flags        : [tf_p_ext_support,tf_files_case_sensitive];
             cpu          : cpu_powerpc;
             cpu          : cpu_powerpc;
             unit_env     : 'BSDUNITS';
             unit_env     : 'BSDUNITS';
             extradefines : 'UNIX;BSD;HASUNIX';
             extradefines : 'UNIX;BSD;HASUNIX';
@@ -434,11 +415,9 @@ unit i_bsd;
             staticClibext : '.a';
             staticClibext : '.a';
             staticClibprefix : 'lib';
             staticClibprefix : 'lib';
             sharedClibprefix : 'lib';
             sharedClibprefix : 'lib';
-            p_ext_support : true;
             Cprefix      : '_';
             Cprefix      : '_';
             newline      : #10;
             newline      : #10;
             dirsep       : '/';
             dirsep       : '/';
-            files_case_relevent : true;
             assem        : as_darwin;
             assem        : as_darwin;
             assemextern  : as_darwin;
             assemextern  : as_darwin;
             link         : nil;
             link         : nil;
@@ -465,8 +444,6 @@ unit i_bsd;
               );
               );
             first_parm_offset : 24;
             first_parm_offset : 24;
             stacksize   : 262144;
             stacksize   : 262144;
-            DllScanSupported:false;
-            use_function_relative_addresses : false;
             abi : abi_powerpc_aix;
             abi : abi_powerpc_aix;
           );
           );
 
 
@@ -477,7 +454,7 @@ unit i_bsd;
             system       : system_i386_darwin;
             system       : system_i386_darwin;
             name         : 'Darwin for i386';
             name         : 'Darwin for i386';
             shortname    : 'Darwin';
             shortname    : 'Darwin';
-            flags        : [];
+            flags        : [tf_p_ext_support,tf_files_case_sensitive,tf_use_function_relative_addresses];
             cpu          : cpu_i386;
             cpu          : cpu_i386;
             unit_env     : 'BSDUNITS';
             unit_env     : 'BSDUNITS';
             extradefines : 'UNIX;BSD;HASUNIX';
             extradefines : 'UNIX;BSD;HASUNIX';
@@ -499,11 +476,9 @@ unit i_bsd;
             staticClibext : '.a';
             staticClibext : '.a';
             staticClibprefix : 'lib';
             staticClibprefix : 'lib';
             sharedClibprefix : 'lib';
             sharedClibprefix : 'lib';
-            p_ext_support : true;
             Cprefix      : '_';
             Cprefix      : '_';
             newline      : #10;
             newline      : #10;
             dirsep       : '/';
             dirsep       : '/';
-            files_case_relevent : true;
             assem        : as_darwin;
             assem        : as_darwin;
             assemextern  : as_darwin;
             assemextern  : as_darwin;
             link         : nil;
             link         : nil;
@@ -530,8 +505,7 @@ unit i_bsd;
               );
               );
             first_parm_offset : 8;
             first_parm_offset : 8;
             stacksize   : 262144;
             stacksize   : 262144;
-            DllScanSupported:false;
-            use_function_relative_addresses : true;
+            abi         : abi_default;
           );
           );
 
 
   implementation
   implementation

+ 0 - 4
compiler/systems/i_emx.pas

@@ -62,11 +62,9 @@ unit i_emx;
             staticClibext : '.a';
             staticClibext : '.a';
             staticClibprefix : '';
             staticClibprefix : '';
             sharedClibprefix : '';
             sharedClibprefix : '';
-            p_ext_support : false;
             Cprefix      : '_';
             Cprefix      : '_';
             newline      : #13#10;
             newline      : #13#10;
             dirsep       : '\';
             dirsep       : '\';
-            files_case_relevent : false;
             assem        : as_i386_as_aout;
             assem        : as_i386_as_aout;
             assemextern  : as_i386_as_aout;
             assemextern  : as_i386_as_aout;
             link         : nil;
             link         : nil;
@@ -93,8 +91,6 @@ unit i_emx;
               );
               );
             first_parm_offset : 8;
             first_parm_offset : 8;
             stacksize    : 256*1024;
             stacksize    : 256*1024;
-            DllScanSupported: false;
-            use_function_relative_addresses : false
           );
           );
 
 
 
 

+ 1 - 5
compiler/systems/i_gba.pas

@@ -32,7 +32,7 @@ unit i_gba;
             system       : system_arm_gba;
             system       : system_arm_gba;
             name         : 'GameBoy Advance';
             name         : 'GameBoy Advance';
             shortname    : 'gba';
             shortname    : 'gba';
-            flags        : [tf_needs_symbol_size];
+            flags        : [tf_needs_symbol_size,tf_files_case_sensitive,tf_use_function_relative_addresses];
             cpu          : cpu_arm;
             cpu          : cpu_arm;
             unit_env     : 'LINUXUNITS';
             unit_env     : 'LINUXUNITS';
             extradefines : 'UNIX;HASUNIX';
             extradefines : 'UNIX;HASUNIX';
@@ -54,11 +54,9 @@ unit i_gba;
             staticClibext : '.a';
             staticClibext : '.a';
             staticClibprefix : 'lib';
             staticClibprefix : 'lib';
             sharedClibprefix : 'lib';
             sharedClibprefix : 'lib';
-            p_ext_support : false;
             Cprefix      : '';
             Cprefix      : '';
             newline      : #10;
             newline      : #10;
             dirsep       : '/';
             dirsep       : '/';
-            files_case_relevent : true;
             assem        : as_gas;
             assem        : as_gas;
             assemextern  : as_gas;
             assemextern  : as_gas;
             link         : nil;
             link         : nil;
@@ -85,8 +83,6 @@ unit i_gba;
               );
               );
             first_parm_offset : 8;
             first_parm_offset : 8;
             stacksize    : 262144;
             stacksize    : 262144;
-            DllScanSupported:false;
-            use_function_relative_addresses : true;
             abi : abi_default
             abi : abi_default
           );
           );
 
 

+ 1 - 5
compiler/systems/i_go32v2.pas

@@ -32,7 +32,7 @@ unit i_go32v2;
             system       : system_i386_GO32V2;
             system       : system_i386_GO32V2;
             name         : 'GO32 V2 DOS extender';
             name         : 'GO32 V2 DOS extender';
             shortname    : 'Go32v2';
             shortname    : 'Go32v2';
-            flags        : [tf_use_8_3];
+            flags        : [tf_use_8_3,tf_use_function_relative_addresses];
             cpu          : cpu_i386;
             cpu          : cpu_i386;
             unit_env     : 'GO32V2UNITS';
             unit_env     : 'GO32V2UNITS';
             extradefines : 'DPMI';
             extradefines : 'DPMI';
@@ -54,11 +54,9 @@ unit i_go32v2;
             staticClibext : '.a';
             staticClibext : '.a';
             staticClibprefix : '';
             staticClibprefix : '';
             sharedClibprefix : '';
             sharedClibprefix : '';
-            p_ext_support : false;
             Cprefix      : '_';
             Cprefix      : '_';
             newline      : #13#10;
             newline      : #13#10;
             dirsep       : '\';
             dirsep       : '\';
-            files_case_relevent : false;
             assem        : as_i386_coff;
             assem        : as_i386_coff;
             assemextern  : as_gas;
             assemextern  : as_gas;
             link         : nil;
             link         : nil;
@@ -85,8 +83,6 @@ unit i_go32v2;
               );
               );
             first_parm_offset : 8;
             first_parm_offset : 8;
             stacksize    : 262144;
             stacksize    : 262144;
-            DllScanSupported : false;
-            use_function_relative_addresses : true
           );
           );
 
 
   implementation
   implementation

+ 9 - 45
compiler/systems/i_linux.pas

@@ -50,7 +50,7 @@ unit i_linux;
 {$ifdef segment_threadvars}
 {$ifdef segment_threadvars}
                             tf_section_threadvars,
                             tf_section_threadvars,
 {$endif segment_threadvars}
 {$endif segment_threadvars}
-                            tf_needs_symbol_type];
+                            tf_needs_symbol_type,tf_files_case_sensitive,tf_use_function_relative_addresses];
             cpu          : cpu_i386;
             cpu          : cpu_i386;
             unit_env     : 'LINUXUNITS';
             unit_env     : 'LINUXUNITS';
             extradefines : 'UNIX;HASUNIX';
             extradefines : 'UNIX;HASUNIX';
@@ -72,11 +72,9 @@ unit i_linux;
             staticClibext : '.a';
             staticClibext : '.a';
             staticClibprefix : 'lib';
             staticClibprefix : 'lib';
             sharedClibprefix : 'lib';
             sharedClibprefix : 'lib';
-            p_ext_support : false;
             Cprefix      : '';
             Cprefix      : '';
             newline      : #10;
             newline      : #10;
             dirsep       : '/';
             dirsep       : '/';
-            files_case_relevent : true;
             assem        : as_i386_elf32;
             assem        : as_i386_elf32;
             assemextern  : as_gas;
             assemextern  : as_gas;
             link         : nil;
             link         : nil;
@@ -103,8 +101,6 @@ unit i_linux;
               );
               );
             first_parm_offset : 8;
             first_parm_offset : 8;
             stacksize    : 262144;
             stacksize    : 262144;
-            DllScanSupported:false;
-            use_function_relative_addresses : true;
             abi : abi_default
             abi : abi_default
           );
           );
 
 
@@ -113,7 +109,7 @@ unit i_linux;
             system       : system_x86_6432_LINUX;
             system       : system_x86_6432_LINUX;
             name         : 'Linux for x64_6432';
             name         : 'Linux for x64_6432';
             shortname    : 'Linux6432';
             shortname    : 'Linux6432';
-            flags        : [tf_needs_symbol_size,tf_pic_uses_got{,tf_smartlink_sections}];
+            flags        : [tf_needs_symbol_size,tf_needs_symbol_type,tf_files_case_sensitive,tf_use_function_relative_addresses,tf_pic_uses_got{,tf_smartlink_sections}];
             cpu          : cpu_x86_64;
             cpu          : cpu_x86_64;
             unit_env     : 'LINUXUNITS';
             unit_env     : 'LINUXUNITS';
             extradefines : 'UNIX;HASUNIX';
             extradefines : 'UNIX;HASUNIX';
@@ -135,11 +131,9 @@ unit i_linux;
             staticClibext : '.a';
             staticClibext : '.a';
             staticClibprefix : 'lib';
             staticClibprefix : 'lib';
             sharedClibprefix : 'lib';
             sharedClibprefix : 'lib';
-            p_ext_support : false;
             Cprefix      : '';
             Cprefix      : '';
             newline      : #10;
             newline      : #10;
             dirsep       : '/';
             dirsep       : '/';
-            files_case_relevent : true;
             assem        : as_i386_elf32;
             assem        : as_i386_elf32;
             assemextern  : as_gas;
             assemextern  : as_gas;
             link         : nil;
             link         : nil;
@@ -166,8 +160,6 @@ unit i_linux;
               );
               );
             first_parm_offset : 8;
             first_parm_offset : 8;
             stacksize    : 262144;
             stacksize    : 262144;
-            DllScanSupported:false;
-            use_function_relative_addresses : true;
             abi : abi_default
             abi : abi_default
           );
           );
 
 
@@ -176,7 +168,7 @@ unit i_linux;
             system       : system_m68k_linux;
             system       : system_m68k_linux;
             name         : 'Linux for m68k';
             name         : 'Linux for m68k';
             shortname    : 'Linux';
             shortname    : 'Linux';
-            flags        : [tf_needs_symbol_size,tf_needs_symbol_type];
+            flags        : [tf_needs_symbol_size,tf_needs_symbol_type,tf_files_case_sensitive,tf_use_function_relative_addresses];
             cpu          : cpu_m68k;
             cpu          : cpu_m68k;
             unit_env     : 'LINUXUNITS';
             unit_env     : 'LINUXUNITS';
             extradefines : 'UNIX;HASUNIX';
             extradefines : 'UNIX;HASUNIX';
@@ -198,11 +190,9 @@ unit i_linux;
             staticClibext : '.a';
             staticClibext : '.a';
             staticClibprefix : 'lib';
             staticClibprefix : 'lib';
             sharedClibprefix : 'lib';
             sharedClibprefix : 'lib';
-            p_ext_support : false;
             Cprefix      : '';
             Cprefix      : '';
             newline      : #10;
             newline      : #10;
             dirsep       : '/';
             dirsep       : '/';
-            files_case_relevent : true;
             assem        : as_gas;
             assem        : as_gas;
             assemextern  : as_gas;
             assemextern  : as_gas;
             link         : nil;
             link         : nil;
@@ -229,8 +219,6 @@ unit i_linux;
               );
               );
             first_parm_offset : 8;
             first_parm_offset : 8;
             stacksize    : 32*1024*1024;
             stacksize    : 32*1024*1024;
-            DllScanSupported:false;
-            use_function_relative_addresses : true;
             abi : abi_default
             abi : abi_default
           );
           );
 
 
@@ -239,7 +227,7 @@ unit i_linux;
             system       : system_powerpc_LINUX;
             system       : system_powerpc_LINUX;
             name         : 'Linux for PowerPC';
             name         : 'Linux for PowerPC';
             shortname    : 'Linux';
             shortname    : 'Linux';
-            flags        : [tf_needs_symbol_size,tf_needs_symbol_type];
+            flags        : [tf_needs_symbol_size,tf_needs_symbol_type,tf_files_case_sensitive,tf_use_function_relative_addresses];
             cpu          : cpu_powerpc;
             cpu          : cpu_powerpc;
             unit_env     : '';
             unit_env     : '';
             extradefines : 'UNIX;HASUNIX';
             extradefines : 'UNIX;HASUNIX';
@@ -261,11 +249,9 @@ unit i_linux;
             staticClibext : '.a';
             staticClibext : '.a';
             staticClibprefix : 'lib';
             staticClibprefix : 'lib';
             sharedClibprefix : 'lib';
             sharedClibprefix : 'lib';
-            p_ext_support : false;
             Cprefix      : '';
             Cprefix      : '';
             newline      : #10;
             newline      : #10;
             dirsep       : '/';
             dirsep       : '/';
-            files_case_relevent : true;
             assem        : as_gas;
             assem        : as_gas;
             assemextern  : as_gas;
             assemextern  : as_gas;
             link         : nil;
             link         : nil;
@@ -292,8 +278,6 @@ unit i_linux;
               );
               );
             first_parm_offset : 8;
             first_parm_offset : 8;
             stacksize    : 32*1024*1024;
             stacksize    : 32*1024*1024;
-            DllScanSupported:false;
-            use_function_relative_addresses : true;
             abi : abi_powerpc_sysv;
             abi : abi_powerpc_sysv;
           );
           );
 
 
@@ -302,7 +286,7 @@ unit i_linux;
             system       : system_powerpc64_LINUX;
             system       : system_powerpc64_LINUX;
             name         : 'Linux for PowerPC64';
             name         : 'Linux for PowerPC64';
             shortname    : 'Linux';
             shortname    : 'Linux';
-            flags        : [tf_needs_symbol_size,tf_needs_symbol_type];
+            flags        : [tf_needs_symbol_size,tf_needs_symbol_type,tf_files_case_sensitive,tf_use_function_relative_addresses];
             cpu          : cpu_powerpc64;
             cpu          : cpu_powerpc64;
             unit_env     : '';
             unit_env     : '';
             extradefines : 'UNIX;HASUNIX';
             extradefines : 'UNIX;HASUNIX';
@@ -324,11 +308,9 @@ unit i_linux;
             staticClibext : '.a';
             staticClibext : '.a';
             staticClibprefix : 'lib';
             staticClibprefix : 'lib';
             sharedClibprefix : 'lib';
             sharedClibprefix : 'lib';
-            p_ext_support : false;
             Cprefix      : '';
             Cprefix      : '';
             newline      : #10;
             newline      : #10;
             dirsep       : '/';
             dirsep       : '/';
-            files_case_relevent : true;
             assem        : as_gas;
             assem        : as_gas;
             assemextern  : as_gas;
             assemextern  : as_gas;
             link         : nil;
             link         : nil;
@@ -355,8 +337,6 @@ unit i_linux;
               );
               );
             first_parm_offset : 8;
             first_parm_offset : 8;
             stacksize    : 10*1024*1024;
             stacksize    : 10*1024*1024;
-            DllScanSupported:false;
-            use_function_relative_addresses : true;
             abi : abi_default
             abi : abi_default
           );
           );
 
 
@@ -365,7 +345,7 @@ unit i_linux;
             system       : system_alpha_LINUX;
             system       : system_alpha_LINUX;
             name         : 'Linux for Alpha';
             name         : 'Linux for Alpha';
             shortname    : 'Linux';
             shortname    : 'Linux';
-            flags        : [tf_needs_symbol_size,tf_needs_symbol_type];
+            flags        : [tf_needs_symbol_size,tf_needs_symbol_type,tf_files_case_sensitive,tf_use_function_relative_addresses];
             cpu          : cpu_alpha;
             cpu          : cpu_alpha;
             unit_env     : 'LINUXUNITS';
             unit_env     : 'LINUXUNITS';
             extradefines : 'UNIX;HASUNIX';
             extradefines : 'UNIX;HASUNIX';
@@ -387,11 +367,9 @@ unit i_linux;
             staticClibext : '.a';
             staticClibext : '.a';
             staticClibprefix : 'lib';
             staticClibprefix : 'lib';
             sharedClibprefix : 'lib';
             sharedClibprefix : 'lib';
-            p_ext_support : false;
             Cprefix      : '';
             Cprefix      : '';
             newline      : #10;
             newline      : #10;
             dirsep       : '/';
             dirsep       : '/';
-            files_case_relevent : true;
             assem        : as_gas;
             assem        : as_gas;
             assemextern  : as_gas;
             assemextern  : as_gas;
             link         : nil;
             link         : nil;
@@ -418,8 +396,6 @@ unit i_linux;
               );
               );
             first_parm_offset : 8;
             first_parm_offset : 8;
             stacksize    : 32*1024*1024;
             stacksize    : 32*1024*1024;
-            DllScanSupported:false;
-            use_function_relative_addresses : true;
             abi : abi_default
             abi : abi_default
           );
           );
 
 
@@ -429,7 +405,7 @@ unit i_linux;
             name         : 'Linux for x86-64';
             name         : 'Linux for x86-64';
             shortname    : 'Linux';
             shortname    : 'Linux';
             flags        : [tf_needs_symbol_size,tf_needs_dwarf_cfi,
             flags        : [tf_needs_symbol_size,tf_needs_dwarf_cfi,
-                            tf_library_needs_pic,tf_needs_symbol_type];
+                            tf_library_needs_pic,tf_needs_symbol_type,tf_files_case_sensitive,tf_use_function_relative_addresses];
             cpu          : cpu_x86_64;
             cpu          : cpu_x86_64;
             unit_env     : 'LINUXUNITS';
             unit_env     : 'LINUXUNITS';
             extradefines : 'UNIX;HASUNIX';
             extradefines : 'UNIX;HASUNIX';
@@ -451,11 +427,9 @@ unit i_linux;
             staticClibext : '.a';
             staticClibext : '.a';
             staticClibprefix : 'lib';
             staticClibprefix : 'lib';
             sharedClibprefix : 'lib';
             sharedClibprefix : 'lib';
-            p_ext_support : false;
             Cprefix      : '';
             Cprefix      : '';
             newline      : #10;
             newline      : #10;
             dirsep       : '/';
             dirsep       : '/';
-            files_case_relevent : true;
             assem        : as_gas;
             assem        : as_gas;
             assemextern  : as_gas;
             assemextern  : as_gas;
             link         : nil;
             link         : nil;
@@ -482,8 +456,6 @@ unit i_linux;
               );
               );
             first_parm_offset : 16;
             first_parm_offset : 16;
             stacksize    : 256*1024;
             stacksize    : 256*1024;
-            DllScanSupported:false;
-            use_function_relative_addresses : true;
             abi : abi_default
             abi : abi_default
           );
           );
 
 
@@ -492,7 +464,7 @@ unit i_linux;
             system       : system_SPARC_Linux;
             system       : system_SPARC_Linux;
             name         : 'Linux for SPARC';
             name         : 'Linux for SPARC';
             shortname    : 'Linux';
             shortname    : 'Linux';
-            flags        : [tf_needs_symbol_size,tf_library_needs_pic,tf_needs_symbol_type];
+            flags        : [tf_needs_symbol_size,tf_library_needs_pic,tf_needs_symbol_type,tf_files_case_sensitive,tf_use_function_relative_addresses];
             cpu          : cpu_SPARC;
             cpu          : cpu_SPARC;
             unit_env     : 'LINUXUNITS';
             unit_env     : 'LINUXUNITS';
             extradefines : 'UNIX;HASUNIX';
             extradefines : 'UNIX;HASUNIX';
@@ -514,11 +486,9 @@ unit i_linux;
             staticClibext : '.a';
             staticClibext : '.a';
             staticClibprefix : 'lib';
             staticClibprefix : 'lib';
             sharedClibprefix : 'lib';
             sharedClibprefix : 'lib';
-            p_ext_support : false;
             Cprefix      : '';
             Cprefix      : '';
             newline      : #10;
             newline      : #10;
             dirsep       : '/';
             dirsep       : '/';
-            files_case_relevent : true;
             assem        : as_gas;
             assem        : as_gas;
             assemextern  : as_gas;
             assemextern  : as_gas;
             link         : nil;
             link         : nil;
@@ -545,8 +515,6 @@ unit i_linux;
               );
               );
             first_parm_offset : 92;
             first_parm_offset : 92;
             stacksize    : 262144;
             stacksize    : 262144;
-            DllScanSupported:false;
-            use_function_relative_addresses : true;
             abi : abi_default
             abi : abi_default
           );
           );
 
 
@@ -555,7 +523,7 @@ unit i_linux;
             system       : system_arm_Linux;
             system       : system_arm_Linux;
             name         : 'Linux for ARM';
             name         : 'Linux for ARM';
             shortname    : 'Linux';
             shortname    : 'Linux';
-            flags        : [tf_needs_symbol_size,tf_needs_symbol_type];
+            flags        : [tf_needs_symbol_size,tf_needs_symbol_type,tf_files_case_sensitive,tf_use_function_relative_addresses];
             cpu          : cpu_arm;
             cpu          : cpu_arm;
             unit_env     : 'LINUXUNITS';
             unit_env     : 'LINUXUNITS';
             extradefines : 'UNIX;HASUNIX';
             extradefines : 'UNIX;HASUNIX';
@@ -577,11 +545,9 @@ unit i_linux;
             staticClibext : '.a';
             staticClibext : '.a';
             staticClibprefix : 'lib';
             staticClibprefix : 'lib';
             sharedClibprefix : 'lib';
             sharedClibprefix : 'lib';
-            p_ext_support : false;
             Cprefix      : '';
             Cprefix      : '';
             newline      : #10;
             newline      : #10;
             dirsep       : '/';
             dirsep       : '/';
-            files_case_relevent : true;
             assem        : as_gas;
             assem        : as_gas;
             assemextern  : as_gas;
             assemextern  : as_gas;
             link         : nil;
             link         : nil;
@@ -608,8 +574,6 @@ unit i_linux;
               );
               );
             first_parm_offset : 8;
             first_parm_offset : 8;
             stacksize    : 262144;
             stacksize    : 262144;
-            DllScanSupported:false;
-            use_function_relative_addresses : true;
             abi : abi_default
             abi : abi_default
           );
           );
 
 

+ 1 - 5
compiler/systems/i_macos.pas

@@ -31,7 +31,7 @@ unit i_macos;
             system       : system_powerpc_MACOS;
             system       : system_powerpc_MACOS;
             name         : 'Mac OS for PowerPC';
             name         : 'Mac OS for PowerPC';
             shortname    : 'MacOS';
             shortname    : 'MacOS';
-            flags        : [];
+            flags        : [tf_p_ext_support,tf_files_case_aware,tf_use_function_relative_addresses];
             cpu          : cpu_powerpc;
             cpu          : cpu_powerpc;
             unit_env     : '';
             unit_env     : '';
             extradefines : '';
             extradefines : '';
@@ -53,11 +53,9 @@ unit i_macos;
             staticClibext : 'Lib';
             staticClibext : 'Lib';
             staticClibprefix : '';
             staticClibprefix : '';
             sharedClibprefix : '';
             sharedClibprefix : '';
-            p_ext_support : true;
             Cprefix      : '';
             Cprefix      : '';
             newline      : #13;
             newline      : #13;
             dirsep       : ':';
             dirsep       : ':';
-            files_case_relevent : false;
             assem        : as_powerpc_mpw;
             assem        : as_powerpc_mpw;
             assemextern  : as_powerpc_mpw;
             assemextern  : as_powerpc_mpw;
             link         : nil;
             link         : nil;
@@ -84,8 +82,6 @@ unit i_macos;
               );
               );
             first_parm_offset : 8;
             first_parm_offset : 8;
             stacksize    : 262144;
             stacksize    : 262144;
-            DllScanSupported:false;
-            use_function_relative_addresses : true;
             abi : abi_powerpc_aix;
             abi : abi_powerpc_aix;
           );
           );
 
 

+ 1 - 5
compiler/systems/i_morph.pas

@@ -32,7 +32,7 @@ unit i_morph;
             system       : system_powerpc_MorphOS;
             system       : system_powerpc_MorphOS;
             name         : 'MorphOS';
             name         : 'MorphOS';
             shortname    : 'MorphOS';
             shortname    : 'MorphOS';
-            flags        : [];
+            flags        : [tf_files_case_sensitive,tf_use_function_relative_addresses];
             cpu          : cpu_powerpc;
             cpu          : cpu_powerpc;
             unit_env     : '';
             unit_env     : '';
             extradefines : '';
             extradefines : '';
@@ -54,11 +54,9 @@ unit i_morph;
             staticClibext : '.a';
             staticClibext : '.a';
             staticClibprefix : 'lib';
             staticClibprefix : 'lib';
             sharedClibprefix : '';
             sharedClibprefix : '';
-            p_ext_support : false;
             Cprefix      : '';
             Cprefix      : '';
             newline      : #10;
             newline      : #10;
             dirsep       : '/';
             dirsep       : '/';
-            files_case_relevent : true;
             assem        : as_gas;
             assem        : as_gas;
             assemextern  : as_gas;
             assemextern  : as_gas;
             link         : nil;
             link         : nil;
@@ -85,8 +83,6 @@ unit i_morph;
               );
               );
             first_parm_offset : 8;
             first_parm_offset : 8;
             stacksize    : 262144;
             stacksize    : 262144;
-            DllScanSupported:false;
-            use_function_relative_addresses : true;
             abi : abi_powerpc_sysv;
             abi : abi_powerpc_sysv;
           );
           );
 
 

+ 1 - 5
compiler/systems/i_nwl.pas

@@ -32,7 +32,7 @@ unit i_nwl;
             system       : system_i386_netwlibc;
             system       : system_i386_netwlibc;
             name         : 'Netware for i386(libc)';
             name         : 'Netware for i386(libc)';
             shortname    : 'Netwlibc';
             shortname    : 'Netwlibc';
-            flags        : [];
+            flags        : [tf_use_function_relative_addresses];
             cpu          : cpu_i386;
             cpu          : cpu_i386;
             unit_env     : 'NETWLIBCUNITS';
             unit_env     : 'NETWLIBCUNITS';
             extradefines : 'NETWARE;NETWARE_LIBC';
             extradefines : 'NETWARE;NETWARE_LIBC';
@@ -54,11 +54,9 @@ unit i_nwl;
             staticClibext : '.a';
             staticClibext : '.a';
             staticClibprefix : '';
             staticClibprefix : '';
             sharedClibprefix : '';
             sharedClibprefix : '';
-            p_ext_support : false;
             Cprefix      : '';
             Cprefix      : '';
             newline      : #13#10;
             newline      : #13#10;
             dirsep       : '/';
             dirsep       : '/';
-            files_case_relevent : false;
             assem        : as_i386_elf32;
             assem        : as_i386_elf32;
             assemextern  : as_gas;
             assemextern  : as_gas;
             link         : nil;
             link         : nil;
@@ -85,8 +83,6 @@ unit i_nwl;
               );
               );
             first_parm_offset : 8;
             first_parm_offset : 8;
             stacksize    : 16384;
             stacksize    : 16384;
-            DllScanSupported:false;
-            use_function_relative_addresses : true
           );
           );
 
 
   implementation
   implementation

+ 1 - 5
compiler/systems/i_nwm.pas

@@ -32,7 +32,7 @@ unit i_nwm;
             system       : system_i386_netware;
             system       : system_i386_netware;
             name         : 'Netware for i386(clib)';
             name         : 'Netware for i386(clib)';
             shortname    : 'Netware';
             shortname    : 'Netware';
-            flags        : [];
+            flags        : [tf_use_function_relative_addresses];
             cpu          : cpu_i386;
             cpu          : cpu_i386;
             unit_env     : 'NETWAREUNITS';
             unit_env     : 'NETWAREUNITS';
             extradefines : 'NETWARE_CLIB';
             extradefines : 'NETWARE_CLIB';
@@ -54,11 +54,9 @@ unit i_nwm;
             staticClibext : '.a';
             staticClibext : '.a';
             staticClibprefix : '';
             staticClibprefix : '';
             sharedClibprefix : '';
             sharedClibprefix : '';
-            p_ext_support : false;
             Cprefix      : '';
             Cprefix      : '';
             newline      : #13#10;
             newline      : #13#10;
             dirsep       : '/';
             dirsep       : '/';
-            files_case_relevent : false;
             assem        : as_i386_elf32;
             assem        : as_i386_elf32;
             assemextern  : as_gas;
             assemextern  : as_gas;
             link         : nil;
             link         : nil;
@@ -85,8 +83,6 @@ unit i_nwm;
               );
               );
             first_parm_offset : 8;
             first_parm_offset : 8;
             stacksize    : 16384;
             stacksize    : 16384;
-            DllScanSupported:false;
-            use_function_relative_addresses : true
           );
           );
 
 
   implementation
   implementation

+ 2 - 5
compiler/systems/i_os2.pas

@@ -40,7 +40,7 @@ unit i_os2;
             system       : system_i386_OS2;
             system       : system_i386_OS2;
             name         : 'OS/2';
             name         : 'OS/2';
             shortname    : 'OS2';
             shortname    : 'OS2';
-            flags        : [tf_need_export,tf_use_8_3];
+            flags        : [tf_need_export,tf_files_case_aware,tf_use_8_3];
             cpu          : cpu_i386;
             cpu          : cpu_i386;
             unit_env     : 'OS2UNITS';
             unit_env     : 'OS2UNITS';
             extradefines : '';
             extradefines : '';
@@ -62,11 +62,9 @@ unit i_os2;
             staticClibext : '.a';
             staticClibext : '.a';
             staticClibprefix : '';
             staticClibprefix : '';
             sharedClibprefix : '';
             sharedClibprefix : '';
-            p_ext_support : false;
             Cprefix      : '_';
             Cprefix      : '_';
             newline      : #13#10;
             newline      : #13#10;
             dirsep       : '\';
             dirsep       : '\';
-            files_case_relevent : false;
             assem        : as_i386_as_aout;
             assem        : as_i386_as_aout;
             assemextern  : as_i386_as_aout;
             assemextern  : as_i386_as_aout;
             link         : nil;
             link         : nil;
@@ -93,8 +91,7 @@ unit i_os2;
               );
               );
             first_parm_offset : 8;
             first_parm_offset : 8;
             stacksize    : 256*1024;
             stacksize    : 256*1024;
-            DllScanSupported: false;
-            use_function_relative_addresses : false
+            abi          : abi_default;
           );
           );
 
 
 
 

+ 2 - 10
compiler/systems/i_sunos.pas

@@ -32,7 +32,7 @@ unit i_sunos;
             system       : system_i386_solaris;
             system       : system_i386_solaris;
             name         : 'Solaris for i386';
             name         : 'Solaris for i386';
             shortname    : 'solaris';
             shortname    : 'solaris';
-            flags        : [tf_under_development];
+            flags        : [tf_under_development,tf_files_case_sensitive,tf_use_function_relative_addresses];
             cpu          : cpu_i386;
             cpu          : cpu_i386;
             unit_env     : 'SOLARISUNITS';
             unit_env     : 'SOLARISUNITS';
             extradefines : 'UNIX;LIBC';
             extradefines : 'UNIX;LIBC';
@@ -54,11 +54,9 @@ unit i_sunos;
             staticClibext : '.a';
             staticClibext : '.a';
             staticClibprefix : 'lib';
             staticClibprefix : 'lib';
             sharedClibprefix : 'lib';
             sharedClibprefix : 'lib';
-            p_ext_support : false;
             Cprefix      : '';
             Cprefix      : '';
             newline      : #10;
             newline      : #10;
             dirsep       : '/';
             dirsep       : '/';
-            files_case_relevent : true;
             assem        : as_gas;
             assem        : as_gas;
             assemextern  : as_gas;
             assemextern  : as_gas;
             link         : nil;
             link         : nil;
@@ -85,8 +83,6 @@ unit i_sunos;
               );
               );
             first_parm_offset : 8;
             first_parm_offset : 8;
             stacksize    : 262144;
             stacksize    : 262144;
-            DllScanSupported:false;
-            use_function_relative_addresses : true
           );
           );
 
 
        system_sparc_solaris_info : tsysteminfo =
        system_sparc_solaris_info : tsysteminfo =
@@ -94,7 +90,7 @@ unit i_sunos;
             system       : system_sparc_solaris;
             system       : system_sparc_solaris;
             name         : 'Solaris for SPARC';
             name         : 'Solaris for SPARC';
             shortname    : 'solaris';
             shortname    : 'solaris';
-            flags        : [tf_needs_symbol_size];
+            flags        : [tf_needs_symbol_size,tf_under_development,tf_files_case_sensitive,tf_use_function_relative_addresses];
             cpu          : cpu_SPARC;
             cpu          : cpu_SPARC;
             unit_env     : 'SOLARISUNITS';
             unit_env     : 'SOLARISUNITS';
             extradefines : 'UNIX;LIBC;';
             extradefines : 'UNIX;LIBC;';
@@ -116,11 +112,9 @@ unit i_sunos;
             staticClibext : '.a';
             staticClibext : '.a';
             staticClibprefix : 'lib';
             staticClibprefix : 'lib';
             sharedClibprefix : 'lib';
             sharedClibprefix : 'lib';
-            p_ext_support : false;
             Cprefix      : '';
             Cprefix      : '';
             newline      : #10;
             newline      : #10;
             dirsep       : '/';
             dirsep       : '/';
-            files_case_relevent : true;
             assem        : as_gas;
             assem        : as_gas;
             assemextern  : as_gas;
             assemextern  : as_gas;
             link         : nil;
             link         : nil;
@@ -147,8 +141,6 @@ unit i_sunos;
               );
               );
             first_parm_offset : 92;
             first_parm_offset : 92;
             stacksize    : 262144;
             stacksize    : 262144;
-            DllScanSupported:false;
-            use_function_relative_addresses : true
           );
           );
 
 
   implementation
   implementation

+ 1 - 5
compiler/systems/i_watcom.pas

@@ -34,7 +34,7 @@ unit i_watcom;
             system       : system_i386_Watcom;
             system       : system_i386_Watcom;
             name         : 'Watcom compatible DOS extenders';
             name         : 'Watcom compatible DOS extenders';
             shortname    : 'WATCOM';
             shortname    : 'WATCOM';
-            flags        : [tf_use_8_3];
+            flags        : [tf_use_8_3,tf_use_function_relative_addresses];
             cpu          : cpu_i386;
             cpu          : cpu_i386;
             unit_env     : 'WATCOMUNITS';
             unit_env     : 'WATCOMUNITS';
             extradefines : 'DPMI';
             extradefines : 'DPMI';
@@ -56,11 +56,9 @@ unit i_watcom;
             staticClibext : '.a';
             staticClibext : '.a';
             staticClibprefix : '';
             staticClibprefix : '';
             sharedClibprefix : '';
             sharedClibprefix : '';
-            p_ext_support : false;
             Cprefix      : '_';
             Cprefix      : '_';
             newline      : #13#10;
             newline      : #13#10;
             dirsep       : '\';
             dirsep       : '\';
-            files_case_relevent : false;
             assem        : as_i386_wasm;
             assem        : as_i386_wasm;
             assemextern  : as_gas;
             assemextern  : as_gas;
             link         : nil;
             link         : nil;
@@ -87,8 +85,6 @@ unit i_watcom;
               );
               );
             first_parm_offset : 8;
             first_parm_offset : 8;
             stacksize    : 16384;
             stacksize    : 16384;
-            DllScanSupported : false;
-            use_function_relative_addresses : true
           );
           );
 
 
   implementation
   implementation

+ 1 - 5
compiler/systems/i_wdosx.pas

@@ -32,7 +32,7 @@ unit i_wdosx;
             system       : system_i386_wdosx;
             system       : system_i386_wdosx;
             name         : 'WDOSX DOS extender';
             name         : 'WDOSX DOS extender';
             shortname    : 'WDOSX';
             shortname    : 'WDOSX';
-            flags        : [tf_use_8_3];
+            flags        : [tf_use_8_3,tf_use_function_relative_addresses,tf_has_dllscanner];
             cpu          : cpu_i386;
             cpu          : cpu_i386;
             unit_env     : 'WDOSXUNITS';
             unit_env     : 'WDOSXUNITS';
             extradefines : 'MSWINDOWS';
             extradefines : 'MSWINDOWS';
@@ -54,11 +54,9 @@ unit i_wdosx;
             staticClibext : '.a';
             staticClibext : '.a';
             staticClibprefix : 'lib';
             staticClibprefix : 'lib';
             sharedClibprefix : '';
             sharedClibprefix : '';
-            p_ext_support : false;
             Cprefix      : '_';
             Cprefix      : '_';
             newline      : #13#10;
             newline      : #13#10;
             dirsep       : '\';
             dirsep       : '\';
-            files_case_relevent : false;
             assem        : as_i386_pecoffwdosx;
             assem        : as_i386_pecoffwdosx;
             assemextern  : as_gas;
             assemextern  : as_gas;
             link         : nil;
             link         : nil;
@@ -85,8 +83,6 @@ unit i_wdosx;
               );
               );
             first_parm_offset : 8;
             first_parm_offset : 8;
             stacksize    : 32*1024*1024;
             stacksize    : 32*1024*1024;
-            DllScanSupported:true;
-            use_function_relative_addresses : true
           );
           );
 
 
   implementation
   implementation

+ 8 - 20
compiler/systems/i_win.pas

@@ -32,7 +32,7 @@ unit i_win;
             system       : system_i386_WIN32;
             system       : system_i386_WIN32;
             name         : 'Win32 for i386';
             name         : 'Win32 for i386';
             shortname    : 'Win32';
             shortname    : 'Win32';
-            flags        : [{tf_section_threadvars}];
+            flags        : [tf_files_case_aware,tf_has_dllscanner,tf_use_function_relative_addresses{,tf_section_threadvars}];
             cpu          : cpu_i386;
             cpu          : cpu_i386;
             unit_env     : 'WIN32UNITS';
             unit_env     : 'WIN32UNITS';
             extradefines : 'MSWINDOWS';
             extradefines : 'MSWINDOWS';
@@ -54,11 +54,9 @@ unit i_win;
             staticClibext : '.a';
             staticClibext : '.a';
             staticClibprefix : 'lib';
             staticClibprefix : 'lib';
             sharedClibprefix : '';
             sharedClibprefix : '';
-            p_ext_support : false;
             Cprefix      : '_';
             Cprefix      : '_';
             newline      : #13#10;
             newline      : #13#10;
             dirsep       : '\';
             dirsep       : '\';
-            files_case_relevent : true;
             assem        : as_i386_pecoff;
             assem        : as_i386_pecoff;
             assemextern  : as_gas;
             assemextern  : as_gas;
             link         : nil;
             link         : nil;
@@ -85,8 +83,7 @@ unit i_win;
               );
               );
             first_parm_offset : 8;
             first_parm_offset : 8;
             stacksize    : 262144;
             stacksize    : 262144;
-            DllScanSupported:true;
-            use_function_relative_addresses : true
+            abi          : abi_default;
           );
           );
 
 
        system_x64_win64_info : tsysteminfo =
        system_x64_win64_info : tsysteminfo =
@@ -94,7 +91,7 @@ unit i_win;
             system       : system_x86_64_win64;
             system       : system_x86_64_win64;
             name         : 'Win64 for x64';
             name         : 'Win64 for x64';
             shortname    : 'Win64';
             shortname    : 'Win64';
-            flags        : [];
+            flags        : [tf_files_case_aware,tf_has_dllscanner,tf_use_function_relative_addresses];
             cpu          : cpu_x86_64;
             cpu          : cpu_x86_64;
             unit_env     : 'WIN64UNITS';
             unit_env     : 'WIN64UNITS';
             extradefines : 'MSWINDOWS';
             extradefines : 'MSWINDOWS';
@@ -116,11 +113,9 @@ unit i_win;
             staticClibext : '.a';
             staticClibext : '.a';
             staticClibprefix : 'lib';
             staticClibprefix : 'lib';
             sharedClibprefix : '';
             sharedClibprefix : '';
-            p_ext_support : false;
             Cprefix      : '_';
             Cprefix      : '_';
             newline      : #13#10;
             newline      : #13#10;
             dirsep       : '\';
             dirsep       : '\';
-            files_case_relevent : true;
             assem        : as_x86_64_pecoff;
             assem        : as_x86_64_pecoff;
             assemextern  : as_x86_64_masm;
             assemextern  : as_x86_64_masm;
             link         : nil;
             link         : nil;
@@ -147,8 +142,7 @@ unit i_win;
               );
               );
             first_parm_offset : 16;
             first_parm_offset : 16;
             stacksize    : 262144;
             stacksize    : 262144;
-            DllScanSupported:true;
-            use_function_relative_addresses : true
+            abi          : abi_default;
           );
           );
 
 
        system_arm_wince_info : tsysteminfo =
        system_arm_wince_info : tsysteminfo =
@@ -156,7 +150,7 @@ unit i_win;
             system       : system_arm_wince;
             system       : system_arm_wince;
             name         : 'WinCE for ARM';
             name         : 'WinCE for ARM';
             shortname    : 'WinCE';
             shortname    : 'WinCE';
-            flags        : [];
+            flags        : [tf_files_case_aware,tf_use_function_relative_addresses];
             cpu          : cpu_arm;
             cpu          : cpu_arm;
             unit_env     : '';
             unit_env     : '';
             extradefines : 'UNDER_CE';
             extradefines : 'UNDER_CE';
@@ -178,11 +172,9 @@ unit i_win;
             staticClibext : '.a';
             staticClibext : '.a';
             staticClibprefix : 'lib';
             staticClibprefix : 'lib';
             sharedClibprefix : '';
             sharedClibprefix : '';
-            p_ext_support : false;
             Cprefix      : '_';
             Cprefix      : '_';
             newline      : #13#10;
             newline      : #13#10;
             dirsep       : '\';
             dirsep       : '\';
-            files_case_relevent : true;
             assem        : as_gas;
             assem        : as_gas;
             assemextern  : as_gas;
             assemextern  : as_gas;
             link         : nil;
             link         : nil;
@@ -209,8 +201,7 @@ unit i_win;
               );
               );
             first_parm_offset : 8;
             first_parm_offset : 8;
             stacksize    : 262144;
             stacksize    : 262144;
-            DllScanSupported:false;
-            use_function_relative_addresses : true
+            abi          : abi_default;
           );
           );
 
 
        system_i386_wince_info : tsysteminfo =
        system_i386_wince_info : tsysteminfo =
@@ -218,7 +209,7 @@ unit i_win;
             system       : system_i386_wince;
             system       : system_i386_wince;
             name         : 'WinCE for i386';
             name         : 'WinCE for i386';
             shortname    : 'WinCE';
             shortname    : 'WinCE';
-            flags        : [];
+            flags        : [tf_files_case_aware,tf_has_dllscanner,tf_use_function_relative_addresses];
             cpu          : cpu_i386;
             cpu          : cpu_i386;
             unit_env     : '';
             unit_env     : '';
             extradefines : 'UNDER_CE';
             extradefines : 'UNDER_CE';
@@ -240,11 +231,9 @@ unit i_win;
             staticClibext : '.a';
             staticClibext : '.a';
             staticClibprefix : 'lib';
             staticClibprefix : 'lib';
             sharedClibprefix : '';
             sharedClibprefix : '';
-            p_ext_support : false;
             Cprefix      : '_';
             Cprefix      : '_';
             newline      : #13#10;
             newline      : #13#10;
             dirsep       : '\';
             dirsep       : '\';
-            files_case_relevent : true;
             assem        : as_i386_pecoffwince;
             assem        : as_i386_pecoffwince;
             assemextern  : as_gas;
             assemextern  : as_gas;
             link         : nil;
             link         : nil;
@@ -271,8 +260,7 @@ unit i_win;
               );
               );
             first_parm_offset : 8;
             first_parm_offset : 8;
             stacksize    : 262144;
             stacksize    : 262144;
-            DllScanSupported:true;
-            use_function_relative_addresses : true
+            abi          : abi_default;
           );
           );
 
 
 
 

+ 45 - 39
compiler/systems/t_win.pas

@@ -86,7 +86,6 @@ interface
     private
     private
       cstring : array[0..127]of char;
       cstring : array[0..127]of char;
       function DOSstubOK(var x:cardinal):boolean;
       function DOSstubOK(var x:cardinal):boolean;
-      function FindDLL(const s:string;var founddll:string):boolean;
       function ExtractDllName(Const Name : string) : string;
       function ExtractDllName(Const Name : string) : string;
     public
     public
       function isSuitableFileType(x:cardinal):longbool;override;
       function isSuitableFileType(x:cardinal):longbool;override;
@@ -132,6 +131,15 @@ implementation
          hp2 : twin32imported_item;
          hp2 : twin32imported_item;
          hs  : string;
          hs  : string;
       begin
       begin
+         { If we don't generate imports then we need to only the dll for
+           the linker }
+         if not GenerateImportSection then
+           begin
+             hs:=AddExtension(module,target_info.sharedlibext);
+             current_module.linkdlls.add(hs,link_allways);
+             exit;
+           end;
+
          { procdef or funcname must be give, not both }
          { procdef or funcname must be give, not both }
          if assigned(aprocdef) and (func<>'') then
          if assigned(aprocdef) and (func<>'') then
            internalerror(200411161);
            internalerror(200411161);
@@ -205,6 +213,15 @@ implementation
          hp2 : twin32imported_item;
          hp2 : twin32imported_item;
          hs  : string;
          hs  : string;
       begin
       begin
+         { If we don't generate imports then we need to only the dll for
+           the linker }
+         if not GenerateImportSection then
+           begin
+             hs:=AddExtension(module,target_info.sharedlibext);
+             current_module.linkdlls.add(hs,link_allways);
+             exit;
+           end;
+
          hs:=AddExtension(module,target_info.sharedlibext);
          hs:=AddExtension(module,target_info.sharedlibext);
          { search for the module }
          { search for the module }
          hp1:=timportlist(current_module.imports.first);
          hp1:=timportlist(current_module.imports.first);
@@ -225,6 +242,7 @@ implementation
          hp1.imported_items.concat(hp2);
          hp1.imported_items.concat(hp2);
       end;
       end;
 
 
+
     procedure timportlibwin32.generatenasmlib;
     procedure timportlibwin32.generatenasmlib;
       var
       var
          hp1 : timportlist;
          hp1 : timportlist;
@@ -865,7 +883,7 @@ begin
   Inherited Create;
   Inherited Create;
   { allow duplicated libs (PM) }
   { allow duplicated libs (PM) }
   SharedLibFiles.doubles:=true;
   SharedLibFiles.doubles:=true;
-  StaticLibFiles.doubles:=true;
+  StaticLibFiles.doubles:=true;  if not Dontlinkstdlibpath Then
 end;
 end;
 
 
 
 
@@ -905,6 +923,14 @@ begin
   WriteResponseFile:=False;
   WriteResponseFile:=False;
   linklibcygwin:=(SharedLibFiles.Find('cygwin')<>nil);
   linklibcygwin:=(SharedLibFiles.Find('cygwin')<>nil);
 
 
+  if (cs_profile in aktmoduleswitches) then
+    begin
+      SharedLibFiles.Concat('c');
+      SharedLibFiles.Concat('gcc');
+      SharedLibFiles.Concat('gmon');
+      SharedLibFiles.Concat('kernel32');
+    end;
+
   { Open link.res file }
   { Open link.res file }
   LinkRes:=TLinkRes.Create(outputexedir+Info.ResName);
   LinkRes:=TLinkRes.Create(outputexedir+Info.ResName);
 
 
@@ -946,18 +972,10 @@ begin
    end;
    end;
   LinkRes.Add(')');
   LinkRes.Add(')');
 
 
-
   { Write staticlibraries }
   { Write staticlibraries }
-  if (not StaticLibFiles.Empty) or (cs_profile in aktmoduleswitches) then
+  if (not StaticLibFiles.Empty) then
    begin
    begin
      LinkRes.Add('GROUP(');
      LinkRes.Add('GROUP(');
-     if (cs_profile in aktmoduleswitches) then
-       begin
-         LinkRes.Add('-lc');
-         LinkRes.Add('-lgcc');
-         LinkRes.Add('-lgmon');
-         LinkRes.Add('-lkernel32');
-       end;
      While not StaticLibFiles.Empty do
      While not StaticLibFiles.Empty do
       begin
       begin
         S:=StaticLibFiles.GetFirst;
         S:=StaticLibFiles.GetFirst;
@@ -966,7 +984,7 @@ begin
      LinkRes.Add(')');
      LinkRes.Add(')');
    end;
    end;
 
 
-  { Write sharedlibraries }
+  { Write sharedlibraries (=import libraries) }
   if not SharedLibFiles.Empty then
   if not SharedLibFiles.Empty then
    begin
    begin
      LinkRes.Add('INPUT(') ;
      LinkRes.Add('INPUT(') ;
@@ -988,6 +1006,21 @@ begin
      LinkRes.Add(')');
      LinkRes.Add(')');
    end;
    end;
 
 
+  { Write DLLs (=direct DLL linking) }
+  if not DLLFiles.Empty then
+   begin
+     LinkRes.Add('INPUT(') ;
+     While not DLLFiles.Empty do
+      begin
+        s:=DLLFiles.GetFirst;
+        if FindDLL(s,s2) then
+          LinkRes.Add(MaybeQuoted(s2))
+        else
+          LinkRes.Add('-l'+s);
+      end;
+     LinkRes.Add(')');
+   end;
+
 { Write and Close response }
 { Write and Close response }
   linkres.writetodisk;
   linkres.writetodisk;
   LinkRes.Free;
   LinkRes.Free;
@@ -1402,33 +1435,6 @@ end;
          end;
          end;
       end;
       end;
 
 
-    function TDLLScannerWin32.FindDLL(const s:string;var founddll:string):boolean;
-      var
-        sysdir : string;
-        Found : boolean;
-      begin
-        Found:=false;
-        { Look for DLL in:
-          1. Current dir
-          2. Library Path
-          3. windir,windir/system,windir/system32 }
-        Found:=FindFile(s,'.'+source_info.DirSep,founddll);
-        if (not found) then
-         Found:=librarysearchpath.FindFile(s,founddll);
-        if (not found) then
-         begin
-           sysdir:=FixPath(GetEnv('windir'),false);
-           Found:=FindFile(s,sysdir+';'+sysdir+'system'+source_info.DirSep+';'+sysdir+'system32'+source_info.DirSep,founddll);
-         end;
-        if (not found) then
-         begin
-           message1(exec_w_libfile_not_found,s);
-           FoundDll:=s;
-         end;
-        FindDll:=Found;
-      end;
-
-
     function tDLLScannerWin32.ExtractDllName(Const Name : string) : string;
     function tDLLScannerWin32.ExtractDllName(Const Name : string) : string;
       var n : string;
       var n : string;
       begin
       begin