<div dir="auto"><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Ondrej Pokorny <<a href="mailto:lazarus@kluug.net">lazarus@kluug.net</a>> schrieb am Do., 6. Juni 2024, 11:56:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>
<div>
<div>On 06.06.2024 11:16, Sven Barth via
fpc-pascal wrote:<br>
</div>
<blockquote type="cite">
<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" target="_blank" rel="noreferrer">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:ii_18ff2e9f085dcf81a8f1" alt=""></p></div></blockquote></div></div><div dir="auto">You should probably look at the unfiltered output of the message window. </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"><div><p></p>
Furthermore, I see from the docs that the -XR isn't supported on
Windows (<a href="https://www.freepascal.org/docs-html/user/userap1.html" target="_blank" rel="noreferrer">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></div></blockquote></div></div><div dir="auto">-XR does not do what you think it does. It only exists for specific cross compiling issues on *nix platforms. </div><div dir="auto"><br></div><div dir="auto">If you need to specify a path for the binutils you can use -FD<x>. </div><div dir="auto"><br></div><div dir="auto">Regards, </div><div dir="auto">Sven </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"><div>
</div>
</blockquote></div></div></div>