[fpc-devel] Cross-linking a DLL
Alfred
alfred at consulab.nl
Sat Dec 7 17:39:59 CET 2019
Dear All,
Looking at t_linux.pas, this code is common (also for other system
files):
if (isdll) then
begin
Add('INPUT(');
Add(sysrootpath+info.DynamicLinker);
Add(')');
end;
And also:
if libraryadded and not(linklibc) and not(isdll) and
(tf_section_threadvars in target_info.flags) then
Add('-l:'+ExtractFileName(defdynlinker));
When cross-compiling, this linker cannot be found in a flat directory
with library-files (including the dynamic linker).
The only way to solve is using a -XR , and some extra directories. But
this causes the linker not to be found on the target itself.
Before resorting to all kinds of trickery, I would like to ask if there
is a more elegant way of handling this.
Executables can easily be cross-compiled. Its the compilation of libs
that causes problems.
Greetings and thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20191207/b2d09dcd/attachment-0001.html>
More information about the fpc-devel
mailing list