Questions about Staging patch for Mac preloader

Michael Müller michael at fds-team.de
Thu Nov 22 13:33:03 CST 2018


Am 21.11.18 um 22:48 schrieb Ken Thomases:
> * There's a configure check for "-Wl,--export-dynamic".  As near as I can tell, the Mac linker doesn't and has never supported that option.  The check seems to have been copied from the Linux and Android checks, but is apparently useless on macOS.  What was the intent?  Is there a chance that the patch is failing to ensure something necessary and it only works by luck?

You are right, this is most probably a copy paste mistake. I just looked it up in the build logs and the check failed.
 
> * There's a comment in the code:
> 
> 	/* there is no way to translate the dlopen handle to the mach header :-( */
> 
> and it uses a function find_executable() to search for the executable.  I believe it should be possible to use dladdr(wine_main_preload_info, …) to find it.  The dli_fbase field of the Dl_info struct is documented in the man page as pointing to the Mach header.  Then, dyld exports __dyld_get_image_slide(const struct mach_header*) via _dyld_func_lookup().

Feel free to try it. Maybe we just overlooked this.
 
> So, the question is, was this considered and rejected?  Or just not considered?  If it was rejected, why?

We never sent it upstream, because it was very difficult to get it working on all macOS versions. Every new version seems to have introduced another check, which broke the code. After all that time you may now consider it stable enough, but while we wrote the patch, it felt quite fragile.

Regards,
Michael



More information about the wine-devel mailing list