Re: [PATCH 2/2] x86, boot: Use regparm=0 for memcpy and memset when using clang

From: Michael Davidson
Date: Thu Mar 16 2017 - 11:23:18 EST


On Thu, Mar 16, 2017 at 12:46 AM, Ingo Molnar <mingo@xxxxxxxxxx> wrote:
>
> I don't think we want to add such ugly workarounds for clang bugs in a piecemail
> wise manner. If this was the _only_ workaround required to have a working kernel
> built with clang then maybe, but there's no way to tell from this submission.
>
Apologies for the lack of context. This change, and the #undef of mem*
in x86/boot/string.c
are actually the only patches that are absolutely needed to get an
x86_64 kernel to
build and boot successfully with clang provided that you also arrange
for clang
be invoked with the -no-integrated-as option. In practice it is also
necessary to disable
a few more clang warnings to make the build tolerable.

I will send out a more complete set of patches later today which deal
with those other
issues.

As far as the specific issue of this particular clang bug is concerned
I did also consider
adding a configuration option to simply not build the real mode boot
code at all but
that looked like it would require much more extensive surgery.