[dmd-internals] Assertion in the linker on Mac OS X

Michel Fortin michel.fortin at michelf.ca
Sun May 12 13:53:56 PDT 2013


Le 12-mai-2013 à 16:01, Jacob Carlborg <doob at me.com> a écrit :

> On 12 maj 2013, at 17:53, Michel Fortin <michel.fortin at michelf.ca> wrote:
> 
>> I note that your file has L_OBJC_METH_VAR_NAME_0, L_OBJC_METH_VAR_NAME_2, L_OBJC_METH_VAR_NAME_4 (incrementing by two each time) while my old alpha had L_OBJC_METH_VAR_NAME_0, L_OBJC_METH_VAR_NAME_1, L_OBJC_METH_VAR_NAME_2, incrementing by one... I don't think this is the problem though.
> 
> I'm pretty sure it's the opposite way. Example, on this line you're incrementing "classnamecount":
> 
> https://github.com/michelf/dmd/blob/d-objc/src/objc.c#L378
> 
> Then again on line 381.

Hum, you're right. Anyway that's surely not the culprit.


>> Which D file are you using to make this object file?
> 
> This one:
> 
> https://github.com/jacob-carlborg/dmd/blob/objc_merge/test_objc/runnable/objc_call.d

You should also check what you're linking with. If you're linking against the custom druntime with Objective-C support (as it happens normally with this test), the culprit may well be in one of those druntime objc support functions too. In this case _dobjc_throwAs_d is referenced (which will convert Objective-C exceptions to D exceptions).

There are other tests in this folder. If you try the objc_selector.d test, it should give you some insight whether the problem has to do with the selector literals. It'll probably fail too, but in this case if you comment out the function calls made through the selector variables (so it won't reference anything special in druntime for exceptions) and you'll have a much more isolated test.

-- 
Michel Fortin
michel.fortin at michelf.ca
http://michelf.ca/



More information about the dmd-internals mailing list