Browse Source

Add clang as assembler for powerpc-darwin (powerpc64 is apparently not yet supported for MachO format)

git-svn-id: trunk@38161 -
pierre 7 years ago
parent
commit
ed695624ab
2 changed files with 21 additions and 1 deletions
  1. 14 0
      compiler/ppcgen/agppcgas.pas
  2. 7 1
      compiler/ppcgen/ngppcadd.pas

+ 14 - 0
compiler/ppcgen/agppcgas.pas

@@ -719,10 +719,24 @@ unit agppcgas;
          dollarsign : '.'
          dollarsign : '.'
        );
        );
 
 
+    as_ppc_clang_darwin_info : tasminfo =
+       (
+         id     : as_clang;
+         idtxt  : 'CLANG';
+         asmbin : 'clang';
+         asmcmd : '-c -o $OBJ $EXTRAOPT -arch $ARCH $DARWINVERSION -x assembler $ASM';
+         supported_targets : [system_powerpc_darwin, system_powerpc64_darwin];
+         flags : [af_needar,af_smartlink_sections,af_supports_dwarf];
+         labelprefix : 'L';
+         comment : '# ';
+         dollarsign: '$';
+       );
+
 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_legacy_info,TPPCGNUAssembler);
   RegisterAssembler(as_ppc_gas_darwin_powerpc_info,TPPCAppleGNUAssembler);
   RegisterAssembler(as_ppc_gas_darwin_powerpc_info,TPPCAppleGNUAssembler);
+  RegisterAssembler(as_ppc_clang_darwin_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);
 end.
 end.

+ 7 - 1
compiler/ppcgen/ngppcadd.pas

@@ -326,7 +326,13 @@ implementation
           ltn,lten,gtn,gten,
           ltn,lten,gtn,gten,
           equaln,unequaln :
           equaln,unequaln :
             begin
             begin
-              op:=A_FCMPO;
+              { clang does not recognize fcmpo instruction,
+                so we need to fall back to fcmpu, which does not
+                generate the same exeception information }
+              if target_asm.id = as_clang then
+                op:=A_FCMPU
+              else
+                op:=A_FCMPO;
               cmpop:=true;
               cmpop:=true;
             end;
             end;
           else
           else