[phobos] Showstopper bug: Hello world fails on OSX!

Walter Bright walter at digitalmars.com
Tue Nov 9 12:23:19 PST 2010



Sean Kelly wrote:
> On Nov 9, 2010, at 11:55 AM, Walter Bright wrote:
>   
>> Jacob Carlborg wrote:
>>     
>>> It should work using getsectdatafromheader, that's what I changed when I added support for dynamic libraries to Tango. Have a look at the Tango code: 
>>> http://dsource.org/projects/tango/browser/trunk/tango/core/rt/compiler/dmd/object_.d#L1270 and http://dsource.org/projects/tango/browser/trunk/tango/core/rt/compiler/dmd/darwin/Image.d#L103 . 
>>> The file in the last link is completely made by me so you won't have to be afraid for looking at it. Or if you don't want to look at Tango source files at all you can look at this druntime change: http://www.dsource.org/projects/druntime/changeset/372 , to be more specific: http://www.dsource.org/projects/druntime/browser/trunk/src/rt/image.d?rev=372#L105
>>>       
>> Thanks, Jacob! If you want to submit a patch to druntime that, for OSX, eliminates the dependence on the begin and end sections, that would be awesome.
>>     
>
> The simplest (appropriate) fix for the way things work today would probably be to add a new compiler runtime routine like "extern (C) void[] rt_tlsseg()".  Then all of the compiler-specific logic for TLS segment management can be moved into src/rt/memory.d (and possibly memory_osx.c).  I've been meaning to do something about this code being in core.thread anyway, since it really is compiler-specific.
>
>   

The segment begin/end issue is exactly the same for exception handling 
and moduleinfo. A solution for one should do all three.


More information about the phobos mailing list