December 01, 2011
On 30 nov 2011, at 23:08, Michel Fortin wrote:

> Don't expect the Apple supplied version of GCC to ever get this. Apple stopped merging the GNU trunk of GCC in their own after it was relicensed under GPLv3. They're still maintaining their own 4.2.x branch, but most of their efforts are going to LLVM and Clang.


I wonder if that means that DMD should start to use Clang as linker instead of GCC.

-- 
/Jacob Carlborg

December 02, 2011
On Nov 30, 2011, at 12:57 PM, Jacob Carlborg wrote:

> 
> On 21 nov 2011, at 20:12, Walter Bright wrote:
>> 
>> On 11/21/2011 9:17 AM, Jacob Carlborg wrote:
>>> 
>>>> One reason dmd doesn't support dynlib yet is because I haven't done much research into how dynlib actually works.
>>> 
>>> Ok, I see. I though that you might know since you have developed a C++ compiler as well. I assume dynamic libraries can be used with DMC. Note that when I say "dylib" I mean the general term "dynamic library" and not the Mac OS X specific implementation.
>>> 
>> 
>> DLLs on Windows work very differently from dynlibs on other systems. You have to approach each as its own animal.
> 
> I've done some research about how TLS is implemented in the ELF format. I don't understand everything but I think I've got a, at least, somewhat better understanding of TLS.
> 
> I've started to think about if it's possible to implement TLS on Mac OS X in the same way as it's implement on Linux, but just with the help of the compiler and runtime.

> ...
> 
> BTW, according to this:
> 
> http://stackoverflow.com/questions/2436772/thread-local-storage-macosx
> 
> GCC 4.5+ on Mac OS X supports the __thread keyword but it's emulated.
> 
> TLS reference: http://www.akkadia.org/drepper/tls.pdf

I don't know if it matters, but __thread should be natively supported in Lion (by llvm-gcc, not DMD).  OSX is doing away with GCC so it wouldn't surprise me if no effort had been made to add __thread support to that.
December 02, 2011
On Dec 1, 2011, at 11:49 AM, Jacob Carlborg wrote:
> 
> On 30 nov 2011, at 23:08, Michel Fortin wrote:
> 
>> Don't expect the Apple supplied version of GCC to ever get this. Apple stopped merging the GNU trunk of GCC in their own after it was relicensed under GPLv3. They're still maintaining their own 4.2.x branch, but most of their efforts are going to LLVM and Clang.
> 
> 
> I wonder if that means that DMD should start to use Clang as linker instead of GCC.

llvm-gcc will exist for quite a while yet, I think.  But the transition to clang would be a good step regardless.
December 02, 2011
Just FYI, LLVM 3.0 has officially deprecated llvm-gcc in favor of Clang and DragonEgg.

Regards,
Alex

On Fri, Dec 2, 2011 at 8:47 PM, Sean Kelly <sean at invisibleduck.org> wrote:
> On Dec 1, 2011, at 11:49 AM, Jacob Carlborg wrote:
>>
>> On 30 nov 2011, at 23:08, Michel Fortin wrote:
>>
>>> Don't expect the Apple supplied version of GCC to ever get this. Apple stopped merging the GNU trunk of GCC in their own after it was relicensed under GPLv3. They're still maintaining their own 4.2.x branch, but most of their efforts are going to LLVM and Clang.
>>
>>
>> I wonder if that means that DMD should start to use Clang as linker instead of GCC.
>
> llvm-gcc will exist for quite a while yet, I think. ?But the transition to clang would be a good step regardless.
> _______________________________________________
> dmd-internals mailing list
> dmd-internals at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/dmd-internals
December 02, 2011

On 12/1/2011 11:48 AM, Jacob Carlborg wrote:
> On 30 nov 2011, at 22:46, Walter Bright wrote:
>
>> I'm waiting for gcc on the Mac to support TLS, which it must do soon. When it does, I'll change dmd to match it.
>
> That was kind of a disappointing answer.
>

What that means is there's a ton of work to do on dmd, and implementing TLS three times is a waste of effort. dmd will eventually have to match what the default C compiler does on the Mac.

I'm also not terribly concerned if TLS access is slow, only that it is correct. This is because a program that depends on fast TLS access is badly designed, for several reasons.

And lastly, if you wish to work on the OSX TLS, I do appreciate the efforts. I think it can only help. Please look at how clang is doing it, if it is doing it.
December 02, 2011

On 12/2/2011 12:19 PM, Alex wrote:
> Just FYI, LLVM 3.0 has officially deprecated llvm-gcc in favor of Clang and DragonEgg.

I expect that soon we'll switch to llvm for dmd on the Mac. Just not this upcoming release.

It's good to use multiple compilers to compile dmd, such tends to flush out latent source code bugs.
December 02, 2011
On Fri, 2 Dec 2011, Walter Bright wrote:

> On 12/2/2011 12:19 PM, Alex wrote:
> > Just FYI, LLVM 3.0 has officially deprecated llvm-gcc in favor of Clang and DragonEgg.
> 
> I expect that soon we'll switch to llvm for dmd on the Mac. Just not this upcoming release.
> 
> It's good to use multiple compilers to compile dmd, such tends to flush out latent source code bugs.

I don't remember what the problems were, but there were definitly problems with using llvm on lion when Sean first upgraded the box the tester runs on so we switched it back to gcc.  At some point, someone will have to take the plunge and figure out what the issue(s) was(were).
December 02, 2011
On Dec 2, 2011, at 12:51 PM, Brad Roberts wrote:

> On Fri, 2 Dec 2011, Walter Bright wrote:
> 
>> On 12/2/2011 12:19 PM, Alex wrote:
>>> Just FYI, LLVM 3.0 has officially deprecated llvm-gcc in favor of Clang and DragonEgg.
>> 
>> I expect that soon we'll switch to llvm for dmd on the Mac. Just not this upcoming release.
>> 
>> It's good to use multiple compilers to compile dmd, such tends to flush out latent source code bugs.
> 
> I don't remember what the problems were, but there were definitly problems with using llvm on lion when Sean first upgraded the box the tester runs on so we switched it back to gcc.  At some point, someone will have to take the plunge and figure out what the issue(s) was(were).

I ram into one or two segfaults with the generated dmd built by clang.  If I remember correctly, one was an alignment issue calling a struct's default actor (the one generated by the compiler, not the user).  This is why I suggested moving to clang as a desired future step rather than something to be done immediately.  I don't think it's worth it if we have to work around compiler bugs.
December 02, 2011
On 12/2/11 9:51 PM, Brad Roberts wrote:
> I don't remember what the problems were, but there were definitly problems with using llvm on lion when Sean first upgraded the box the tester runs on so we switched it back to gcc.  At some point, someone will have to take the plunge and figure out what the issue(s) was(were).

One of the issues was this, where the DMD malloc implementation didn't align memory correctly: https://github.com/D-Programming-Language/dmd/pull/301.

Even with the fix in, there were some other random bugs/oddities though, which I didn't even attempt to track down before switching back (if I remember correctly).

David
December 02, 2011

On 12/2/2011 1:26 PM, David Nadlinger wrote:
> On 12/2/11 9:51 PM, Brad Roberts wrote:
>> I don't remember what the problems were, but there were definitly problems with using llvm on lion when Sean first upgraded the box the tester runs on so we switched it back to gcc.  At some point, someone will have to take the plunge and figure out what the issue(s) was(were).
>
> One of the issues was this, where the DMD malloc implementation didn't align memory correctly: https://github.com/D-Programming-Language/dmd/pull/301.
>
> Even with the fix in, there were some other random bugs/oddities though, which I didn't even attempt to track down before switching back (if I remember correctly).
>

Yeah, we'll wait a while longer.