Compiling DMD for the iPhone simulator
Michel Fortin
michel.fortin at michelf.com
Thu Apr 26 06:23:52 PDT 2012
On 2012-04-26 11:40:57 +0000, Jacob Carlborg <doob at me.com> said:
> On 2012-04-26 12:20, Michel Fortin wrote:
>
>> You are assuming those compilers linked to the iOS SDK, but they could
>> be "cross compilers" in the sense that the compiler is linked to Mac
>> libraries (just like a normal Mac compiler) but creates executables for
>> the iOS Simulator platform. (Obviously, the ARM ones are true cross
>> compilers.)
>
> Yes, exactly. I was hoping I could do the same with DMD.
>
>> My suspicion is that you could use the same Mac DMD compiler as long as
>> all the generated code is linked with the iOS SDK. As far as I know, the
>> only ABI difference is that the Objective-C runtime for the simulator is
>> the Modern runtime while the Mac is still using the Legacy runtime for
>> 32-bit. So you can't use the same Objective-C compiler, but beside
>> Objective-C I'd expect all the generated code to be the same.
>
> I assume I would need change DMD to use the gcc located in the iPhone
> simulator SDK instead of the "regular" one.
That might help. Although I'd suspect that all that's really needed is
to specify the simulator's SDK as the system root with a linker flag
(--sysroot=<path>) when linking D code. I'd suggest you try that first.
--
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/
More information about the Digitalmars-d
mailing list