Closed Bug 513353 Opened 12 years ago Closed 12 years ago

use gcc-4.2 by default for Mac OS X trunk


(Firefox Build System :: General, defect)

Not set


(Not tracked)



(Reporter: smichaud, Assigned: jaas)




(1 file, 2 obsolete files)

Using gcc 4.2 on OS X provides performance gains over using gcc	4.0
(the system default).	If we decide to	use it in preference to	gcc
4.0, we should patch the build system to use it by default (where
appropriate and available).  I'll post a preliminary patch in my next
Attached patch Preliminary patch (obsolete) — Splinter Review
I'm not too familiar with and friends, so I'm not sure
I've done this the right way.

Since my additions to the "Check for MacOS deployment target version"
block can change $CXX_VERSION (used by the "Mac OS X toolchain
support" block), I switched the order of those two blocks.  I can't
foresee any harm in doing so.

I tried to make sure that my new code doesn't override user-specified
values for $CC or $CXX.

This patch can't be landed until bug 510920 is fixed -- with it, the
build process currently fails building Breakpad.
Attachment #397352 - Flags: review?(ted.mielczarek)
I commented in bug 501436 comment 22 to note that the nightly/release builds use the universal mozconfig, which explicitly sets the GCC version and SDK.
Many of us just build for the current "platform" -- if it's just for
our own use, we don't usually do universal builds (which take twice as

We could (indeed we should) provide a recommended mozconfig for use
when MACOSX_DEPLOYMENT_TARGET >= 10.5, which also explicitly sets the
gcc version and SDK.  But I still think it makes sense to make gcc 4.2
the default (where appropriate) -- unless the mozconfig overrides

In any case, we can't land this patch (or test it fully) until bug
510920 is fixed.

And I now realize that if I want to make gcc-4.2 the default
throughout the tree, there are a couple of additional
files that I need to alter (in nsprpub and js/src).
Assignee: nobody → smichaud
Attachment #397352 - Flags: review?(ted.mielczarek) → review-
Comment on attachment 397352 [details] [diff] [review]
Preliminary patch

Let's not worry about NSPR, they're not likely to want to drop 10.4 support there anyway. We will need the same fixes in js/src/, however.

Given bug 501436, I don't think we need to bother with checking the macos-target value. We're changing the minimum supported value to 10.5, so let's just set CC/CXX to gcc 4.2 when building on Mac (and not explicitly specifying CC/CXX).

+        AC_SUBST(CC)
+        AC_SUBST(CXX)

Pretty sure you don't need these.
Attached patch fix v1.0 (obsolete) — Splinter Review
Attachment #401833 - Flags: review?(ted.mielczarek)
Comment on attachment 401833 [details] [diff] [review]
fix v1.0

Looking more closely, I don't think this is the right place to set these.

We check CC/CXX_VERSION way up here:

You probably want to throw a Darwin even further up here:
and parallel what we're doing in that Win32 block (only set CC=gcc4.2 if it's unset, so people can still override it.)
Attachment #401833 - Flags: review?(ted.mielczarek) → review-
Assignee: smichaud → joshmoz
Attached patch fix v1.1Splinter Review
Nice catch Ted, thanks.
Attachment #397352 - Attachment is obsolete: true
Attachment #401833 - Attachment is obsolete: true
Attachment #403096 - Flags: review?(ted.mielczarek)
Attachment #403096 - Flags: review?(ted.mielczarek) → review+
Hardware: x86 → All
Summary: Use gcc 4.2 when MACOSX_DEPLOYMENT_TARGET >= 10.5 on OS X → use gcc-4.2 by default for Mac OS X trunk
pushed to mozilla-central
Closed: 12 years ago
Resolution: --- → FIXED
Blocks: 525331
Flags: in-testsuite-
Target Milestone: --- → mozilla1.9.3a1
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.