Use ld.bfd explicitly
authorPeter Michael Green <plugwash@debian.org>
Tue, 21 Sep 2021 19:22:17 +0000 (20:22 +0100)
committerRaspbian forward porter <root@raspbian.org>
Tue, 21 Sep 2021 19:22:17 +0000 (20:22 +0100)
Bug-Debian: http://bugs.debian.org/620815
Bug-Debian: http://bugs.debian.org/624525
Bug-Debian: http://bugs.debian.org/717651

Freepascal is broken with ld.gold, previously we conflicted with binutils-gold
but that makes us uninstallable with the new binutils.

So instead we take the approach of patching fpc to use ld.bfd directly

Gbp-Pq: Name use-bfd-explicitly.diff

fpcsrc/compiler/systems/t_linux.pas

index a7398fb9cefea4ae957ca6e6755b27fc1e3bba86..a5986f6bcf41f0520fac90357346aabf92131194 100644 (file)
@@ -1408,7 +1408,7 @@ begin
   if HasExports then
     cmdstr:=cmdstr+' -E';
 
-  success:=DoExec(FindUtil(utilsprefix+BinStr),CmdStr,true,false);
+  success:=DoExec(FindUtil(utilsprefix+BinStr)+'.bfd',CmdStr,true,false);
 
   { Create external .dbg file with debuginfo }
   if success and (cs_link_separate_dbg_file in current_settings.globalswitches) then
@@ -1476,7 +1476,7 @@ begin
   Replace(cmdstr,'$SONAME',SoNameStr);
   Replace(cmdstr,'$MAP',mapstr);
   Replace(cmdstr,'$GCSECTIONS',GCSectionsStr);
-  success:=DoExec(FindUtil(utilsprefix+binstr),cmdstr,true,false);
+  success:=DoExec(FindUtil(utilsprefix+binstr)+'.bfd',cmdstr,true,false);
 
 { Strip the library ? }
   if success and (cs_link_strip in current_settings.globalswitches) then