Re: [PATCH RFC] x86: Don't include '-Wa,-' when building with Clang

From: H. Peter Anvin
Date: Tue Oct 23 2018 - 16:01:48 EST

On 10/23/18 11:40, Nick Desaulniers wrote:
> On Mon, Oct 22, 2018 at 10:11 PM Nadav Amit <namit@xxxxxxxxxx> wrote:
>> at 5:37 PM, Nathan Chancellor <natechancellor@xxxxxxxxx> wrote:
>> Commit 77b0bf55bc67 ("kbuild/Makefile: Prepare for using macros in
>> inline assembly code to work around asm() related GCC inlining bugs")
>> added this flag to KBUILD_CFLAGS, where it works perfectly fine with
>> GCC. However, when building with Clang, all of the object files compile
>> fine but the build hangs indefinitely at init/main.o, right before the
>> linking stage. Don't include this flag when building with Clang.
>> The kernel builds and boots to a shell in QEMU with both GCC and Clang
>> with this patch applied.
>> Link:;;sdata=shuxW81QRrO3TSqbgf462wgZYdLeAKeQEdGRxmnUX30%3D&amp;reserved=0
>> Signed-off-by: Nathan Chancellor <natechancellor@xxxxxxxxx>
>> ---
>> The reason this patch is labeled RFC is while I can verify that this
>> fixes the issue, I'm not entirely sure why the '-Wa,-' works for GCC
>> and not Clang. I looked into what the flag means and I couldn't really
>> find anything so I just assume it's taking input from stdin? The issue
>> could stem from how GCC forks gas versus how Clang does it. If this
>> isn't of concern and the maintainers are happy with this patch as is,
>> feel free to take it.

Perhaps someone could actually, you know, time the build and see how
much -pipe actually matters, if at all?