Last Comment Bug 788276 - Properly check for broken (deprecated) compilers.
: Properly check for broken (deprecated) compilers.
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Build Config (show other bugs)
: unspecified
: x86 Mac OS X
: -- normal (vote)
: mozilla18
Assigned To: Rafael Ávila de Espíndola (:espindola) (not reading bugmail)
:
: Gregory Szorc [:gps]
Mentors:
Depends on:
Blocks: 791209
  Show dependency treegraph
 
Reported: 2012-09-04 14:01 PDT by Benoit Girard (:BenWa)
Modified: 2012-09-17 13:31 PDT (History)
9 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
check for llvm.org/pr8927 (6.21 KB, patch)
2012-09-12 06:48 PDT, Rafael Ávila de Espíndola (:espindola) (not reading bugmail)
gps: review+
Details | Diff | Splinter Review
add a check for gcc pr39608 (5.35 KB, patch)
2012-09-12 10:01 PDT, Rafael Ávila de Espíndola (:espindola) (not reading bugmail)
gps: review+
Details | Diff | Splinter Review

Description Benoit Girard (:BenWa) 2012-09-04 14:01:55 PDT
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?
Comment 1 Gregory Szorc [:gps] 2012-09-04 14:11:02 PDT

*** This bug has been marked as a duplicate of bug 787931 ***
Comment 2 Gregory Szorc [:gps] 2012-09-10 11:27:36 PDT
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.
Comment 3 Richard Newman [:rnewman] 2012-09-10 12:49:50 PDT
Snow Leopard ships with Clang 1.5, which fails, ftr.
Comment 4 Gregory Szorc [:gps] 2012-09-10 13:02:58 PDT
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.
Comment 5 Rafael Ávila de Espíndola (:espindola) (not reading bugmail) 2012-09-12 06:43:12 PDT
Making the bug slightly more general.
Comment 6 Rafael Ávila de Espíndola (:espindola) (not reading bugmail) 2012-09-12 06:48:50 PDT
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.
Comment 7 Rafael Ávila de Espíndola (:espindola) (not reading bugmail) 2012-09-12 06:49:18 PDT
https://tbpl.mozilla.org/?tree=Try&rev=8d428ec5cad9
Comment 8 Rafael Ávila de Espíndola (:espindola) (not reading bugmail) 2012-09-12 10:01:09 PDT
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.
Comment 9 Gregory Szorc [:gps] 2012-09-12 10:25:28 PDT
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.
Comment 10 Gregory Szorc [:gps] 2012-09-12 10:26:23 PDT
Comment on attachment 660496 [details] [diff] [review]
add a check for gcc pr39608

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

LGTM
Comment 11 Rafael Ávila de Espíndola (:espindola) (not reading bugmail) 2012-09-12 11:44:29 PDT
> 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
Comment 12 Rafael Ávila de Espíndola (:espindola) (not reading bugmail) 2012-09-12 11:49:10 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/b68926c02a83
Comment 13 Rafael Ávila de Espíndola (:espindola) (not reading bugmail) 2012-09-12 11:55:41 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/c3590f5e7e1f
Comment 15 Alexander L. Slovesnik 2012-09-13 01:49:47 PDT
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
....
Comment 16 Ted Mielczarek [:ted.mielczarek] 2012-09-13 06:43:21 PDT
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)
Comment 17 Rafael Ávila de Espíndola (:espindola) (not reading bugmail) 2012-09-13 07:36:56 PDT
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?
Comment 18 Chris AtLee [:catlee] 2012-09-13 08:56:25 PDT
Unfortunately the l10n repacks don't use any mozconfigs. See https://bugzilla.mozilla.org/show_bug.cgi?id=774947
Comment 19 Rafael Ávila de Espíndola (:espindola) (not reading bugmail) 2012-09-13 11:00:14 PDT
(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?
Comment 20 Landry Breuil (:gaston) 2012-09-13 23:01:23 PDT
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.
Comment 21 Landry Breuil (:gaston) 2012-09-13 23:06:16 PDT
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 ''
Comment 22 Landry Breuil (:gaston) 2012-09-13 23:52:25 PDT
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 Michael Foerster 2012-09-14 05:51:21 PDT
(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.
Comment 24 Rafael Ávila de Espíndola (:espindola) (not reading bugmail) 2012-09-17 06:07:43 PDT
(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.
Comment 25 Landry Breuil (:gaston) 2012-09-17 13:31:09 PDT
(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.

Note You need to log in before you can comment on or make changes to this bug.