From 891e91590fb2ee43938d78065ca3cf1decee9207 Mon Sep 17 00:00:00 2001 From: ccrause Date: Wed, 25 Dec 2024 13:03:48 +0200 Subject: [PATCH] Do not add abi-call0 to linker options for esp8266 --- compiler/systems/t_embed.pas | 16 ++++++++++++---- compiler/systems/t_freertos.pas | 16 ++++++++++++---- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/compiler/systems/t_embed.pas b/compiler/systems/t_embed.pas index e39d607c87..3eab4d9634 100644 --- a/compiler/systems/t_embed.pas +++ b/compiler/systems/t_embed.pas @@ -106,10 +106,7 @@ begin 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'; + platformopt:=platformopt+' $PLATFORMABI'; {$else} platformopt:=''; {$endif} @@ -1812,6 +1809,17 @@ begin { Call linker } SplitBinCmd(Info.ExeCmd[1],binstr,cmdstr); Replace(cmdstr,'$OPT',Info.ExtraOptions); + {$ifdef xtensa} + if target_info.abi=abi_xtensa_call0 then + begin + if current_settings.controllertype=ct_esp8266 then + Replace(cmdstr,'$PLATFORMABI','') + else + Replace(cmdstr,'$PLATFORMABI','--abi-call0'); + end + else if target_info.abi=abi_xtensa_windowed then + Replace(cmdstr,'$PLATFORMABI','--abi-windowed'); + {$endif} if not(cs_link_on_target in current_settings.globalswitches) then begin Replace(cmdstr,'$EXE',FixedExeFileName); diff --git a/compiler/systems/t_freertos.pas b/compiler/systems/t_freertos.pas index b6f10a5f73..6d6181cd33 100644 --- a/compiler/systems/t_freertos.pas +++ b/compiler/systems/t_freertos.pas @@ -81,10 +81,7 @@ begin 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'; + platformopt:=platformopt+' $PLATFORMABI'; {$else} platformopt:=''; {$endif} @@ -1682,6 +1679,17 @@ begin { Call linker } SplitBinCmd(Info.ExeCmd[1],binstr,cmdstr); Replace(cmdstr,'$OPT',Info.ExtraOptions); + {$ifdef xtensa} + if target_info.abi=abi_xtensa_call0 then + begin + if current_settings.controllertype=ct_esp8266 then + Replace(cmdstr,'$PLATFORMABI','') + else + Replace(cmdstr,'$PLATFORMABI','--abi-call0'); + end + else if target_info.abi=abi_xtensa_windowed then + Replace(cmdstr,'$PLATFORMABI','--abi-windowed'); + {$endif} if not(cs_link_on_target in current_settings.globalswitches) then begin Replace(cmdstr,'$EXE',FixedExeFileName);