]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
um: Only disable SSE on clang to work around old GCC bugs
authorDavid Gow <davidgow@google.com>
Sat, 18 Mar 2023 04:15:54 +0000 (12:15 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 30 Apr 2023 23:29:22 +0000 (08:29 +0900)
commit4b09ccd27b935a5cc266d5735a43e1367157c2db
treedc8ee3915944bef10cc61a0cfb89ade8ed37a64c
parent3d707c0ed95aa94a057bcdc47bade3c1ff8498d9
um: Only disable SSE on clang to work around old GCC bugs

commit a3046a618a284579d1189af8711765f553eed707 upstream.

As part of the Rust support for UML, we disable SSE (and similar flags)
to match the normal x86 builds. This both makes sense (we ideally want a
similar configuration to x86), and works around a crash bug with SSE
generation under Rust with LLVM.

However, this breaks compiling stdlib.h under gcc < 11, as the x86_64
ABI requires floating-point return values be stored in an SSE register.
gcc 11 fixes this by only doing register allocation when a function is
actually used, and since we never use atof(), it shouldn't be a problem:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99652

Nevertheless, only disable SSE on clang setups, as that's a simple way
of working around everyone's bugs.

Fixes: 884981867947 ("rust: arch/um: Disable FP/SIMD instruction to match x86")
Reported-by: Roberto Sassu <roberto.sassu@huaweicloud.com>
Link: https://lore.kernel.org/linux-um/6df2ecef9011d85654a82acd607fdcbc93ad593c.camel@huaweicloud.com/
Tested-by: Roberto Sassu <roberto.sassu@huaweicloud.com>
Tested-by: SeongJae Park <sj@kernel.org>
Signed-off-by: David Gow <davidgow@google.com>
Reviewed-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
Tested-by: Arthur Grillo <arthurgrillo@riseup.net>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/Makefile.um