[PATCH]: Allow the use of i386/darwin with ELF

Konstantin Tokarev via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 14 08:10:38 PST 2015



13.12.2015, 17:54, "Luboš Doležel via cfe-commits" <cfe-commits at lists.llvm.org>:
> Hello,
>
> I'm the developer of Darling, a translation layer for running OS X
> binaries on Linux.
>
> I'm facing many difficulties due to the following differences in i386
> ABI between Darwin and Linux:
>
> * size_t on Darwin/i386 is 'unsigned long', but Linux/i386 uses
> 'unsigned int' (=> different mangled names).
> * long double on Darwin/i386 is 128 bits long, but Linux/i386 uses only
> 96 bits.
>
> This problem can be overcome by specifying '-target
> i386-unknown-darwin-elf', but this currently fails due to a different
> data layout string (Darwin specifies Mach-O).
>
> The attached patch allows the use of ELF with the DarwinI386 target. It
> is identical to what is already done in the WindowsX86_32 target.
>
> Pretty please, include my patch, as it would be very helpful and it's a
> rather small change.

I think it would be more logical to use ELF when isOSBinFormatELF is true,
than when isOSBinFormatMachO is false

-- 
Regards,
Konstantin


More information about the cfe-commits mailing list