diff --git a/compiler/aggas.pas b/compiler/aggas.pas index 9b7b048ab5..68ead3038f 100644 --- a/compiler/aggas.pas +++ b/compiler/aggas.pas @@ -1,4 +1,4 @@ - { + { f Copyright (c) 1998-2006 by the Free Pascal team This unit implements the generic part of the GNU assembler @@ -1408,7 +1408,8 @@ implementation end else begin - if ((target_info.system <> system_arm_linux) and (target_info.system <> system_arm_android)) then + if ((target_info.system <> system_arm_linux) and (target_info.system <> system_arm_android)) or + (target_asm.id=as_arm_vasm) then sepChar := '@' else sepChar := '#'; @@ -1617,15 +1618,24 @@ implementation end; ait_eabi_attribute: begin - case tai_eabi_attribute(hp).eattr_typ of - eattrtype_dword: - writer.AsmWrite(#9'.eabi_attribute '+tostr(tai_eabi_attribute(hp).tag)+','+tostr(tai_eabi_attribute(hp).value)); - eattrtype_ntbs: - writer.AsmWrite(#9'.eabi_attribute '+tostr(tai_eabi_attribute(hp).tag)+',"'+tai_eabi_attribute(hp).valuestr^+'"'); - else - Internalerror(2019100601); - end; - writer.AsmLn; + { as of today, vasm does not support the eabi directives } + if target_asm.id<>as_arm_vasm then + begin + case tai_eabi_attribute(hp).eattr_typ of + eattrtype_dword: + writer.AsmWrite(#9'.eabi_attribute '+tostr(tai_eabi_attribute(hp).tag)+','+tostr(tai_eabi_attribute(hp).value)); + eattrtype_ntbs: + begin + if assigned(tai_eabi_attribute(hp).valuestr) then + writer.AsmWrite(#9'.eabi_attribute '+tostr(tai_eabi_attribute(hp).tag)+',"'+tai_eabi_attribute(hp).valuestr^+'"') + else + writer.AsmWrite(#9'.eabi_attribute '+tostr(tai_eabi_attribute(hp).tag)+',""'); + end + else + Internalerror(2019100601); + end; + writer.AsmLn; + end; end; {$ifdef WASM} diff --git a/compiler/arm/agarmvasm.pas b/compiler/arm/agarmvasm.pas index d9507ab039..222946054b 100644 --- a/compiler/arm/agarmvasm.pas +++ b/compiler/arm/agarmvasm.pas @@ -84,6 +84,27 @@ unit agarmvasm; end; + const + cputype_to_vasm_march : array[tcputype] of string = ( + '', // cpu_none + 'a2', + 'a3', + 'a4', + 'a4t', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + ''); + function TARMVASM.MakeCmdLine: TCmdStr; var objtype: string; @@ -99,7 +120,7 @@ unit agarmvasm; Replace(result,'$ASM',maybequoted(ScriptFixFileName(AsmFileName))); Replace(result,'$OBJ',maybequoted(ScriptFixFileName(ObjFileName))); - Replace(result,'$ARCH','-m'+cputype_to_gas_march[current_settings.cputype]); + Replace(result,'$ARCH','-'+cputype_to_vasm_march[current_settings.cputype]); Replace(result,'$OTYPE',objtype); Replace(result,'$EXTRAOPT',asmextraopt); end;