Summary: | sys-devel/clang-15: May produce invalid code when -O1 (or higher) is used with -fzero-call-used-regs=all (net-misc/openssh may be miscompiled with Clang 15) | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | nvinson234 |
Component: | Current packages | Assignee: | LLVM support project <llvm> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | anton.gubarkov, base-system, douzzer, sam, sputnick |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
URL: | https://github.com/llvm/llvm-project/issues/57692 | ||
See Also: |
https://bugs.gentoo.org/show_bug.cgi?id=872548 https://github.com/llvm/llvm-project/issues/59242 https://bugzilla.mindrot.org/show_bug.cgi?id=3475 https://github.com/llvm/llvm-project/issues/57692 |
||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | 890000 | ||
Bug Blocks: | 408963, 915000 |
Description
nvinson234
2022-09-12 09:12:30 UTC
This was found when building openssh with clang-15. After building openssh, utilities such as ssh-keygen started segfaulting as described above. FYI: __progname is initialized by glibc during program startup. It is a GNU extension. (In reply to nvinson234 from comment #1) > This was found when building openssh with clang-15. After building openssh, > utilities such as ssh-keygen started segfaulting as described above. For completeness, I was building net-misc/openssh-9.0_p1-r3 I can confirm this (and was about to file a bug myself, although I didn't find the time to identify the root cause, i.e. compile flag, so kudos to you!) Another package that seems to be miscompiled with clang-15 is zsh, which simply hangs forever when executed afterwards. For the record, my system is fully built with libc++, but simply setting "CC=clang-14" and "CXX=clang-14" and rebuilding fixes both packages for me, even though they're being built against libc++-15. I am building with -O3 and besides that, no special CFLAGS. (In reply to Manuel Nickschas from comment #4) > I can confirm this (and was about to file a bug myself, although I didn't > find the time to identify the root cause, i.e. compile flag, so kudos to > you!) > > Another package that seems to be miscompiled with clang-15 is zsh, which > simply hangs forever when executed afterwards. > > For the record, my system is fully built with libc++, but simply setting > "CC=clang-14" and "CXX=clang-14" and rebuilding fixes both packages for me, > even though they're being built against libc++-15. I am building with -O3 > and besides that, no special CFLAGS. That'll be bug 869539. We're going to have a lot of these, there's configure tests misfiring: https://discourse.llvm.org/t/configure-script-breakage-with-the-new-werror-implicit-function-declaration/65213. (please report them all, I'm trying to find them, but it's not easy) *** Bug 869911 has been marked as a duplicate of this bug. *** The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0a8dffa398fcbd459916ca331da9cb713372616a commit 0a8dffa398fcbd459916ca331da9cb713372616a Author: Sam James <sam@gentoo.org> AuthorDate: 2022-09-12 20:28:33 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2022-09-12 20:28:33 +0000 net-misc/openssh: work around Clang 15 miscompilation with -fzero-call-used-regs=all Bug: https://github.com/llvm/llvm-project/issues/57692 Bug: https://bugs.gentoo.org/869839 Signed-off-by: Sam James <sam@gentoo.org> .../openssh/{openssh-9.0_p1-r3.ebuild => openssh-9.0_p1-r4.ebuild} | 4 ++++ 1 file changed, 4 insertions(+) CCing Daniel as he seems to have reported this upstream to OpenSSH as well. Interestingly, this bug seems to persist in some cases even with 15.0.6! See https://github.com/llvm/llvm-project/issues/59242. This is fixed upstream in https://github.com/llvm/llvm-project/commit/14d4cddc5506fb0fd3c4ac556b4edd970aa151eb. We've backported the fix in sys-devel/llvm-15.0.6-r1: ``` commit 691ee18503cb07d574461d81918ea02d4cb1f884 Author: Michał Górny <mgorny@gentoo.org> Date: Fri Jan 6 18:26:51 2023 +0100 sys-devel/llvm: Backport X86 CodeGen fix to 15.0.6-r1 Signed-off-by: Michał Górny <mgorny@gentoo.org> ``` It will also hopefully be included in 15.0.7 upstream. |