summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2>2021-04-08 19:50:27 +0000
committerjonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2>2021-04-08 19:50:27 +0000
commit899215521fc52132a3538888a2c394fc33158864 (patch)
treeb10dd22dfccd113546783b2bbfc50a742af49e02
parenta015746737117339d4764e6531334dfcd20302c5 (diff)
downloadfpc-899215521fc52132a3538888a2c394fc33158864.tar.gz
* 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: https://svn.freepascal.org/svn/fpc/trunk@49138 3ad0048d-3df7-0310-abae-a5850022a9f2
-rw-r--r--compiler/aarch64/agcpugas.pas4
-rw-r--r--compiler/arm/agarmgas.pas2
-rw-r--r--compiler/cfidwarf.pas14
-rw-r--r--compiler/systems.pas1
-rw-r--r--compiler/x86/agx86att.pas4
5 files changed, 20 insertions, 5 deletions
diff --git a/compiler/aarch64/agcpugas.pas b/compiler/aarch64/agcpugas.pas
index c7f513e7b2..34efe803c5 100644
--- a/compiler/aarch64/agcpugas.pas
+++ b/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 : '// ';
diff --git a/compiler/arm/agarmgas.pas b/compiler/arm/agarmgas.pas
index 182ff8a5de..29df8b7ca5 100644
--- a/compiler/arm/agarmgas.pas
+++ b/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 : '# ';
diff --git a/compiler/cfidwarf.pas b/compiler/cfidwarf.pas
index fd5ff4c4dd..cfb7e07fa3 100644
--- a/compiler/cfidwarf.pas
+++ b/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;
diff --git a/compiler/systems.pas b/compiler/systems.pas
index a4b3faa7c5..7065caa485 100644
--- a/compiler/systems.pas
+++ b/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;
diff --git a/compiler/x86/agx86att.pas b/compiler/x86/agx86att.pas
index d9845c9c47..f91b44228b 100644
--- a/compiler/x86/agx86att.pas
+++ b/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 : '# ';