On 18/03/23 01:15, 'David Gow' via KUnit Development wrote: > 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.sa...@huaweicloud.com> > Link: > https://lore.kernel.org/linux-um/6df2ecef9011d85654a82acd607fdcbc93ad593c.ca...@huaweicloud.com/ > Tested-by: Roberto Sassu <roberto.sa...@huaweicloud.com> > Tested-by: SeongJae Park <s...@kernel.org> > Signed-off-by: David Gow <david...@google.com> > --- > arch/x86/Makefile.um | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/arch/x86/Makefile.um b/arch/x86/Makefile.um > index b70559b821df..2106a2bd152b 100644 > --- a/arch/x86/Makefile.um > +++ b/arch/x86/Makefile.um > @@ -3,9 +3,14 @@ core-y += arch/x86/crypto/ > > # > # Disable SSE and other FP/SIMD instructions to match normal x86 > +# This is required to work around issues in older LLVM versions, but breaks > +# GCC versions < 11. See: > +# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99652 > # > +ifeq ($(CONFIG_CC_IS_CLANG),y) > KBUILD_CFLAGS += -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx > KBUILD_RUSTFLAGS += > -Ctarget-feature=-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-avx,-avx2 > +endif > > ifeq ($(CONFIG_X86_32),y) > START := 0x8048000 Tested-by: Arthur Grillo <arthurgri...@riseup.net> _______________________________________________ linux-um mailing list linux-um@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-um
Re: [PATCH] arch:um: Only disable SSE on clang to work around old GCC bugs
Arthur Grillo Queiroz Cabral Tue, 21 Mar 2023 13:12:26 -0700
- [PATCH] arch:um: Only disable SSE on clang to... David Gow
- Re: [PATCH] arch:um: Only disable SSE on... Vincenzo Palazzo
- Re: [PATCH] arch:um: Only disable SSE on... Arthur Grillo Queiroz Cabral
- Re: [PATCH] arch:um: Only disable SSE on... David Gow
- Re: [PATCH] arch:um: Only disable SS... Richard Weinberger
- Re: [PATCH] arch:um: Only disabl... Richard Weinberger
- Re: [PATCH] arch:um: Only disable SSE on... Miguel Ojeda