浏览代码

morphos: added legacy GNU AS support for the ancient AS version, which is still bundled as default in the SDK. switches off named sections support in the assembler generator

git-svn-id: trunk@36487 -
Károly Balogh 8 年之前
父节点
当前提交
903548b21a
共有 3 个文件被更改,包括 23 次插入4 次删除
  1. 20 2
      compiler/ppcgen/agppcgas.pas
  2. 1 0
      compiler/systems.inc
  3. 2 2
      compiler/systems/i_morph.pas

+ 20 - 2
compiler/ppcgen/agppcgas.pas

@@ -29,7 +29,7 @@ unit agppcgas;
 {$i fpcdefs.inc}
 {$i fpcdefs.inc}
 
 
   interface
   interface
-  
+
     uses
     uses
        systems,aasmbase,
        systems,aasmbase,
        aasmtai,aasmdata,
        aasmtai,aasmdata,
@@ -161,7 +161,7 @@ unit agppcgas;
              end;
              end;
 {$ifdef cpu64bitaddr}
 {$ifdef cpu64bitaddr}
            if (refaddr=addr_pic) and
            if (refaddr=addr_pic) and
-	      (target_info.system=system_powerpc64_linux) then
+              (target_info.system=system_powerpc64_linux) then
              s := s + '@got';
              s := s + '@got';
 {$endif cpu64bitaddr}
 {$endif cpu64bitaddr}
 
 
@@ -642,6 +642,23 @@ unit agppcgas;
          dollarsign: '$';
          dollarsign: '$';
        );
        );
 
 
+    as_ppc_gas_legacy_info : tasminfo =
+       (
+         id     : as_powerpc_gas_legacy;
+
+         idtxt  : 'AS-LEGACY';
+         asmbin : 'as';
+{$ifdef cpu64bitaddr}
+         asmcmd : '-a64 $ENDIAN -o $OBJ $EXTRAOPT $ASM';
+{$else cpu64bitaddr}
+         asmcmd: '$ENDIAN -o $OBJ $EXTRAOPT $ARCH $ASM';
+{$endif cpu64bitaddr}
+         supported_targets : [system_powerpc_morphos];
+         flags : [af_needar];
+         labelprefix : '.L';
+         comment : '# ';
+         dollarsign: '$';
+       );
 
 
     as_ppc_gas_darwin_powerpc_info : tasminfo =
     as_ppc_gas_darwin_powerpc_info : tasminfo =
        (
        (
@@ -704,6 +721,7 @@ unit agppcgas;
 
 
 begin
 begin
   RegisterAssembler(as_ppc_gas_info,TPPCGNUAssembler);
   RegisterAssembler(as_ppc_gas_info,TPPCGNUAssembler);
+  RegisterAssembler(as_ppc_gas_legacy_info,TPPCGNUAssembler);
   RegisterAssembler(as_ppc_gas_darwin_powerpc_info,TPPCAppleGNUAssembler);
   RegisterAssembler(as_ppc_gas_darwin_powerpc_info,TPPCAppleGNUAssembler);
   RegisterAssembler(as_ppc_aix_powerpc_info,TPPCAIXAssembler);
   RegisterAssembler(as_ppc_aix_powerpc_info,TPPCAIXAssembler);
   RegisterAssembler(as_ppc_gas_aix_powerpc_info,TPPCAIXAssembler);
   RegisterAssembler(as_ppc_gas_aix_powerpc_info,TPPCAIXAssembler);

+ 1 - 0
compiler/systems.inc

@@ -231,6 +231,7 @@
              ,as_m68k_vasm
              ,as_m68k_vasm
              ,as_m68k_as_aout
              ,as_m68k_as_aout
              ,as_wasm_binaryen
              ,as_wasm_binaryen
+             ,as_powerpc_gas_legacy    { for systems with very old GAS versions only, which don't support eg. named sections }
        );
        );
 
 
        tlink = (ld_none,
        tlink = (ld_none,

+ 2 - 2
compiler/systems/i_morph.pas

@@ -62,8 +62,8 @@ unit i_morph;
             Cprefix      : '';
             Cprefix      : '';
             newline      : #10;
             newline      : #10;
             dirsep       : '/';
             dirsep       : '/';
-            assem        : as_gas;
-            assemextern  : as_gas;
+            assem        : as_powerpc_gas_legacy;
+            assemextern  : as_powerpc_gas_legacy;
             link         : ld_none;
             link         : ld_none;
             linkextern   : ld_morphos;
             linkextern   : ld_morphos;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;