Remove GCC-4.9 from toolchains
Categories
(Firefox Build System :: Toolchains, enhancement, P3)
Tracking
(firefox67 fixed)
Tracking | Status | |
---|---|---|
firefox67 | --- | fixed |
People
(Reporter: jgilbert, Assigned: froydnj)
References
Details
Attachments
(6 files, 8 obsolete files)
(deleted),
text/x-phabricator-request
|
Details | |
Bug 1451104 - part 2 - force clang to always pick up its local GCC headers and libraries; r=glandium
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details |
Updated•7 years ago
|
Comment 1•7 years ago
|
||
Updated•7 years ago
|
Reporter | ||
Comment 2•7 years ago
|
||
Comment 3•7 years ago
|
||
Comment 4•7 years ago
|
||
Reporter | ||
Comment 5•7 years ago
|
||
Comment 6•7 years ago
|
||
Comment 7•7 years ago
|
||
Comment 8•7 years ago
|
||
Comment 9•7 years ago
|
||
Assignee | ||
Comment 10•6 years ago
|
||
Assignee | ||
Comment 11•6 years ago
|
||
Assignee | ||
Comment 12•6 years ago
|
||
Assignee | ||
Comment 13•6 years ago
|
||
Assignee | ||
Comment 14•6 years ago
|
||
Assignee | ||
Comment 15•6 years ago
|
||
Assignee | ||
Comment 16•6 years ago
|
||
Assignee | ||
Comment 17•6 years ago
|
||
Assignee | ||
Comment 18•6 years ago
|
||
Assignee | ||
Comment 19•6 years ago
|
||
Updated•6 years ago
|
Comment 20•6 years ago
|
||
Comment 21•6 years ago
|
||
Comment 22•6 years ago
|
||
Assignee | ||
Comment 23•6 years ago
|
||
Comment 24•6 years ago
|
||
Comment 25•6 years ago
|
||
Assignee | ||
Comment 26•6 years ago
|
||
Assignee | ||
Comment 27•6 years ago
|
||
Comment 28•6 years ago
|
||
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 29•6 years ago
|
||
Assignee | ||
Comment 30•6 years ago
|
||
Assignee | ||
Comment 31•6 years ago
|
||
Assignee | ||
Updated•6 years ago
|
Comment 32•6 years ago
|
||
Comment 33•6 years ago
|
||
Comment 34•6 years ago
|
||
Comment 35•6 years ago
|
||
Comment 36•6 years ago
|
||
Comment 37•6 years ago
|
||
Assignee | ||
Comment 38•6 years ago
|
||
Assignee | ||
Comment 39•6 years ago
|
||
Assignee | ||
Updated•6 years ago
|
Comment 40•6 years ago
|
||
Updated•6 years ago
|
Assignee | ||
Comment 41•6 years ago
|
||
Comment 42•6 years ago
|
||
Comment 43•6 years ago
|
||
Comment 44•6 years ago
|
||
Comment 45•6 years ago
|
||
Comment 46•6 years ago
|
||
Comment 47•6 years ago
|
||
Comment 48•6 years ago
|
||
Assignee | ||
Comment 49•6 years ago
|
||
Sigh, this is now biting bobowen because the type_traits our clang is finding is the GCC 4.9 version, which isn't fully up-to-date wrt C++11. And the patches are not quite trivially relandable:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=d7091425c443b1ddf5f0289e9f97b2c6d3c5c376
because the valgrind image is too old (maybe we could hack around that) and the mingw jobs are failing because our bundled linker can't find libstdc++. (Maybe if those jobs installed gcc, everything would be OK?)
Assignee | ||
Comment 50•6 years ago
|
||
OK, the mingw builds appear to be because (host) clang is looking in...weird places for libstdc++:
[task 2019-03-05T21:13:34.694Z] 21:13:34 INFO - Found candidate GCC installation: /builds/worker/workspace/build/src/clang/bin/../lib/gcc/x86_64-unknown-linux-gnu/6.4.0
[task 2019-03-05T21:13:34.694Z] 21:13:34 INFO - Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/6
[task 2019-03-05T21:13:34.694Z] 21:13:34 INFO - Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/6.3.0
[task 2019-03-05T21:13:34.694Z] 21:13:34 INFO - Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
[task 2019-03-05T21:13:34.694Z] 21:13:34 INFO - Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.3.0
[task 2019-03-05T21:13:34.694Z] 21:13:34 INFO - Selected GCC installation: /builds/worker/workspace/build/src/clang/bin/../lib/gcc/x86_64-unknown-linux-gnu/6.4.0
...
[task 2019-03-05T21:13:34.733Z] 21:13:34 INFO - attempt to open /builds/worker/workspace/build/src/clang/bin/../lib/gcc/x86_64-unknown-linux-gnu/6.4.0/libstdc++.so failed
[task 2019-03-05T21:13:34.733Z] 21:13:34 INFO - attempt to open /builds/worker/workspace/build/src/clang/bin/../lib/gcc/x86_64-unknown-linux-gnu/6.4.0/libstdc++.a failed
[task 2019-03-05T21:13:34.733Z] 21:13:34 INFO - attempt to open /lib/x86_64-linux-gnu/libstdc++.so failed
[task 2019-03-05T21:13:34.733Z] 21:13:34 INFO - attempt to open /lib/x86_64-linux-gnu/libstdc++.a failed
[task 2019-03-05T21:13:34.733Z] 21:13:34 INFO - attempt to open /lib/../lib64/libstdc++.so failed
[task 2019-03-05T21:13:34.733Z] 21:13:34 INFO - attempt to open /lib/../lib64/libstdc++.a failed
[task 2019-03-05T21:13:34.733Z] 21:13:34 INFO - attempt to open /usr/lib/x86_64-linux-gnu/libstdc++.so failed
[task 2019-03-05T21:13:34.733Z] 21:13:34 INFO - attempt to open /usr/lib/x86_64-linux-gnu/libstdc++.a failed
[task 2019-03-05T21:13:34.733Z] 21:13:34 INFO - attempt to open /usr/lib/../lib64/libstdc++.so failed
[task 2019-03-05T21:13:34.733Z] 21:13:34 INFO - attempt to open /usr/lib/../lib64/libstdc++.a failed
[task 2019-03-05T21:13:34.734Z] 21:13:34 INFO - attempt to open /builds/worker/workspace/build/src/clang/bin/../lib/gcc/x86_64-unknown-linux-gnu/6.4.0/../../../libstdc++.so failed
[task 2019-03-05T21:13:34.734Z] 21:13:34 INFO - attempt to open /builds/worker/workspace/build/src/clang/bin/../lib/gcc/x86_64-unknown-linux-gnu/6.4.0/../../../libstdc++.a failed
[task 2019-03-05T21:13:34.734Z] 21:13:34 INFO - attempt to open /builds/worker/workspace/build/src/clang/bin/../lib/libstdc++.so failed
[task 2019-03-05T21:13:34.734Z] 21:13:34 INFO - attempt to open /builds/worker/workspace/build/src/clang/bin/../lib/libstdc++.a failed
...
[task 2019-03-05T21:13:34.734Z] 21:13:34 INFO - attempt to open /builds/worker/workspace/src/gcc/lib64/libstdc++.so failed
[task 2019-03-05T21:13:34.734Z] 21:13:34 INFO - attempt to open /builds/worker/workspace/src/gcc/lib64/libstdc++.a failed
...
So either we need to copy more files or possibly install gcc? It's not clear to me why this same problem wouldn't happen on, say, linux64 compiles.
Assignee | ||
Comment 51•6 years ago
|
||
Ah, the reason that comment 50 doesn't happen on linux64 compiles is that linux64 compiles pick up the clang/lib/libstdc++.so file, but that file is explicitly removed in the mingw case:
https://searchfox.org/mozilla-central/source/taskcluster/scripts/misc/build-clang-trunk-mingw.sh#324
Of course, I reviewed the patch that introduced that, so I ought to understand why we do that. I assume that it is to encourage the mingw target to pick the (target-specific?) libc++ in the same directory rather than the (host-specific) libstdc++? Or just to use libc++ instead of libstdc++? Jacek, do you know?
I think the Right Thing is to copy those files into a target-specific directory, rather than the general lib/ directory...I'm not sure if that will cause problem later down the line.
Comment 52•6 years ago
|
||
I don't remember details, but I think it was because it wasn't compatible with host libstdc++.so and that caused problems on Taskcluster when using mingw clang as host compiler. Maybe we may get rid of this rm on top of your patches.
Assignee | ||
Comment 53•6 years ago
|
||
PGO builds are consistently running into things like:
[task 2019-03-06T20:18:56.776Z] 20:18:56 INFO - /builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/mozalloc.h:131: undefined reference to `moz_xmalloc'
[task 2019-03-06T20:18:56.777Z] 20:18:56 INFO - /tmp/lto-llvm-c957ca.o:/builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/mozalloc.h:131: more undefined references to `moz_xmalloc' follow
[task 2019-03-06T20:18:56.777Z] 20:18:56 INFO - /builds/worker/workspace/build/src/clang/bin/../lib/gcc/x86_64-unknown-linux-gnu/6.4.0/../../../../x86_64-unknown-linux-gnu/bin/ld: Dwarf Error: mangled line number section (bad file number).
[task 2019-03-06T20:18:56.777Z] 20:18:56 INFO - /builds/worker/workspace/build/src/clang/bin/../lib/gcc/x86_64-unknown-linux-gnu/6.4.0/../../../../x86_64-unknown-linux-gnu/bin/ld: Dwarf Error: mangled line number section (bad file number).
[task 2019-03-06T20:18:56.777Z] 20:18:56 INFO - /builds/worker/workspace/build/src/clang/bin/../lib/gcc/x86_64-unknown-linux-gnu/6.4.0/../../../../x86_64-unknown-linux-gnu/bin/ld: Dwarf Error: mangled line number section (bad file number).
[task 2019-03-06T20:18:56.777Z] 20:18:56 INFO - /tmp/lto-llvm-c957ca.o: In function `mozilla::dom::WorkerPrivate::WorkerPrivate(mozilla::dom::WorkerPrivate*, nsTSubstring<char16_t> const&, bool, mozilla::dom::WorkerType, nsTSubstring<char16_t> const&, nsTSubstring<char> const&, mozilla::dom::WorkerLoadInfo&)':
[task 2019-03-06T20:18:56.777Z] 20:18:56 INFO - Unified_cpp_dom_workers1.cpp:(.text._ZN7mozilla3dom13WorkerPrivateC2EPS1_RK12nsTSubstringIDsEbNS0_10WorkerTypeES6_RKS3_IcERNS0_14WorkerLoadInfoE+0x673): undefined reference to `gMozillaPoisonValue'
[task 2019-03-06T20:18:56.777Z] 20:18:56 INFO - /tmp/lto-llvm-c957ca.o: In function `operator new(unsigned int)':
Lots and lots of problems finding moz_xmalloc and gMozillaPoisonValue...but nothing else.
glandium, do you recall seeing anything like this when switching things over to clang? It puzzles me how a GCC switch here is affecting things, unless GCC 6 miscompiles clang, or something...?
Oh, oh, we're also maybe forcing the use of GNU ld by putting it first on the search path somehow. Is this us using an ld (from binutils) that clang doesn't expect, perhaps?
Comment 55•6 years ago
|
||
I've never seen this, but OTOH, that log says it's not using the ld from the binutils toolchain archive at all, like it should...
Assignee | ||
Comment 56•6 years ago
|
||
(In reply to Mike Hommey [:glandium] from comment #55)
I've never seen this, but OTOH, that log says it's not using the ld from the binutils toolchain archive at all, like it should...
Ah, right, OK. So build jobs use some separate linux64-binutils thing, whereas the gcc packages build their own, separate binutils that is not version-aligned with linux64-binutils. But we need the clang bootstrap process, at least, to use a newer binutils than what the system provides.
There are at least two different ways around this:
- Make the GCC builds use the same version of binutils as the standalone binutils job.
- Make the GCC builds not build binutils themselves, but pull linux64-binutils and copy the binaries over.
The first one is expedient (and is almost trivially easy to write/verify). The second one is more robust, but also requires more extensive changes. In the interests of expediency (so people can start using all the C++11 things in, you know, C++11 headers), I would like to go with the first solution, with a commitment to follow up on the second solution. Sound good?
Assignee | ||
Comment 58•6 years ago
|
||
Explicit is better than implicit, and helps ensure that GCC is always
using the binutils we built it with, rather than the system binutils.
Assignee | ||
Comment 59•6 years ago
|
||
We want our clang bootstrap to use the GCC headers we're building with,
not whatever sysroot it happens to find on the server we're building on.
The -gcc-toolchain argument we specify when building clang will also be
picked up by llvm-config, so we need to strip it out when building the
plugin. Otherwise, we will get peculiar failures about not being able to
find C++ header files.
Depends on D22879
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 60•6 years ago
|
||
We do this to encourage clang to find an new-enough linker instead of
the system one.
Depends on D22880
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 61•6 years ago
|
||
We're going to copy an x86_64-unknown-linux-gnu ld into the clang build,
which clang will then use in preference to things on PATH. We therefore
need to ensure that this ld is the same ld as would be used for other
builds, such as PGO. This change is the most expedient way to do that;
future work will make the gcc job(s) depend on linux64-binutils directly.
Depends on D22881
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 62•6 years ago
|
||
Firefox itself has moved on to GCC 6.x; we can move our toolchains along too.
Depends on D22882
Assignee | ||
Comment 63•6 years ago
|
||
History does not disclose why we needed this, but in the brave new GCC
6-compiled world, deleting these files means that host links can no
longer find libstdc++, which causes problems. Let's put the files back.
Depends on D22883
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 64•6 years ago
|
||
Uploaded new patches to phab. Parts 4 and 6 on phab are new, and parts 3 and 5 have been slightly tweaked from their corresponding patches here.
Comment 65•6 years ago
|
||
Looks like there's still some bits to iron out, but I've tried my chromium update with these patches and (aside from something I need to fix) the Linux builds are now working, thanks.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=a1cc59ab891f46a46c3ad2c4b3eae0509c7787a6
Comment 66•6 years ago
|
||
Comment 67•6 years ago
|
||
Backed out 6 changesets (bug 1451104) for toolchains bustage on a CLOSED TREE.
Backout link: https://hg.mozilla.org/integration/autoland/rev/779dcbea91ce69857c4aa3a9d1823905cb45ee03
Log link: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=233789124&repo=autoland&lineNumber=7071
Log snippet:
[task 2019-03-14T02:34:24.851Z] -- Installing: /builds/worker/workspace/moz-toolchain/build/stage1/clang-tidy/lib/cmake/llvm/./FindSphinx.cmake
[task 2019-03-14T02:34:24.851Z] -- Installing: /builds/worker/workspace/moz-toolchain/build/stage1/clang-tidy/lib/cmake/llvm/./AddOCaml.cmake
[task 2019-03-14T02:34:24.851Z] -- Installing: /builds/worker/workspace/moz-toolchain/build/stage1/clang-tidy/lib/cmake/llvm/./LLVMProcessSources.cmake
[task 2019-03-14T02:34:24.852Z] -- Installing: /builds/worker/workspace/moz-toolchain/build/stage1/clang-tidy/lib/cmake/llvm/./AddLLVMDefinitions.cmake
[task 2019-03-14T02:34:24.852Z] -- Installing: /builds/worker/workspace/moz-toolchain/build/stage1/clang-tidy/lib/cmake/llvm/./AddLLVM.cmake
[task 2019-03-14T02:34:24.852Z] -- Installing: /builds/worker/workspace/moz-toolchain/build/stage1/clang-tidy/lib/cmake/llvm/./FindOCaml.cmake
[task 2019-03-14T02:34:24.852Z] -- Installing: /builds/worker/workspace/moz-toolchain/build/stage1/clang-tidy/lib/cmake/llvm/./HandleLLVMOptions.cmake
[task 2019-03-14T02:34:24.878Z] cd "/builds/worker/workspace/build/src/build/build-clang"
[task 2019-03-14T02:34:25.213Z] Traceback (most recent call last):
[task 2019-03-14T02:34:25.213Z] File "./build-clang.py", line 796, in <module>
[task 2019-03-14T02:34:25.213Z] osx_cross_compile)
[task 2019-03-14T02:34:25.213Z] File "./build-clang.py", line 426, in prune_final_dir_for_clang_tidy
[task 2019-03-14T02:34:25.213Z] raise Exception("Found unknown file %s in the final directory" % f)
[task 2019-03-14T02:34:25.213Z] Exception: Found unknown file /builds/worker/workspace/moz-toolchain/build/stage1/clang-tidy/x86_64-unknown-linux-gnu in the final directory
[fetches 2019-03-14T02:34:25.231Z] removing /builds/worker/workspace/build
[fetches 2019-03-14T02:34:25.657Z] finished
[taskcluster 2019-03-14 02:34:26.062Z] === Task Finished ===
[taskcluster 2019-03-14 02:34:27.796Z] Unsuccessful task run with exit code: 1 completed in 678.969 seconds
Comment 68•6 years ago
|
||
Comment 69•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/468eed96e879
https://hg.mozilla.org/mozilla-central/rev/961ac7318786
https://hg.mozilla.org/mozilla-central/rev/f3290e95b38d
https://hg.mozilla.org/mozilla-central/rev/292ed1bb9143
https://hg.mozilla.org/mozilla-central/rev/858b68d306f2
https://hg.mozilla.org/mozilla-central/rev/76a3b7b0c9d7
Assignee | ||
Updated•6 years ago
|
Description
•