In a suprising short time I get tbb compiled with clang and working, according to the tests. It seems clang fulfill the target to be compatible with gcc.
I build the libraries and run the tests for ia32 and intel64.
The test results are the same that the ones I get when using the llvmgcc-4.2 compiler.
If the warnings patch included in my previous thread about "warnings missed by gcc" are applied, there are no compiler warnings at all when building or running the examples.
There are only two files which need a patch:
apparentlyclang needs the public declaration inside ifdef "if __TBB_GCC_3_3_PROTECTED_BROKEN"
file:include/tbb/machine/linux_ia32.h clang doesn't understand the mnemonics fildq and fistpq which must be replaced with fildll and fistpll
And the file macos.clang.inc must be added to build directory. macos.clang.inc it is a copy of macos.gcc.inc with minimal changes:
gcc changed to clang
g++ changed to clang++
compiler flag-fno-schedule-insns2 removed because clang don't understand.
TBB version: tbb40_20111130
Compiler version: (clang -v):
Apple clang version 3.0 (tags/Apple/clang-211.12) (based on LLVM 3.0svn)
Target: x86_64-apple-darwin11.2.0Thread model: posix
(darwin 11.2.0 corresponds to OS X 10.7.2)