Commit 37edfbc5 authored by David Gow's avatar David Gow Committed by Treehugger Robot
Browse files

UPSTREAM: um: Only disable SSE on clang to work around old GCC bugs

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: 88498186 ("rust: arch/um: Disable FP/SIMD instruction to match x86")
Reported-by: default avatarRoberto Sassu <roberto.sassu@huaweicloud.com>
Link: https://lore.kernel.org/linux-um/6df2ecef9011d85654a82acd607fdcbc93ad593c.camel@huaweicloud.com/


Tested-by: default avatarRoberto Sassu <roberto.sassu@huaweicloud.com>
Tested-by: default avatarSeongJae Park <sj@kernel.org>
Signed-off-by: default avatarDavid Gow <davidgow@google.com>
Reviewed-by: default avatarVincenzo Palazzo <vincenzopalazzodev@gmail.com>
Tested-by: default avatarArthur Grillo <arthurgrillo@riseup.net>
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>

Bug: 296671039
Change-Id: Ie71e5c59ca9fb6a480895af233fae9a15f5c5ddc
(cherry picked from commit a3046a61)
Signed-off-by: default avatarDongseok Yi <dseok.yi@samsung.com>
parent 2a13641a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment