#624525 triaging needed to allow fpc to link with gold

Package:
fp-compiler
Source:
fpc
Description:
Free Pascal - compiler dependency package
Submitter:
Arnt Karlsen
Date:
2025-08-29 05:33:02 UTC
Severity:
normal
#624525#5
Date:
2011-04-29 09:20:20 UTC
From:
To:
...the short term fix in #620815 merely stops people from trying to
use fp-compiler-2.4.2 with binutils-gold, it does not fix the
binutils-gold flaws that cause fp-compile'd executables to fail.
(I dunno how to fix this myself, but I did not see anyone else
trying to blow the whistle on this here either.)

#624525#10
Date:
2011-04-29 09:37:24 UTC
From:
To:
reassign 624525 fp-compiler 2.4.2-3
quit

Hi Arnt,

Arnt Karlsen wrote:

Could you summarize the bug and what needs fixing, assuming the reader
has not looked through #620815 carefully?

In particular, from glancing through that bug report, it is not clear
to me:

- Is the warning

| /usr/bin/ld: warning: link.res:1:19: ignoring SEARCH_DIR; SEARCH_DIR is only valid for scripts specified via -T/--script

  relevant?  What does the linker script use SEARCH_DIR for and why is
  the script not specified via --script?  Is that a bug in
  fp-compiler or is ld being inappropriately picky?

- What exactly happens when the compiled program crashes?  Is it
  killed by a signal, and if so, by which signal?  Does anyone
  know why?  Is it possible to get interesting LD_DEBUG output or
  a backtrace?

- What changes will binutils-gold need in order to support what
  fp-compiler is trying to do?  Are those good changes?

Reassigning to fp-compiler for triage; please feel free to reassign
back when you have an explanation or a minimal testcase (meaning, in
particular: one that does not involve running fpc).

Thanks for looking into this.

Regards,
Jonathan

#624525#21
Date:
2011-04-29 11:22:36 UTC
From:
To:
and I think the conflict is not necessary.  Please just use ld.bfd directly.
#624525#26
Date:
2012-08-18 12:34:06 UTC
From:
To:
FPC doesn't pass -T on purpose, since that would mean certain distro
specific directories might not be found (IIRC specially /lib vs /lib64
on biarchs):

http://www.freepascal.org/faq.var#unix-ld219

If sb has a gold testing situation, it might be also worthwhile to test
both simple programs and programs that link to libc or libc using
libraries. There are two different ELF startup
code files for that (crt0 replacements), and a difference between those
two scenario's might be an hint.

#624525#33
Date:
2014-01-23 22:34:42 UTC
From:
To:
Hi Jonathan,
...
Please have the attached files. You just need to run ppas.sh script and
this does not need you to have fpc installed on your pc. ;)
Thanks for your support.

Cheers,

#624525#38
Date:
2023-05-06 16:28:34 UTC
From:
To:
Control: reassign -1 2.4.2-3 binutils-gold 
New FPC version does not provide linker script directly but using -T flag.
However ld.gold does not manage to link it.

$ ./ppas.sh
Linking hello
/usr/bin/ld.gold: error: link165746.res:256:8: syntax error, unexpected STRING
/usr/bin/ld.gold: fatal error: unable to parse script file link165746.res
An error occurred while linking hello

Thank you looking at this.
-- 
Cheers,
Abou Al Montacir