Переглянути джерело

* don't generate high-level CFI statements when the selected assembler
does not support them, even if the target normally uses them
o fixes assembling with -Aas-darwin for i386/arm/x86-64 (on OS
versions that used those)

git-svn-id: trunk@49138 -

Jonas Maebe 4 роки тому
батько
коміт
ca399f3c71

+ 2 - 2
compiler/aarch64/agcpugas.pas

@@ -789,7 +789,7 @@ unit agcpugas;
             asmbin : 'clang';
             asmcmd : '-x assembler -c -target $TRIPLET -o $OBJ $EXTRAOPT -x assembler $ASM';
             supported_targets : [system_aarch64_ios,system_aarch64_darwin];
-            flags : [af_needar,af_smartlink_sections,af_supports_dwarf,af_llvm];
+            flags : [af_needar,af_smartlink_sections,af_supports_dwarf,af_llvm,af_supports_hlcfi];
             labelprefix : 'L';
             labelmaxlen : -1;
             comment : '# ';
@@ -803,7 +803,7 @@ unit agcpugas;
             asmbin : 'clang';
             asmcmd : '-x assembler -c -target $TRIPLET -o $OBJ $EXTRAOPT -x assembler $ASM';
             supported_targets : [system_aarch64_win64];
-            flags : [af_needar,af_smartlink_sections,af_supports_dwarf,af_llvm];
+            flags : [af_needar,af_smartlink_sections,af_supports_dwarf,af_llvm,af_supports_hlcfi];
             labelprefix : '.L';
             labelmaxlen : -1;
             comment : '// ';

+ 1 - 1
compiler/arm/agarmgas.pas

@@ -484,7 +484,7 @@ unit agarmgas;
             asmbin : 'clang';
             asmcmd : '-x assembler -c -target $TRIPLET -o $OBJ $EXTRAOPT -x assembler $ASM';
             supported_targets : [system_arm_ios];
-            flags : [af_needar,af_smartlink_sections,af_supports_dwarf,af_llvm];
+            flags : [af_needar,af_smartlink_sections,af_supports_dwarf,af_llvm,af_supports_hlcfi];
             labelprefix : 'L';
             labelmaxlen : -1;
             comment : '# ';

+ 14 - 0
compiler/cfidwarf.pas

@@ -670,6 +670,8 @@ implementation
             inherited;
             exit;
           end;
+        if not(af_supports_hlcfi in target_asm.flags) then
+          exit;
         list.concat(tai_cfi_op_none.create(cfi_startproc));
       end;
 
@@ -681,6 +683,8 @@ implementation
             inherited;
             exit;
           end;
+        if not(af_supports_hlcfi in target_asm.flags) then
+          exit;
         list.concat(tai_cfi_op_none.create(cfi_endproc));
       end;
 
@@ -692,6 +696,8 @@ implementation
             inherited;
             exit;
           end;
+        if not(af_supports_hlcfi in target_asm.flags) then
+          exit;
         list.concat(tai_cfi_op_reg.create(cfi_undefined,NR_RETURN_ADDRESS_REG));
       end;
 
@@ -703,6 +709,8 @@ implementation
             inherited;
             exit;
           end;
+        if not(af_supports_hlcfi in target_asm.flags) then
+          exit;
         list.concat(tai_cfi_op_reg_val.create(cfi_offset,reg,ofs));
       end;
 
@@ -714,6 +722,8 @@ implementation
             inherited;
             exit;
           end;
+        if not(af_supports_hlcfi in target_asm.flags) then
+          exit;
         list.concat(tai_cfi_op_reg.create(cfi_restore,reg));
       end;
 
@@ -725,6 +735,8 @@ implementation
             inherited;
             exit;
           end;
+        if not(af_supports_hlcfi in target_asm.flags) then
+          exit;
         list.concat(tai_cfi_op_reg.create(cfi_def_cfa_register,reg));
       end;
 
@@ -736,6 +748,8 @@ implementation
             inherited;
             exit;
           end;
+        if not(af_supports_hlcfi in target_asm.flags) then
+          exit;
         list.concat(tai_cfi_op_val.create(cfi_def_cfa_offset,ofs));
       end;
 

+ 1 - 0
compiler/systems.pas

@@ -78,6 +78,7 @@ interface
          ,af_no_stabs
          { assembler is part of the LLVM toolchain }
          ,af_llvm
+         ,af_supports_hlcfi
        );
 
        pasminfo = ^tasminfo;

+ 2 - 2
compiler/x86/agx86att.pas

@@ -514,7 +514,7 @@ interface
             asmbin : 'clang';
             asmcmd : '-x assembler -c -target $TRIPLET -o $OBJ $EXTRAOPT -x assembler $ASM';
             supported_targets : [system_x86_64_darwin,system_x86_64_iphonesim];
-            flags : [af_needar,af_smartlink_sections,af_supports_dwarf,af_no_stabs,af_llvm];
+            flags : [af_needar,af_smartlink_sections,af_supports_dwarf,af_no_stabs,af_llvm,af_supports_hlcfi];
             labelprefix : 'L';
             labelmaxlen : -1;
             comment : '# ';
@@ -593,7 +593,7 @@ interface
             asmbin : 'clang';
             asmcmd : '-x assembler -c -target $TRIPLET -o $OBJ $EXTRAOPT -x assembler $ASM';
             supported_targets : [system_i386_darwin,system_i386_iphonesim];
-            flags : [af_needar,af_smartlink_sections,af_supports_dwarf,af_no_stabs,af_llvm];
+            flags : [af_needar,af_smartlink_sections,af_supports_dwarf,af_no_stabs,af_llvm,af_supports_hlcfi];
             labelprefix : 'L';
             labelmaxlen : -1;
             comment : '# ';