Specify endianess and abi when calling xtensa linker

This commit is contained in:
Pierre Muller 2023-04-12 21:51:53 +00:00
parent 60cff917ba
commit 4750840e89
3 changed files with 40 additions and 2 deletions

View File

@ -98,10 +98,24 @@ const
{$else}
platform_select='';
{$endif}
var
platformopt : string;
begin
{$ifdef xtensa}
if target_info.endian=endian_little then
platformopt:=' -b elf32-xtensa-le -m elf32xtensa'
else
platformopt:=' -b elf32-xtensa-be -m elf32xtensa';
if target_info.abi=abi_xtensa_call0 then
platformopt:=platformopt+' --abi-call0'
else if target_info.abi=abi_xtensa_windowed then
platformopt:=platformopt+' --abi-windowed';
{$else}
platformopt:='';
{$endif}
with Info do
begin
ExeCmd[1]:='ld -g '+platform_select+' $OPT $DYNLINK $STATIC $GCSECTIONS $STRIP $MAP -L. -o $EXE -T $RES';
ExeCmd[1]:='ld -g '+platform_select+platformopt+' $OPT $DYNLINK $STATIC $GCSECTIONS $STRIP $MAP -L. -o $EXE -T $RES';
end;
end;

View File

@ -73,8 +73,22 @@ const
{$else}
platform_select='';
{$endif}
var
platformopt : string;
begin
Info.ExeCmd[1]:='ld -g '+platform_select+' $OPT $DYNLINK $STATIC $GCSECTIONS $STRIP $MAP -L. -o $EXE -T $RES';
{$ifdef xtensa}
if target_info.endian=endian_little then
platformopt:=' -b elf32-xtensa-le -m elf32xtensa'
else
platformopt:=' -b elf32-xtensa-be -m elf32xtensa';
if target_info.abi=abi_xtensa_call0 then
platformopt:=platformopt+' --abi-call0'
else if target_info.abi=abi_xtensa_windowed then
platformopt:=platformopt+' --abi-windowed';
{$else}
platformopt:='';
{$endif}
Info.ExeCmd[1]:='ld -g '+platform_select+platformopt+' $OPT $DYNLINK $STATIC $GCSECTIONS $STRIP $MAP -L. -o $EXE -T $RES';
end;

View File

@ -402,6 +402,16 @@ begin
else
platformopt:=' -b elf64-powerpc -m elf64ppc';
{$endif powerpc64}
{$ifdef xtensa}
if target_info.endian=endian_little then
platformopt:=' -b elf32-xtensa-le -m elf32xtensa'
else
platformopt:=' -b elf32-xtensa-be -m elf32xtensa';
if target_info.abi=abi_xtensa_call0 then
platformopt:=platformopt+' --abi-call0'
else if target_info.abi=abi_xtensa_windowed then
platformopt:=platformopt+' --abi-windowed';
{$endif}
{$ifdef arm}
platformopt:=' -z noexecstack';
{$endif arm}