[fpc-devel] Crosscompiling win towards darwin

Alfred alfred at consulab.nl
Mon Nov 21 11:40:33 CET 2016


Well.

All files that are needed by the linker, have to be found by the linker.
The osxcrosstools use a findfile process that is a bit peculiar. And not 
fully understood by me. Perhaps you can help.

c++ code.

findFile(path):
Options::FileInfo Options::findFile(const std::string &path) const
calls:
if ( findFile(path, {".tbd"}, result) )
		return result;

findFile(path,{...},result):
bool Options::findFile(const std::string &path, const 
std::vector<std::string> &tbdExtensions, FileInfo& result) const
calls
for ( const auto &ext : tbdExtensions ) {
auto newPath = replace_extension(path, ext);
bool found = tbdInfo.checkFileExists(*this, newPath.c_str());
}


So, as far as I understand correctly, if a fpc abc.o file is presented 
towards the linker, it replaces the extension with tbd and goes looking 
for abc.tbd.
I checked: if I add a dummy abc.tbd in the same location, all goes well.

That why I patched the search-process. But this very rude patch only 
took care of .o files.
I forgot about the .or files.

Trying new patches at the moment to no avail unfortunately.



------ Origineel bericht ------
Van: "Sven Barth" <pascaldragon at googlemail.com>
Aan: "Alfred" <alfred at consulab.nl>; "FPC developers' list" 
<fpc-devel at lists.freepascal.org>
Verzonden: 21-11-2016 11:17:30
Onderwerp: Re: [fpc-devel] Crosscompiling win towards darwin

>Am 21.11.2016 10:15 schrieb "Alfred" <alfred at consulab.nl>:
> >
> > Please skip my previous mail.
> >
> > I think I found the problem.
> > I had to patch osxcross-tools to work with FPC.
> > Now I need a new patch to include .or files !
>
>In how far did you have to patch the tools? The .or file should already 
>be part of the linker script that FPC generates (you can get that with 
>-sh, it's the link.res file).
>
>Regards,
>Sven
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20161121/fca025f6/attachment.html>


More information about the fpc-devel mailing list