Apple is moving from GCC to LLVM/Clang. Therefore gcc-4.0 doesn't exist anymore in Xcode 4 and gcc-4.2 isn't actively maintained anymore ("...because we're just not fixing bugs in GCC anymore.", WWDC 2010 Session Video, Session 312, 6:22 min). So it is necessary to be able to build Mozilla applications with LLVM/Clang. To build with Clang you need Xcode 4, because only Xcode 4 includes clang++ (for Xcode 4 OS X 10.6.3 or higher is required). You also can get Clang from http://clang.llvm.org/get_started.html. Apple says building with Clang is faster, it gives a performance win, it has great user features and better error messages. Clang had successfully built the Boost library, and had passed almost all tests: http://blog.llvm.org/2010/05/clang-builds-boost.html For more informations I recommend the WWDC 2010 Session Videos about LLVM: http://developer.apple.com/videos/wwdc/2010/ (in the section "Developer Tools"). Note that LLVM-GCC is different to Clang: GCC-4.2 -> Parser (GCC) / Code Generator (GCC) LLVM-GCC -> Parser (GCC) / Code Generator (LLVM) Clang -> Parser (Clang-LLVM) / Code Generator (LLVM) Note to the C++ language feature: "Clang strives to strictly conform to the C++ standard. That means it will reject invalid C++ code that another compiler may accept. If Clang reports errors in your code, please check the C++ Compatibility page to see whether they are C++-conformance bugs and how you can fix them." http://clang.llvm.org/docs/UsersManual.html#cxx Error messages from Clang are different from gcc error messages.
Because Xcode 4 isn't officially released yet, I've only tested to build with clang version 2.0 (trunk 106670) And I found two issues. As soon as Xcode 4 is available I will test it with Xcode 4 clang version to see if it gives me the same issues.
See http://llvm.org/bugs/show_bug.cgi?id=5511 ; I'm working on submitting the necessary patches.
(In reply to comment #1) > Because Xcode 4 isn't officially released yet Now it is, Apple has today releases Xcode 4 with clang++ http://developer.apple.com/xcode/
On OS X it is possible to build firefox with clang 2.9 and on Linux with 3.0. I am closing this bug. Bug 647580 tracks building with xcode 4.
Unfortunately the Linux build with 3.0 fails: ... var/tmp/mozilla-central/js/src/jsinterp.cpp:3467:5: error: indirect goto might cross protected scopes RELATIONAL_OP(<=); ^ /var/tmp/mozilla-central/js/src/jsinterp.cpp:3457:9: note: instantiated from: TRY_BRANCH_AFTER_COND(cond, 2); \ ^ /var/tmp/mozilla-central/js/src/jsinterp.cpp:3005:17: note: instantiated from: BRANCH(len); \ ^ /var/tmp/mozilla-central/js/src/jsinterp.cpp:2422:9: note: instantiated from: DO_OP(); \ ^ /var/tmp/mozilla-central/js/src/jsinterp.cpp:2193:33: note: instantiated from: JS_EXTENSION_(goto *jumpTable[op]); \ ^ /var/tmp/mozilla-central/js/src/jsinterp.cpp:3467:5: note: instantiated from: RELATIONAL_OP(<=); ^ /var/tmp/mozilla-central/js/src/jsinterp.cpp:3457:9: note: instantiated from: TRY_BRANCH_AFTER_COND(cond, 2); \ ^ /var/tmp/mozilla-central/js/src/jsinterp.cpp:3005:17: note: instantiated from: BRANCH(len); \ ^ /var/tmp/mozilla-central/js/src/jsinterp.cpp:2422:9: note: instantiated from: DO_OP(); \ ^ ...
Spurred by the multiple (I think it was 3) breakages of Clang/m-c in the past week or so, I set up a personal Jenkins builder to continuously build m-c using Clang. You can find the build information at http://jenkins.gregoryszorc.com:9000/ There are 4 build configurations. Each is running on Ubuntu 11.10 x64. I have debug and release builds going for each of LLVM 3.0 and LLVM built from the LLVM Subversion repository. Currently, Jenkins will alert #pymake on build failures. If you want additional notifications (I can configure it to send email, etc), drop me a line on IRC and I'll hook you up. Also, I make no guarantees for the availability of the service.
Does Firefox3.6.10 supported for building with Clang? We have build errors when building firefox3.6.10 with Clang on Mac OS X Lion.
(In reply to Yun Guo from comment #8) > Does Firefox3.6.10 supported for building with Clang? We have build errors > when building firefox3.6.10 with Clang on Mac OS X Lion. I never tried (joined mozilla during the firefox4 days), but would be surprised if 3.6.10 would build with clang.
Building 3.6.10 with anything is not supported anymore, and has not been for months or years.