mono/mono — pull request #678 by jack-pappas (2013-07-02 02:01:04+00:00)
Title: Allow clang to compile sgen

Clang has supported both the `__thread` and `tls_model` attributes (needed to compile the sgen GC) since Clang/LLVM 3.2.

When compiling Mono with clang, the check which sets `with_tls=pthread` causes `mono-sgen` to be compiled anyway, although with some improper configuration which causes it to crash immediately when run.

I also removed the check for clang which was causing the `HAVE_TLS_MODEL_ATTR` symbol not to be defined, as Clang has in fact supported `tls_model` for some time now.

I cloned the Mono repository today, applied these changes, and compiled Mono using the LLVM/Clang 3.4 nightly builds on both the 32- and 64-bit versions of Ubuntu 12.04 LTS. In both cases, Mono compiled without any problems at all. Running `make check` on both boxes yielded no errors, except that the `finalizer-exception.exe` test hung on the x64 build; it's unclear whether or not this is a bug which manifests itself when Mono is built with clang, or if it's just a general bug in Mono. Either way, it doesn't seem to affect anything else.

If there are any issues compiling Mono with clang on other platforms, these "global" checks for clang should still be removed, and new platform-specific checks added where necessary.