mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-22 00:13:48 +02:00
+ 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:
parent
3af74d2fd2
commit
dfde4def62
@ -47,6 +47,13 @@ unit agcpugas;
|
|||||||
constructor CreateWithWriter(info: pasminfo; wr: TExternalAssemblerOutputFile; freewriter, smart: boolean); override;
|
constructor CreateWithWriter(info: pasminfo; wr: TExternalAssemblerOutputFile; freewriter, smart: boolean); override;
|
||||||
end;
|
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
|
const
|
||||||
gas_shiftmode2str : array[tshiftmode] of string[4] = (
|
gas_shiftmode2str : array[tshiftmode] of string[4] = (
|
||||||
@ -90,6 +97,35 @@ unit agcpugas;
|
|||||||
end;
|
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 }
|
{ Helper routines for Instruction Writer }
|
||||||
{****************************************************************************}
|
{****************************************************************************}
|
||||||
@ -305,8 +341,22 @@ unit agcpugas;
|
|||||||
dollarsign: '$';
|
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
|
begin
|
||||||
RegisterAssembler(as_aarch64_gas_info,TAArch64Assembler);
|
RegisterAssembler(as_aarch64_gas_info,TAArch64Assembler);
|
||||||
RegisterAssembler(as_aarch64_clang_darwin_info,TAArch64AppleAssembler);
|
RegisterAssembler(as_aarch64_clang_darwin_info,TAArch64AppleAssembler);
|
||||||
|
RegisterAssembler(as_aarch64_clang_gas_info,TAArch64ClangGASAssembler);
|
||||||
end.
|
end.
|
||||||
|
@ -251,6 +251,7 @@
|
|||||||
,as_wasm_binaryen
|
,as_wasm_binaryen
|
||||||
,as_powerpc_gas_legacy { for systems with very old GAS versions only, which don't support eg. named sections }
|
,as_powerpc_gas_legacy { for systems with very old GAS versions only, which don't support eg. named sections }
|
||||||
,as_llvm_clang
|
,as_llvm_clang
|
||||||
|
,as_clang_gas
|
||||||
);
|
);
|
||||||
|
|
||||||
tlink = (ld_none,
|
tlink = (ld_none,
|
||||||
|
Loading…
Reference in New Issue
Block a user