<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">On 06.06.2024 11:16, Sven Barth via
fpc-pascal wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAFMUeB9EbxVEP4qTedw11E3yZLPPBGFP8BCoXwZpJ6=HYh+1Eg@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="auto">
<div>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">Ondrej Pokorny via
fpc-pascal <<a
href="mailto:fpc-pascal@lists.freepascal.org"
moz-do-not-send="true" class="moz-txt-link-freetext">fpc-pascal@lists.freepascal.org</a>>
schrieb am Do., 6. Juni 2024, 09:30:<br>
</div>
<blockquote class="gmail_quote"
style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
I am on Windows 64bit, but using the i386 compiler.<br>
<br>
I have to link a 3rd party OBJ file with {$L 'xyz.obj'}.<br>
<br>
With the internal linker I get these errors:<br>
Error: COMDAT selection mode 0 not supported (section:
"0")<br>
Error: Failed reading coff file, invalid section index
while reading xyz.obj<br>
Error: Associative COMDAT section for section ".rdata" not
found<br>
</blockquote>
</div>
</div>
<div dir="auto"><br>
</div>
<div dir="auto">Can you provide a small example as a bug report
that shows this behavior (preferably also with source for the
object file) so that we can improve the internal linker? </div>
<div dir="auto"><br>
</div>
<div dir="auto">
<div class="gmail_quote">
<blockquote class="gmail_quote"
style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
So I tried to use the external linker with -Xe and I get
these errors:<br>
Linking myProgram.exe<br>
ld: warning: directory not found for option '-L/usr/lib'<br>
ld: warning: directory not found for option
'-F/System/Library/Frameworks/'<br>
ld: warning: option -b is obsolete and being ignored<br>
ld: file not found: pei-i386<br>
Error: Error while linking<br>
</blockquote>
</div>
</div>
<div dir="auto"><br>
</div>
<div dir="auto">That reads like the compiler is picking up the
wrong linker (a WSL one perhaps?). The ld.exe (probably with
platform prefix) should already be located in the compiler's
binary directory and PATH needs to point to that first.</div>
</div>
</blockquote>
<p>Thank you Sven for the help!</p>
<p>I changed the PATH so that the FPC bin directory is the first
entry and the output indeed changed: I get only "Error: Error
while linking" output without additional information that I got
before.</p>
<p><img src="cid:part1.V0vtpCkw.Do29sqeH@kluug.net" alt=""></p>
Furthermore, I see from the docs that the -XR isn't supported on
Windows (<a class="moz-txt-link-freetext" href="https://www.freepascal.org/docs-html/user/userap1.html">https://www.freepascal.org/docs-html/user/userap1.html</a>)<br>
-XR<x> Prepend <x> to all linker search paths (BeOS,
Darwin, FreeBSD, Linux, Mac OS, Solaris)
<p>Maybe it would be good to support it on Windows as well to be
able to explicitly tell which linker to use.</p>
<p>Ondrej<br>
</p>
</body>
</html>