Browse Source

* fixed cross-assembling from Linux/ppc(32|64) to the "other bitness"

git-svn-id: trunk@33537 -
Jonas Maebe 9 years ago
parent
commit
70cfe1dc23
1 changed files with 13 additions and 1 deletions
  1. 13 1
      compiler/ppcgen/agppcgas.pas

+ 13 - 1
compiler/ppcgen/agppcgas.pas

@@ -44,6 +44,7 @@ unit agppcgas;
 
 
     TPPCGNUAssembler=class(TGNUassembler)
     TPPCGNUAssembler=class(TGNUassembler)
       constructor create(info: pasminfo; smart: boolean); override;
       constructor create(info: pasminfo; smart: boolean); override;
+      function MakeCmdLine: TCmdStr; override;
       procedure WriteExtraHeader; override;
       procedure WriteExtraHeader; override;
     end;
     end;
 
 
@@ -404,6 +405,17 @@ unit agppcgas;
       end;
       end;
 
 
 
 
+    function TPPCGNUAssembler.MakeCmdLine: TCmdStr;
+      begin
+        result := inherited MakeCmdLine;
+{$ifdef cpu64bitaddr}
+        Replace(result,'$ARCH','-a64')
+{$else cpu64bitaddr}
+        Replace(result,'$ARCH','-a32')
+{$endif cpu64bitaddr}
+      end;
+
+
     procedure TPPCGNUAssembler.WriteExtraHeader;
     procedure TPPCGNUAssembler.WriteExtraHeader;
       var
       var
          i : longint;
          i : longint;
@@ -541,7 +553,7 @@ unit agppcgas;
 {$ifdef cpu64bitaddr}
 {$ifdef cpu64bitaddr}
          asmcmd : '-a64 $ENDIAN -o $OBJ $EXTRAOPT $ASM';
          asmcmd : '-a64 $ENDIAN -o $OBJ $EXTRAOPT $ASM';
 {$else cpu64bitaddr}
 {$else cpu64bitaddr}
-         asmcmd: '$ENDIAN -o $OBJ $EXTRAOPT $ASM';
+         asmcmd: '$ENDIAN -o $OBJ $EXTRAOPT $ARCH $ASM';
 {$endif cpu64bitaddr}
 {$endif cpu64bitaddr}
          supported_targets : [system_powerpc_linux,system_powerpc_netbsd,system_powerpc_openbsd,system_powerpc_MorphOS,system_powerpc_Amiga,system_powerpc64_linux,system_powerpc_embedded,system_powerpc64_embedded];
          supported_targets : [system_powerpc_linux,system_powerpc_netbsd,system_powerpc_openbsd,system_powerpc_MorphOS,system_powerpc_Amiga,system_powerpc64_linux,system_powerpc_embedded,system_powerpc64_embedded];
          flags : [af_needar,af_smartlink_sections];
          flags : [af_needar,af_smartlink_sections];