From: Roberto Sassu <roberto.sassu@huaweicloud.com>
To: David Gow <davidgow@google.com>
Cc: linux-um@lists.infradead.org, Richard Weinberger <richard@nod.at>,
Anton Ivanov <anton.ivanov@cambridgegreys.com>,
Johannes Berg <johannes@sipsolutions.net>
Subject: Re: Cannot compile UML in Ubuntu 20.04.5 anymore
Date: Mon, 06 Mar 2023 18:05:42 +0100 [thread overview]
Message-ID: <1512772f4938c86d886540fb6ac394f444cc4a9f.camel@huaweicloud.com> (raw)
In-Reply-To: <CABVgOSm1t3_mcUUu0A8eG-zAA4q0d-dmi6Ceb3TFtoUt1i3gTQ@mail.gmail.com>
On Sat, 2023-03-04 at 12:35 +0800, David Gow wrote:
> On Fri, 3 Mar 2023 at 16:37, Roberto Sassu
> <roberto.sassu@huaweicloud.com> wrote:
> > Hi
> >
> > it looks like one recent commit causes the kernel build to break.
> >
> > GEN scripts/gdb/linux/constants.py
> > In file included from /usr/include/stdlib.h:1013,
> > from arch/um/os-Linux/helper.c:6:
> > /usr/include/x86_64-linux-gnu/bits/stdlib-float.h: In function ‘atof’:
> > /usr/include/x86_64-linux-gnu/bits/stdlib-float.h:26:1: error: SSE register return with SSE disabled
> > 26 | {
> > | ^
> > CC init/noinitramfs.o
> >
> > It works again by reverting commit 884981867947 ("rust: arch/um:
> > Disable FP/SIMD instruction to match x86").
> >
> > $ cat /proc/cpuinfo
> >
> > [...]
> >
> > processor : 31
> > vendor_id : AuthenticAMD
> > cpu family : 23
> > model : 49
> > model name : AMD Ryzen Threadripper PRO 3955WX 16-Cores
> >
> > Thanks
> >
> > Roberto
> >
>
> Yup, this is definitely caused by 884981867947 ("rust: arch/um:
> Disable FP/SIMD instruction to match x86").
>
> It looks like GCC fixed this upstream in GCC 11:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99652
>
> Equally though, not having this change breaks older versions of LLVM,
> so I think it's best to not totally revert it.
>
> Something like this should work:
> ---
> diff --git a/arch/x86/Makefile.um b/arch/x86/Makefile.um
> index d2e95d1d4db7..1aa64846e539 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
> ---
>
> Though the more correct solution would be to just check
> gcc-min-version || clang. That probably requires a bit more
> makefile-fu to do cleanly, though.
Thanks, works for me.
Roberto
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
next prev parent reply other threads:[~2023-03-06 17:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-03 8:34 Cannot compile UML in Ubuntu 20.04.5 anymore Roberto Sassu
2023-03-04 4:35 ` David Gow
2023-03-06 17:05 ` Roberto Sassu [this message]
2023-03-17 16:58 ` SeongJae Park
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1512772f4938c86d886540fb6ac394f444cc4a9f.camel@huaweicloud.com \
--to=roberto.sassu@huaweicloud.com \
--cc=anton.ivanov@cambridgegreys.com \
--cc=davidgow@google.com \
--cc=johannes@sipsolutions.net \
--cc=linux-um@lists.infradead.org \
--cc=richard@nod.at \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).