+ add a GAS compatible variant of the Clang assembler (currently used for Aarch64-Win64 as no GNU AS exists for that target, yet)

git-svn-id: trunk@44915 -
This commit is contained in:
svenbarth 2020-04-21 06:04:27 +00:00
parent 3af74d2fd2
commit dfde4def62
2 changed files with 51 additions and 0 deletions

View File

@ -47,6 +47,13 @@ unit agcpugas;
constructor CreateWithWriter(info: pasminfo; wr: TExternalAssemblerOutputFile; freewriter, smart: boolean); override;
end;
TAArch64ClangGASAssembler=class(TGNUassembler)
private
function TargetStr:String;
public
function MakeCmdLine:TCmdStr; override;
constructor CreateWithWriter(info: pasminfo; wr: TExternalAssemblerOutputFile; freewriter, smart: boolean); override;
end;
const
gas_shiftmode2str : array[tshiftmode] of string[4] = (
@ -90,6 +97,35 @@ unit agcpugas;
end;
{****************************************************************************}
{ CLang AArch64 Assembler writer }
{****************************************************************************}
constructor TAArch64CLangGASAssembler.CreateWithWriter(info: pasminfo; wr: TExternalAssemblerOutputFile; freewriter, smart: boolean);
begin
inherited;
InstrWriter := TAArch64InstrWriter.create(self);
end;
function TAArch64ClangGASAssembler.TargetStr:String;
begin
case target_info.system of
system_aarch64_win64:
result:='aarch64-windows';
else
internalerror(2020032201);
end;
end;
function TAArch64ClangGASAssembler.MakeCmdLine:TCmdStr;
begin
Result:=inherited MakeCmdLine;
Replace(Result,'$TARGET',TargetStr);
end;
{****************************************************************************}
{ Helper routines for Instruction Writer }
{****************************************************************************}
@ -305,8 +341,22 @@ unit agcpugas;
dollarsign: '$';
);
as_aarch64_clang_gas_info : tasminfo =
(
id : as_clang_gas;
idtxt : 'CLANG';
asmbin : 'clang';
asmcmd : '-c -o $OBJ $EXTRAOPT -target $TARGET -x assembler $ASM';
supported_targets : [system_aarch64_win64];
flags : [af_needar,af_smartlink_sections,af_supports_dwarf];
labelprefix : '.L';
comment : '// ';
dollarsign: '$';
);
begin
RegisterAssembler(as_aarch64_gas_info,TAArch64Assembler);
RegisterAssembler(as_aarch64_clang_darwin_info,TAArch64AppleAssembler);
RegisterAssembler(as_aarch64_clang_gas_info,TAArch64ClangGASAssembler);
end.

View File

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