Created attachment 545492 [details] emerge --info Chromium 69 & 70 builds fail with the following error fatal error: error in backend: Unable to copy EFLAGS physical register! x86_64-pc-linux-gnu-clang++: error: clang frontend command failed with exit code 70 (use -v to see invocation) In addition to completely rebuilding my system I've tried number of toolchain version permutations: gcc:7.3.0 & gcc:8.2.0 llvm:6, llvm:7, lvm:8 binutils:2.30 & binutils:2.31 march=native & march=skylake-avx512 ld.bfd, ld.gold & lld Also tried enabling & disabling the component-build & jumbo-build use flags All the above fail with the same EFLAGS error. using the exact output of cpuid2cpuflags in make.conf CPU_FLAGS_X86="aes avx avx2 avx512f avx512dq avx512cd avx512bw avx512vl f16c fma3 mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" Ultimately setting march=skylake made the build succeed which hints at improper behavior with the avx512 type instructions.
Created attachment 545494 [details] Build log
(In reply to Wil Reichert from comment #0) > Ultimately setting march=skylake made the build succeed which hints at > improper behavior with the avx512 type instructions. Sounds like a toolchain issue of some sort; giving this to the llvm people.
From the build log: ******************** PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: x86_64-pc-linux-gnu-clang++: note: diagnostic msg: /var/tmp/portage/www-client/chromium-69.0.3497.57/temp/tab-b2786a.cpp x86_64-pc-linux-gnu-clang++: note: diagnostic msg: /var/tmp/portage/www-client/chromium-69.0.3497.57/temp/tab-b2786a.sh x86_64-pc-linux-gnu-clang++: note: diagnostic msg: ********************
Here's the failing source file. https://chromium.googlesource.com/chromium/src/+/69.0.3497.57/chrome/browser/ui/views/tabs/tab.cc
tab-b2786a.cpp & tab-b2786a.sh (too big to attach here) https://www.dropbox.com/s/grewnfnm7u8iva2/tab-b2786a.tar.gz?dl=0
Thanks for the report. I'm going to try to reproduce it, and hopefully I'll be able to take it from here without proxying between you and upstream ;-).
I'm afraid I won't be able to reproduce it since Chromium insists on running just-compiled executables and I don't have any system with AVX512. I think the best thing to do right now would be to rebuild LLVM+Clang with '-Og -ggdb', and try getting a backtrace. Would you like to report the bug upstream yourself or should I proxy for you?
Rebuilt clang & llvm with '-Og -ggdb' but I'm not sure how to get a backtrace from the compile failure. Might be better if you file the upstream bug as I'm not sure how to replicate this outside of a Gentoo build environment. I'm happy to provide debug logs & test patches as needed.
Could you attach the .cpp and .sh file listed in the build log?
Too big to attach here - https://www.dropbox.com/s/936phn8mrh88urm/build-logs.tar.xz?dl=0
Thanks. I can reproduce the problem with that file and I've already started reducing it.
Created attachment 545746 [details] tab.cpp That should be enough to crash clang++: // $ clang++ -march=skylake-avx512 -O2 tab.cpp // fatal error: error in backend: Unable to copy EFLAGS physical register! bool a(); int b, c; float d; float fn2() { int e = a(); double f = e ? 0.75f : 0; if (c) d = e ? 0 : b; return f; }
Thanks. I'll pass that on.
Created attachment 548572 [details, diff] patch for llvm-7 Ok, so apparently upstream has patched the problem. I'm attaching their patch, and it seems to clearly apply to release_70 branch. Could you please user-patch it into sys-devel/llvm, rebuild it and test whether it solves the issue for you? Clang rebuild shouldn't be necessary.
Yes, its solved issue, thanks.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cf5cbc3700bc996519f9c5273973f58e6ec3d580 commit cf5cbc3700bc996519f9c5273973f58e6ec3d580 Author: Michał Górny <mgorny@gentoo.org> AuthorDate: 2018-10-02 17:56:57 +0000 Commit: Michał Górny <mgorny@gentoo.org> CommitDate: 2018-10-02 18:40:55 +0000 sys-devel/llvm: Backport X86 codegen bugfix for Chromium builds Backport the X86 codegen fix to 7.0.0 and 6.0.1, to ~arch. Hopefully people will get this along with libffi-enforced rebuild. We can stabilize 6.0.1-r2 either when stable users start hitting this, or when libffi gets stable. Bug: https://bugs.gentoo.org/664868 Signed-off-by: Michał Górny <mgorny@gentoo.org> ...6DomainReassignment-from-creating-copies-.patch | 110 +++++++++ sys-devel/llvm/llvm-6.0.1-r2.ebuild | 270 +++++++++++++++++++++ sys-devel/llvm/llvm-7.0.0-r1.ebuild | 264 ++++++++++++++++++++ 3 files changed, 644 insertions(+)
I've tested chromium 69.0.3497.100 & 70.0.3538.45, both compile successfully with the patch added to llvm-7.0.0-r1.
Let's rename the bug to make it clearer why it's not closed yet.
I guess we will likely stabilize 7.0.1 before libffi goes stable after all.
6.0.1-r2 is stable on all affected arches wrt bug #686028.