Properly check for broken (deprecated) compilers.

RESOLVED FIXED in mozilla18

Status

()

Core
Build Config
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: BenWa, Assigned: espindola)

Tracking

unspecified
mozilla18
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

5 years ago
My mac builds just started failing this Friday without any explanation why. The version of clang on my system doesn't build m-c either.

I finally found out that we've deprecated gcc 4.2.1 yet we haven't updated the documentation to reflect. All I get are failures :(

We need to update the documentation to ensure that users can get a working build without having to debug this problem.:
1) We should have a configure check to make sure that a supported compiler (clang) is used.
2) We need to update the build documentation to explain how to get a supported version of clang and modify the sample mozconfig to use clang (or change the default compiler).
* https://developer.mozilla.org/en-US/docs/Simple_Firefox_build
* https://developer.mozilla.org/en-US/docs/Developer_Guide/Build_Instructions/Mac_OS_X_Prerequisites
* Others?

Updated

5 years ago
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 787931

Comment 2

5 years ago
Actually, we need to ban GCC <=4.3 everywhere, so let's use this bug.

Bug 769772 removed some of this functionality. We should be able to re-use parts of the old code.
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
Snow Leopard ships with Clang 1.5, which fails, ftr.
Assignee: nobody → respindola

Comment 4

5 years ago
Some work items:

* Ensure GCC >= 4.4 on all platforms
* Ensure Clang >= X.Y on all platforms (espindola is determining exact version)
* Rip out GCC on OS X logic (it is enforced through compiler-opts.m4 now)

Keep in mind differences between Clang from source and Apple Clang versions.
Status: REOPENED → ASSIGNED
Making the bug slightly more general.
Summary: Properly deprecate GCC 4.2.1 → Properly check for broken (deprecated) compilers.
Created attachment 660412 [details] [diff] [review]
check for llvm.org/pr8927

This is the llvm bug that causes the clang in xcode 4.0 to miscompile firefox. Instead just checking the version number I think it is best to check for the bug directly. This has the same effect in the common case, but doesn't need handle apple X open source version number differences and will also find the bug if it shows up in other compilers.
Attachment #660412 - Flags: review?(gps)
https://tbpl.mozilla.org/?tree=Try&rev=8d428ec5cad9
Created attachment 660496 [details] [diff] [review]
add a check for gcc pr39608

https://tbpl.mozilla.org/?tree=Try&rev=04c661d5e08b

This is the bug that prevents gcc 4.2 and 4.3 from building jstypedarray.cpp.
Attachment #660496 - Flags: review?(gps)

Comment 9

5 years ago
Comment on attachment 660412 [details] [diff] [review]
check for llvm.org/pr8927

Review of attachment 660412 [details] [diff] [review]:
-----------------------------------------------------------------

::: build/autoconf/llvm-pr8927.m4
@@ +43,5 @@
> +if test "$ac_have_llvm_pr8927" = "yes"; then
> +   AC_MSG_RESULT(yes)
> +   echo This compiler would miscompile firefox, plase upgrade.
> +   echo see http://developer.mozilla.org/en-US/docs/Developer_Guide/Build_Instructions/Mac_OS_X_Prerequisites
> +   echo for more information.

I love the idea. But, if I am reading things properly, this check gets executed on platforms besides OS X.

We probably need better documentation on what compilers are supported. Even better, we add compiler installation to the bootstrap scripts which have just landed.
Attachment #660412 - Flags: review?(gps) → review+
Comment on attachment 660496 [details] [diff] [review]
add a check for gcc pr39608

Review of attachment 660496 [details] [diff] [review]:
-----------------------------------------------------------------

LGTM
Attachment #660496 - Flags: review?(gps) → review+
> I love the idea. But, if I am reading things properly, this check gets
> executed on platforms besides OS X.

Yes. We do want to catch someone using an old clang on linux. Pointing to the OS X instructions is an "heuristic" since most users hitting it will be on OS X.
 
> We probably need better documentation on what compilers are supported. Even
> better, we add compiler installation to the bootstrap scripts which have
> just landed.

+1
https://hg.mozilla.org/integration/mozilla-inbound/rev/b68926c02a83
https://hg.mozilla.org/integration/mozilla-inbound/rev/c3590f5e7e1f
https://hg.mozilla.org/mozilla-central/rev/b68926c02a83
https://hg.mozilla.org/mozilla-central/rev/c3590f5e7e1f
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla18
Looks like this patch has caused failures for Firefox mozilla-central linux l10n dep builds - http://tinderbox.mozilla.org/showlog.cgi?log=Mozilla-l10n/1347514468.1347514755.20993.gz

.....
checking for gcc pr39608... yes
This compiler would fail to build firefox, plase upgrade.
program finished with exit code 1
elapsedTime=6.377558
....
For some reason these builders are using the ancient GCC on the system instead of the GCC we use for normal builds:
checking compiler version... gcc (GCC) 4.1.1 20070105 (Red Hat 4.1.1-52)
I guess the configure check works :-(

catlee, how do these build work? What are they for? I don't see any mozconfigs. Where is the:

argv: ['sh', '--', './configure', '--enable-application=browser', '--with-l10n-base=../l10n-central', '--with-macbundlename-prefix=Firefox', '--enable-update-packaging']

coming from? Can we add CC and CXX to it?
Unfortunately the l10n repacks don't use any mozconfigs. See https://bugzilla.mozilla.org/show_bug.cgi?id=774947
(In reply to Chris AtLee [:catlee] from comment #18)
> Unfortunately the l10n repacks don't use any mozconfigs. See
> https://bugzilla.mozilla.org/show_bug.cgi?id=774947

What script is driving the build? Can we edit that directly to set CC and CXX?
I'm not sure what happens, but this also broke openbsd/ppc builds using gcc 4.6.3 through .mozconfig.

checking host system type... powerpc-unknown-openbsd5.2
...
checking compiler version... egcc (GCC) 4.6.3
....
checking for gcc PR49911... yes
checking for gcc pr39608... no
checking for llvm pr8927... yes
This compiler would miscompile firefox, plase upgrade.
see http://developer.mozilla.org/en-US/docs/Developer_Guide/Build_Instructions/Mac_OS_X_Prerequisites
for more information.
*** Fix above errors and then restart with               "gmake -f client.mk build"

i'm not on macosx, and not using llvm.... and the failing llvm test is run with gcc.
Here is the failure with gcc 4.6.3 :

mikey:/usr/obj/m-c/ $egcc t.c
mikey:/usr/obj/m-c/ $./a.out                                                                 
./a.out:./a.out: undefined symbol ''
./a.out:./a.out: undefined symbol ''
./a.out:./a.out: undefined symbol ''
./a.out:./a.out: undefined symbol ''
I'm holding on my failure report for a while, my gcc cant compile anything - local issue atm. I'll recheck once my system is sane.

Comment 23

5 years ago
(In reply to Rafael Ávila de Espíndola (:espindola) from comment #19)
> (In reply to Chris AtLee [:catlee] from comment #18)
> > Unfortunately the l10n repacks don't use any mozconfigs. See
> > https://bugzilla.mozilla.org/show_bug.cgi?id=774947
> 
> What script is driving the build? Can we edit that directly to set CC and
> CXX?

Possible solutions:

link /usr/bin/cc and /usr/bin/gcc to the correct gcc version.

no modification of mozconfig, scripts, etc needed beyond that.

Updated

5 years ago
Blocks: 791209
(In reply to Landry Breuil (:gaston) from comment #20)
> I'm not sure what happens, but this also broke openbsd/ppc builds using gcc
> 4.6.3 through .mozconfig.
> 
> checking host system type... powerpc-unknown-openbsd5.2
> ...
> checking compiler version... egcc (GCC) 4.6.3
> ....
> checking for gcc PR49911... yes
> checking for gcc pr39608... no
> checking for llvm pr8927... yes
> This compiler would miscompile firefox, plase upgrade.
> see
> http://developer.mozilla.org/en-US/docs/Developer_Guide/Build_Instructions/
> Mac_OS_X_Prerequisites
> for more information.
> *** Fix above errors and then restart with               "gmake -f client.mk
> build"
> 
> i'm not on macosx, and not using llvm.... and the failing llvm test is run
> with gcc.

That is strange, looks like 4.5 -> 4.6 introduced the same bug that llvm had. Can you please try that test manually and see what assembly gcc is producing?  I will try to see if it reproduces with 4.6 on linux.
(In reply to Rafael Ávila de Espíndola (:espindola) from comment #24)
> (In reply to Landry Breuil (:gaston) from comment #20)
> > I'm not sure what happens, but this also broke openbsd/ppc builds using gcc
> > 4.6.3 through .mozconfig.
> > 
> > checking host system type... powerpc-unknown-openbsd5.2
> > ...
> > checking compiler version... egcc (GCC) 4.6.3
> > ....
> > checking for gcc PR49911... yes
> > checking for gcc pr39608... no
> > checking for llvm pr8927... yes
> > This compiler would miscompile firefox, plase upgrade.
> > see
> > http://developer.mozilla.org/en-US/docs/Developer_Guide/Build_Instructions/
> > Mac_OS_X_Prerequisites
> > for more information.
> > *** Fix above errors and then restart with               "gmake -f client.mk
> > build"
> > 
> > i'm not on macosx, and not using llvm.... and the failing llvm test is run
> > with gcc.
> 
> That is strange, looks like 4.5 -> 4.6 introduced the same bug that llvm
> had. Can you please try that test manually and see what assembly gcc is
> producing?  I will try to see if it reproduces with 4.6 on linux.

I dont trust my ppc system atm, i'm in the middle of system changes (PIE switched to be default) so any simple code doesnt build with non-basesystem gcc 4.6, and i can't temporarly rebuild gcc 4.6 itself, it just fails. So as soon as i get a working system back, i'll redo the configure test.
You need to log in before you can comment on or make changes to this bug.