Przeglądaj źródła

Use GasCpuTypeStr array: GAS uses different names for cpu variants

git-svn-id: trunk@23177 -
pierre 12 lat temu
rodzic
commit
080034982f
1 zmienionych plików z 13 dodań i 3 usunięć
  1. 13 3
      compiler/m68k/ag68kgas.pas

+ 13 - 3
compiler/m68k/ag68kgas.pas

@@ -27,12 +27,13 @@ interface
 
     uses
       cclasses,cpubase,
-      globals,
+      globals,globtype,
       aasmbase,aasmtai,aasmdata,aasmcpu,assemble,aggas;
 
     type
       Tm68kGNUAssembler=class(TGNUassembler)
         constructor create(smart: boolean); override;
+        function MakeCmdLine : TCmdStr; override;
       end;
 
     type
@@ -111,7 +112,7 @@ interface
 
     uses
       cutils,systems,
-      cgbase,cgutils,
+      cgbase,cgutils,cpuinfo,
       verbose,itcpugas;
 
 
@@ -125,6 +126,15 @@ interface
      InstrWriter := Tm68kInstrWriter.create(self);
    end;
 
+ function Tm68kGNUAssembler.MakeCmdLine: TCmdStr;
+   begin
+     result:=inherited MakeCmdLine;
+     // Use old -m option for Amiga system
+     if target_info.system=system_m68k_amiga then
+       Replace(result,'$ARCH','-m'+GasCpuTypeStr[current_settings.cputype])
+     else
+       Replace(result,'$ARCH','-march='+GasCpuTypeStr[current_settings.cputype]);
+   end;
 
     function getreferencestring(var ref : treference) : string;
       var
@@ -373,7 +383,7 @@ interface
             id     : as_gas;
             idtxt  : 'AS';
             asmbin : 'as';
-            asmcmd : '-o $OBJ $ASM';
+            asmcmd : '$ARCH -o $OBJ $ASM';
             supported_targets : [system_m68k_Amiga,system_m68k_Atari,system_m68k_Mac,system_m68k_linux,system_m68k_PalmOS,system_m68k_netbsd,system_m68k_openbsd,system_m68k_embedded];
             flags : [af_needar,af_smartlink_sections];
             labelprefix : '.L';