Use ld.bfd explicitly
authorPeter Michael Green <plugwash@debian.org>
Thu, 30 Mar 2023 19:31:30 +0000 (20:31 +0100)
committerAbou Al Montacir <abou.almontacir@sfr.fr>
Thu, 30 Mar 2023 19:31:30 +0000 (20:31 +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 ac7c74d8043409554d4f2bbca53881f537f23efe..b5089bbce074eae18e2b7e062a9d9dae4ad528b2 100644 (file)
@@ -1409,7 +1409,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
@@ -1477,7 +1477,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