On Saturday, 31 August 2013 at 11:16:11 UTC, Jacob Carlborg wrote:
So DMD and Clang uses different sections? Have you tried GDC or LDC?

Sorry for the delay.

Using LDC fails, as expected / desired:

    duplicate symbol _dotest in:
        d/test.o
        c/test.o
    ld: 1 duplicate symbol for architecture x86_64

The LDC .o sections are the same as the C version:

$ nm d/test.o | grep dotest; echo "--"; nm c/test.o | grep dotest
    0000000000000000 T _dotest
    00000000000000b0 S _dotest.eh
    --
    0000000000000000 T _dotest
    0000000000000060 S _dotest.eh

I haven't tried GDC (I get the object.d not found error, even after installing the D .dmg package, instead of using brew, and I don't recall how I used to solve that), but I imagine it would also fail-work (detect the duplicate symbol, and fail compilation).

Reply via email to