The default bug view has changed. See this FAQ.
Bug 574346 (clang)

[meta] Support building with Clang

RESOLVED FIXED

Status

()

Core
Build Config
RESOLVED FIXED
7 years ago
2 years ago

People

(Reporter: Nomis101, Unassigned)

Tracking

(Depends on: 1 bug, Blocks: 1 bug, {meta})

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

7 years ago
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.
(Reporter)

Comment 1

7 years ago
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.

Comment 2

7 years ago
See http://llvm.org/bugs/show_bug.cgi?id=5511 ; I'm working on submitting the necessary patches.
(Reporter)

Updated

7 years ago
Depends on: 576355

Updated

7 years ago
Keywords: meta
(Reporter)

Updated

7 years ago
Depends on: 579686
(Reporter)

Updated

7 years ago
Depends on: 583283
(Reporter)

Updated

7 years ago
Depends on: 583460
(Reporter)

Updated

7 years ago
Depends on: 583485
Summary: [meta] Do anything that is necessary to build with Clang on Mac OS X 10.6 → [meta] Support building with Clang on Mac
(Reporter)

Updated

7 years ago
Depends on: 600900
(Reporter)

Updated

7 years ago
Depends on: 600901
(Reporter)

Updated

7 years ago
Depends on: 601360
(Reporter)

Updated

7 years ago
Depends on: 601974
OS: Mac OS X → Windows 7
OS: Windows 7 → Mac OS X
Depends on: 622138
Depends on: 622142
Depends on: 622144
Depends on: 623116
Depends on: 623117
Depends on: 623119
Depends on: 623121
Depends on: 623122
Depends on: 623123
Depends on: 623126
Depends on: 623127
Depends on: 623129
Depends on: 623132
(Reporter)

Updated

6 years ago
Depends on: 623303
(Reporter)

Updated

6 years ago
Depends on: 624180
(Reporter)

Updated

6 years ago
Depends on: 627979
(Reporter)

Updated

6 years ago
Depends on: 627981

Updated

6 years ago
Alias: clang
Blocks: 629459
Depends on: 629815
Depends on: 629839
(Reporter)

Updated

6 years ago
Depends on: 629884
(Reporter)

Updated

6 years ago
Depends on: 630012
Depends on: 630649

Updated

6 years ago
Depends on: 631809

Updated

6 years ago
Depends on: 628378

Updated

6 years ago
Depends on: 628371
Depends on: 631928
Depends on: 632188
OS: Mac OS X → All
Hardware: x86_64 → All
Summary: [meta] Support building with Clang on Mac → [meta] Support building with Clang
Depends on: 634745
Depends on: 634763
Depends on: 635790
Depends on: 638149
Depends on: 639204
(Reporter)

Comment 3

6 years ago
(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/
(Reporter)

Updated

6 years ago
Depends on: 647580
Depends on: 648871
Depends on: 648872
Depends on: 648873
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.
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED

Comment 5

6 years ago
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();                                                              \
        ^
...

Updated

6 years ago
Depends on: 664252
(In reply to comment #5)
> Unfortunately the Linux build with 3.0 fails:

See bug 664252.

Updated

6 years ago
Depends on: 666135
Depends on: 671711
(Reporter)

Updated

6 years ago
Depends on: 672501
Depends on: 674564
Depends on: 674806

Updated

6 years ago
Depends on: 686462

Updated

6 years ago
Depends on: 692782

Updated

6 years ago
Depends on: 693323

Updated

6 years ago
Depends on: 695243

Updated

5 years ago
Depends on: 707648

Updated

5 years ago
Depends on: 717713

Updated

5 years ago
Depends on: 719575
Depends on: 727081
Depends on: 727595
Depends on: 727233
Depends on: 727226
Depends on: 727221
Depends on: 727220
Depends on: 727145

Comment 7

5 years ago
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.

Updated

5 years ago
Depends on: 729425

Updated

5 years ago
Depends on: 731316
Depends on: 731503
Depends on: 733721

Updated

5 years ago
Depends on: 734490
Depends on: 737909

Updated

5 years ago
Depends on: 740943

Updated

5 years ago
Depends on: 744543

Updated

5 years ago
Blocks: 752004
Depends on: 754988

Updated

5 years ago
Depends on: 755145

Updated

5 years ago
No longer depends on: 755145
Depends on: 758153

Updated

5 years ago
Depends on: 764166

Updated

5 years ago
Depends on: 765381
Depends on: 774015
Depends on: 773768
Depends on: 774017
Depends on: 774018
Depends on: 774019
Depends on: 774020
Depends on: 774021
Depends on: 774022
Depends on: 774023
Depends on: 774024
Depends on: 774025
Depends on: 774028
Depends on: 774029
Depends on: 774030
Depends on: 774031
Depends on: 774033
Depends on: 774037
Depends on: 774038
Depends on: 774039
Depends on: 774040
Depends on: 774041

Updated

5 years ago
Depends on: 774077
Depends on: 774120
Depends on: 774671
Depends on: 774796

Updated

5 years ago
Depends on: 776079

Updated

5 years ago
Depends on: 776077

Updated

5 years ago
Depends on: 776085
(Reporter)

Updated

5 years ago
Depends on: 778997
Depends on: 779333

Updated

5 years ago
Depends on: 784776

Updated

5 years ago
Depends on: 787730

Comment 8

4 years ago
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.

Updated

4 years ago
Depends on: 854936

Updated

4 years ago
Depends on: 884022

Updated

2 years ago
Depends on: 1167846
You need to log in before you can comment on or make changes to this bug.