Browse Source

* fixed writing of end objects to not output an empty INPUT()

peter 24 years ago
parent
commit
e0ecf5ab1b
3 changed files with 47 additions and 28 deletions
  1. 17 10
      compiler/targets/t_fbsd.pas
  2. 13 8
      compiler/targets/t_linux.pas
  3. 17 10
      compiler/targets/t_sunos.pas

+ 17 - 10
compiler/targets/t_fbsd.pas

@@ -233,7 +233,7 @@ Var
   gprtobj,
   gprtobj,
   prtobj       : string[80];
   prtobj       : string[80];
   HPath        : TStringListItem;
   HPath        : TStringListItem;
-  s            : string;
+  s,s1,s2      : string;
   linkdynamic,
   linkdynamic,
   linklibc     : boolean;
   linklibc     : boolean;
 begin
 begin
@@ -299,14 +299,6 @@ begin
      if s<>'' then
      if s<>'' then
       LinkRes.AddFileName(s);
       LinkRes.AddFileName(s);
    end;
    end;
-  { objects which must be at the end }
-  if linklibc then
-   begin
-     if librarysearchpath.FindFile('crtend.o',s) then
-      LinkRes.AddFileName(s);
-     if librarysearchpath.FindFile('crtn.o',s) then
-      LinkRes.AddFileName(s);
-   end;
   LinkRes.Add(')');
   LinkRes.Add(')');
 
 
   { Write staticlibraries }
   { Write staticlibraries }
@@ -352,6 +344,18 @@ begin
       LinkRes.AddFileName(Info.DynamicLinker);
       LinkRes.AddFileName(Info.DynamicLinker);
      LinkRes.Add(')');
      LinkRes.Add(')');
    end;
    end;
+  { objects which must be at the end }
+  if linklibc then
+   begin
+     if librarysearchpath.FindFile('crtend.o',s1) or
+        librarysearchpath.FindFile('crtn.o',s2) then
+      begin
+        LinkRes.Add('INPUT(');
+        LinkRes.AddFileName(s1);
+        LinkRes.AddFileName(s2);
+        LinkRes.Add(')');
+      end;
+   end;
 { Write and Close response }
 { Write and Close response }
   linkres.writetodisk;
   linkres.writetodisk;
   linkres.Free;
   linkres.Free;
@@ -499,7 +503,10 @@ initialization
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.3  2001-04-18 22:02:04  peter
+  Revision 1.4  2001-04-21 15:34:01  peter
+    * fixed writing of end objects to not output an empty INPUT()
+
+  Revision 1.3  2001/04/18 22:02:04  peter
     * registration of targets and assemblers
     * registration of targets and assemblers
 
 
   Revision 1.2  2001/04/13 01:22:21  peter
   Revision 1.2  2001/04/13 01:22:21  peter

+ 13 - 8
compiler/targets/t_linux.pas

@@ -231,7 +231,7 @@ Var
   gprtobj,
   gprtobj,
   prtobj       : string[80];
   prtobj       : string[80];
   HPath        : TStringListItem;
   HPath        : TStringListItem;
-  s            : string;
+  s,s1,s2      : string;
   linkdynamic,
   linkdynamic,
   linklibc     : boolean;
   linklibc     : boolean;
 begin
 begin
@@ -346,12 +346,14 @@ begin
   { objects which must be at the end }
   { objects which must be at the end }
   if linklibc then
   if linklibc then
    begin
    begin
-     LinkRes.Add('INPUT(');
-     if librarysearchpath.FindFile('crtend.o',s) then
-      LinkRes.AddFileName(s);
-     if librarysearchpath.FindFile('crtn.o',s) then
-      LinkRes.AddFileName(s);
-     LinkRes.Add(')');
+     if librarysearchpath.FindFile('crtend.o',s1) or
+        librarysearchpath.FindFile('crtn.o',s2) then
+      begin
+        LinkRes.Add('INPUT(');
+        LinkRes.AddFileName(s1);
+        LinkRes.AddFileName(s2);
+        LinkRes.Add(')');
+      end;
    end;
    end;
 { Write and Close response }
 { Write and Close response }
   linkres.writetodisk;
   linkres.writetodisk;
@@ -661,7 +663,10 @@ initialization
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.4  2001-04-18 22:02:04  peter
+  Revision 1.5  2001-04-21 15:34:01  peter
+    * fixed writing of end objects to not output an empty INPUT()
+
+  Revision 1.4  2001/04/18 22:02:04  peter
     * registration of targets and assemblers
     * registration of targets and assemblers
 
 
   Revision 1.3  2001/04/13 01:22:21  peter
   Revision 1.3  2001/04/13 01:22:21  peter

+ 17 - 10
compiler/targets/t_sunos.pas

@@ -255,7 +255,7 @@ Var
   gprtobj,
   gprtobj,
   prtobj       : string[80];
   prtobj       : string[80];
   HPath        : TStringListItem;
   HPath        : TStringListItem;
-  s            : string;
+  s,s1,s2      : string;
   linkdynamic,
   linkdynamic,
   linklibc     : boolean;
   linklibc     : boolean;
 begin
 begin
@@ -325,14 +325,6 @@ begin
      if s<>'' then
      if s<>'' then
       LinkRes.AddFileName(s);
       LinkRes.AddFileName(s);
    end;
    end;
-  { objects which must be at the end }
-  if linklibc then { Needed in sunos? }
-   begin
-     if librarysearchpath.FindFile('crtend.o',s) then
-      LinkRes.AddFileName(s);
-     if librarysearchpath.FindFile('crtn.o',s) then
-      LinkRes.AddFileName(s);
-   end;
   LinkRes.Add(')');
   LinkRes.Add(')');
 
 
   { Write staticlibraries }
   { Write staticlibraries }
@@ -379,6 +371,18 @@ begin
        LinkRes.AddFileName(Info.DynamicLinker);
        LinkRes.AddFileName(Info.DynamicLinker);
      LinkRes.Add(')');
      LinkRes.Add(')');
    end;
    end;
+  { objects which must be at the end }
+  if linklibc then {needed in sunos ? }
+   begin
+     if librarysearchpath.FindFile('crtend.o',s1) or
+        librarysearchpath.FindFile('crtn.o',s2) then
+      begin
+        LinkRes.Add('INPUT(');
+        LinkRes.AddFileName(s1);
+        LinkRes.AddFileName(s2);
+        LinkRes.Add(')');
+      end;
+   end;
 { Write and Close response }
 { Write and Close response }
   linkres.writetodisk;
   linkres.writetodisk;
   LinkRes.Free;
   LinkRes.Free;
@@ -528,7 +532,10 @@ initialization
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.3  2001-04-18 22:02:04  peter
+  Revision 1.4  2001-04-21 15:34:01  peter
+    * fixed writing of end objects to not output an empty INPUT()
+
+  Revision 1.3  2001/04/18 22:02:04  peter
     * registration of targets and assemblers
     * registration of targets and assemblers
 
 
   Revision 1.2  2001/04/13 01:22:22  peter
   Revision 1.2  2001/04/13 01:22:22  peter