{"id":3519,"date":"2015-04-15T03:59:43","date_gmt":"2015-04-15T01:59:43","guid":{"rendered":"http:\/\/glandium.org\/blog\/?p=3519"},"modified":"2015-04-15T03:59:43","modified_gmt":"2015-04-15T01:59:43","slug":"getting-ready-for-gcc-5-1","status":"publish","type":"post","link":"https:\/\/glandium.org\/blog\/?p=3519","title":{"rendered":"Getting ready for GCC 5.1"},"content":{"rendered":"<p>Confusingly, GCC has a new, weird, version scheme. The first release of GCC 5 will be 5.1. It is due soon (next week). For that reason, and because it's better to find compiler bugs before it's released, I started looking into building Firefox with it.<\/p>\n<p>The first round of builds I did was with <a href=\"ftp:\/\/gcc.gnu.org\/pub\/gcc\/snapshots\/5-20150405\/gcc-5-20150405.tar.bz2\">5-20150405<\/a>. That got me to find a small bunch of issues:<\/p>\n<ul>\n<li>The new libstdc++ ABI breaks our compatibility with older libstdc++, which we've been going into <a href=\"http:\/\/hg.mozilla.org\/mozilla-central\/raw-file\/de27ac2ab94f\/build\/unix\/stdc%2B%2Bcompat\/stdc%2B%2Bcompat.cpp\">great length to keep<\/a>. Fortunately, it's still possible to build with some level of compatibility by <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=1153109\">compiling with <code>-D_GLIBCXX_USE_CXX11_ABI=0<\/code><\/a>.<\/li>\n<li>Some build failure in pkix gtests because of <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=1153114\">unused gtest-generated variables in an anonymous namespace<\/a>.<\/li>\n<li>New <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=1153122\">false positive<\/a> hits on <code>-Warray-bounds<\/code>, which, with <code>-Werror<\/code>, led the build to fail.<\/li>\n<li>New <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=1153154\">libstdc++ compatibility issue<\/a> that prevented from running elfhack during the build (we don't set <code>LD_LIBRARY_PATH<\/code> to use the libstdc++ that comes with GCC). Incidentally, I found that the check to ensure we don't introduce dependencies on unwanted symbols from libstdc++ <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=1154122\">has been broken<\/a> (by myself) for a few months. Fortunately, nothing slipped in between.<\/li>\n<li>An <a href=\"https:\/\/gcc.gnu.org\/bugzilla\/show_bug.cgi?id=65678\">Internal Compiler Error (ICE)<\/a> on <code>--enable-debug<\/code> builds, which turned out to be already fixed.<\/li>\n<\/ul>\n<p>So that got me to do a second round with the <a href=\"ftp:\/\/gcc.gnu.org\/pub\/gcc\/snapshots\/5.1.0-RC-20150412\/gcc-5.1.0-RC-20150412.tar.bz2\">first 5.1 RC<\/a>, which had the fix for that ICE.<\/p>\n<p>With all the above fixed, I could finally get builds out of try, and tests running, which revealed two more issues:<\/p>\n<ul>\n<li>Another (quickly fixed) <a href=\"https:\/\/gcc.gnu.org\/bugzilla\/show_bug.cgi?id=65761\">Internal Compiler Error<\/a> on 32-bits PGO builds (but only for a nightly setup, with <code>--enable-profiling<\/code>, not for a release setup, which doesn't have it).<\/li>\n<li><a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=1154185\">JS engine assertions<\/a> during some JIT tests on 64-bits builds (with or without PGO), which Dan Gohman kindly tracked down and reduced to a small test case allowing to <a href=\"https:\/\/gcc.gnu.org\/bugzilla\/show_bug.cgi?id=65765\">file a GCC bug<\/a> and bisect to pinpoint at the <a href=\"https:\/\/gcc.gnu.org\/git\/?p=gcc.git;a=commit;h=52200d03c231f0bddbd4bbc5cd3608c6a1dd4598\">GCC upstream commit that broke it<\/a> (yay <code>git bisect run<\/code> on a 36-CPU EC2 instance).<\/li>\n<\/ul>\n<p>Preliminary results are promising, with benchmarks improving up to 16%, but the comparison wasn't entirely fair, because they compared GCC 4.8 builds with frame pointers and JS engine diagnostics to GCC 5.1 builds without.<\/p>\n<p>I'll also give a spin to LTO, possibly finding more GCC bugs in the process.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Confusingly, GCC has a new, weird, version scheme. The first release of GCC 5 will be 5.1. It is due soon (next week). For that reason, and because it&#8217;s better to find compiler bugs before it&#8217;s released, I started looking into building Firefox with it. The first round of builds I did was with 5-20150405. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[23],"class_list":["post-3519","post","type-post","status-publish","format-standard","hentry","category-planet-mozilla","tag-en"],"_links":{"self":[{"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3519","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3519"}],"version-history":[{"count":5,"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3519\/revisions"}],"predecessor-version":[{"id":3524,"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3519\/revisions\/3524"}],"wp:attachment":[{"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3519"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3519"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3519"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}