peter 26 years ago
parent
commit
c261796ebf
2 changed files with 28 additions and 5 deletions
  1. 17 2
      compiler/link.pas
  2. 11 3
      compiler/popt386.pas

+ 17 - 2
compiler/link.pas

@@ -25,6 +25,11 @@ Unit link;
 
 
 Interface
 Interface
 
 
+{ Needed for LFN support in path to the executable }
+{$ifdef GO32V2}
+  {$define ALWAYSSHELL}
+{$endif}
+
 uses cobjects,files;
 uses cobjects,files;
 
 
 Type
 Type
@@ -80,7 +85,7 @@ uses
   ;
   ;
 
 
 {$ifndef linux}
 {$ifndef linux}
-Procedure Shell(command:string);
+Procedure Shell(const command:string);
 { This is already defined in the linux.ppu for linux, need for the *
 { This is already defined in the linux.ppu for linux, need for the *
   expansion under linux }
   expansion under linux }
 var
 var
@@ -271,10 +276,14 @@ begin
   if not(cs_link_extern in aktglobalswitches) then
   if not(cs_link_extern in aktglobalswitches) then
    begin
    begin
      swapvectors;
      swapvectors;
+{$ifdef ALWAYSSHELL}
+     shell(command+' '+para);
+{$else}
      if useshell then
      if useshell then
       shell(command+' '+para)
       shell(command+' '+para)
      else
      else
       exec(command,para);
       exec(command,para);
+{$endif}
      swapvectors;
      swapvectors;
      if (doserror<>0) then
      if (doserror<>0) then
       begin
       begin
@@ -645,9 +654,15 @@ end;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.55  1999-06-15 13:57:31  peter
+  Revision 1.56  1999-06-18 09:55:30  peter
     * merged
     * merged
 
 
+  Revision 1.55  1999/06/15 13:57:31  peter
+    * merged
+
+  Revision 1.54.2.2  1999/06/18 09:51:55  peter
+    * always use shell() for go32v2 to support LFN
+
   Revision 1.54.2.1  1999/06/15 13:51:56  peter
   Revision 1.54.2.1  1999/06/15 13:51:56  peter
     * also check ld-2.1.so for glibc 2.1, previous was only for 2.1.1
     * also check ld-2.1.so for glibc 2.1, previous was only for 2.1.1
 
 

+ 11 - 3
compiler/popt386.pas

@@ -1028,6 +1028,8 @@ Begin
                       (Pai386(hp1)^.opcode=A_PUSH) and
                       (Pai386(hp1)^.opcode=A_PUSH) and
                       (Pai386(hp1)^.oper[0].typ = top_reg) And
                       (Pai386(hp1)^.oper[0].typ = top_reg) And
                       (Pai386(hp1)^.oper[0].reg=Pai386(p)^.oper[0].reg) then
                       (Pai386(hp1)^.oper[0].reg=Pai386(p)^.oper[0].reg) then
+                  { This can't be done, because the register which is popped
+                    can still be used after the push (PFV)
                      If (Not(cs_regalloc in aktglobalswitches)) Then
                      If (Not(cs_regalloc in aktglobalswitches)) Then
                        Begin
                        Begin
                          hp2:=pai(hp1^.next);
                          hp2:=pai(hp1^.next);
@@ -1038,7 +1040,7 @@ Begin
                          p:=hp2;
                          p:=hp2;
                          continue
                          continue
                        End
                        End
-                     Else
+                     Else }
                        Begin
                        Begin
                          { change it to a two op operation }
                          { change it to a two op operation }
                          Pai386(p)^.oper[1].typ:=top_none;
                          Pai386(p)^.oper[1].typ:=top_none;
@@ -1052,7 +1054,7 @@ Begin
                          hp1 := Pai(p^.next);
                          hp1 := Pai(p^.next);
                          AsmL^.Remove(hp1);
                          AsmL^.Remove(hp1);
                          Dispose(hp1, Done)
                          Dispose(hp1, Done)
-                       End
+                       End;
                 end;
                 end;
               A_PUSH:
               A_PUSH:
                 Begin
                 Begin
@@ -1519,7 +1521,13 @@ End.
 
 
 {
 {
  $Log$
  $Log$
- Revision 1.54  1999-05-27 19:44:49  peter
+ Revision 1.55  1999-06-18 09:55:31  peter
+   * merged
+
+ Revision 1.54.2.1  1999/06/18 09:52:40  peter
+   * pop;push -> mov (esp),reg always instead of being removed
+
+ Revision 1.54  1999/05/27 19:44:49  peter
    * removed oldasm
    * removed oldasm
    * plabel -> pasmlabel
    * plabel -> pasmlabel
    * -a switches to source writing automaticly
    * -a switches to source writing automaticly