瀏覽代碼

* check if a linker with the postfix .bfd exists, if yes, use it, resolves #40175

florian 2 年之前
父節點
當前提交
40f23030dc
共有 2 個文件被更改,包括 10 次插入3 次删除
  1. 1 1
      compiler/systems/t_android.pas
  2. 9 2
      compiler/systems/t_linux.pas

+ 1 - 1
compiler/systems/t_android.pas

@@ -441,7 +441,7 @@ begin
   if (source_info.exeext<>'') then
     s:=s+source_info.exeext;
   s:=FindUtil(s);
-    if FileExists(s, True) then
+  if FileExists(s, True) then
     binstr:=s
   else
     // fallback to ld for very old or custom binutils

+ 9 - 2
compiler/systems/t_linux.pas

@@ -753,7 +753,7 @@ var
   mapstr,
   ltostr,
   rpathstr,
-  sanitizerLibraryDir: TCmdStr;
+  sanitizerLibraryDir, s: TCmdStr;
   success : boolean;
   DynLinkStr : ansistring;
   GCSectionsStr,
@@ -832,7 +832,14 @@ begin
   if cs_large in current_settings.globalswitches then
     cmdstr:=cmdstr+' --no-relax';
 
-  success:=DoExec(FindUtil(utilsprefix+BinStr),CmdStr,true,false);
+  s:=FindUtil(utilsprefix+BinStr+'.bfd');
+  if FileExists(s, True) then
+    binstr:=s
+  else
+    { fallback to ld for very old or custom binutils }
+    binstr:=FindUtil(utilsprefix+BinStr);
+
+  success:=DoExec(binstr,CmdStr,true,false);
 
   { Create external .dbg file with debuginfo }
   if success and (cs_link_separate_dbg_file in current_settings.globalswitches) then