[dmd-internals] Building Phobos and druntime as a dylib on Mac OS X
Jacob Carlborg
doob at me.com
Thu Dec 8 10:11:03 PST 2011
On 7 dec 2011, at 23:51, Sean Kelly wrote:
> On Dec 4, 2011, at 3:09 AM, Jacob Carlborg wrote:
>>
>> On 4 dec 2011, at 01:24, Walter Bright wrote:
>>>
>>>
>>> It either has to have a runtime switch if the 10.7 scheme is not backwards compatible, or we have to stick with the old scheme until the older OSX's disappear.
>>
>>
>> I'm pretty sure it's not backwards compatible. The tlv_get_addr exists in dyld for Lion but not for Snow Leopard. I would hate to see that we need to wait with this until Snow Leopard disappears. I see three different alternatives:
>>
>> 1. Runtime switch (as you suggests above)
>>
>> 2. The user need to replace dyld with the version from Lion, I have no idea if that will work. That's probably not a good idea to do anyway
>
> I don't think it will. The object file format changed to support this as well.
>
>
>> 3. We implement the runtime part ourself. Now that it is implemented in Lion we can make it forwards compatible (as long as Apple doesn't change the implementation in later versions of OSX)
>
> Sure, but this still won't work in 10.6 because of the object file and dyld issue. Or am I misunderstanding?
I was thinking that we implement what dylb does but in druntime. That assumes it's possible to do everything dyld does in druntime. In druntime we would need to check if the application is running on 10.7 or later. If it is, druntime won't have to do anything since dyld have already handled everything.
The whole point is to change the compiler to generate code that is compatible with 10.7 and implement all the missing pieces ourself for 10.6.
I don't think there's any problem with the object file. W'e're already using non-standard segments/sections as it is now. The runtime implementation just need to know how to find the segments, since we implement it ourself it won't be any problem.
--
/Jacob Carlborg
More information about the dmd-internals
mailing list