From: Nadav Amit <namit@vmware.com>
To: Nathan Chancellor <natechancellor@gmail.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>, X86 ML <x86@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Kees Cook <keescook@chromium.org>,
Masahiro Yamada <yamada.masahiro@socionext.com>,
Nick Desaulniers <ndesaulniers@google.com>
Subject: Re: [PATCH] x86: Remove -pipe from KBUILD_CFLAGS
Date: Tue, 23 Oct 2018 23:22:48 +0000 [thread overview]
Message-ID: <E44AA2AF-D0B6-4501-B123-901A704989FE@vmware.com> (raw)
In-Reply-To: <20181023231125.27976-1-natechancellor@gmail.com>
From: Nathan Chancellor <natechancellor@gmail.com>
Sent: October 23, 2018 at 11:11:25 PM GMT
> To: Thomas Gleixner; Ingo Molnar; Borislav Petkov
> Cc: H. Peter Anvin; x86@kernel.org, linux-kernel@vger.kernel.org, Nadav Amit; Kees Cook; Masahiro Yamada; Nick Desaulniers; Nathan Chancellor
> Subject: [PATCH] x86: Remove -pipe from KBUILD_CFLAGS
>
>
> Commit 77b0bf55bc67 ("kbuild/Makefile: Prepare for using macros in
> inline assembly code to work around asm() related GCC inlining bugs")
> added -Wa,- to KBUILD_CFLAGS, which breaks compiling with Clang (hangs
> indefinitely at compiling init/main.o). This happens because while Clang
> accepts -pipe (and has it documented in its list of supported flags), it
> silently ignores it after this 2010 commit (thanks to Nick Desaulniers
> for tracking this down), meaning that gas just infinitely waits for
> stdin and never receives it.
>
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fllvm-mirror%2Fclang%2Fcommit%2Fc19a12dc3d441bec62eed55e312b76c12d6d9022&data=02%7C01%7Cnamit%40vmware.com%7C56678e0018894955601908d6393ce6d2%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C1%7C0%7C636759331072072215&sdata=AjoP%2BerS26K58QQINE0UDJ00ftyGMa5ovlaKvZViZ4w%3D&reserved=0
>
> Initially, I had suggested just add -Wa,- to KBUILD_CFLAGS when GCC was
> being used but that was before realizing it is because Clang doesn't do
> anything with -pipe. H. Peter Anvin suggested checking to see if -pipe
> gives us any gains out of GCC. Turns out it might actually be hurting:
>
> With -pipe:
>
> real 3m40.813s
> real 3m44.449s
> real 3m39.648s
>
> Without -pipe:
>
> real 3m38.492s
> real 3m38.335s
> real 3m38.975s
>
> The issue of -Wa,- being passed along to gas without -pipe being
> supported should still probably be fixed on the LLVM side (open issue:
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugs.llvm.org%2Fshow_bug.cgi%3Fid%3D39410&data=02%7C01%7Cnamit%40vmware.com%7C56678e0018894955601908d6393ce6d2%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C1%7C0%7C636759331072082215&sdata=MlOeR1p8%2BRROFxhjw3SQi0Uai9zuUeEesBxSMaM8wsg%3D&reserved=0) but this is not as much of
> a workaround anymore since it helps both GCC and Clang.
>
> Link: https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FClangBuiltLinux%2Flinux%2Fissues%2F213&data=02%7C01%7Cnamit%40vmware.com%7C56678e0018894955601908d6393ce6d2%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C1%7C0%7C636759331072082215&sdata=q9iCdYa80V49o0BnZqFf3WYcMwRMl%2BtuS1MN8RZCPFI%3D&reserved=0
> Suggested-by: H. Peter Anvin <hpa@zytor.com>
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
> ---
> arch/x86/Makefile | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/arch/x86/Makefile b/arch/x86/Makefile
> index 73f4831283ac..672c689c1faa 100644
> --- a/arch/x86/Makefile
> +++ b/arch/x86/Makefile
> @@ -213,8 +213,6 @@ ifdef CONFIG_X86_64
> KBUILD_LDFLAGS += $(call ld-option, -z max-page-size=0x200000)
> endif
>
> -# Speed up the build
> -KBUILD_CFLAGS += -pipe
> # Workaround for a gcc prelease that unfortunately was shipped in a suse release
> KBUILD_CFLAGS += -Wno-sign-compare
> #
> @@ -239,7 +237,7 @@ archheaders:
> archmacros:
> $(Q)$(MAKE) $(build)=arch/x86/kernel arch/x86/kernel/macros.s
>
> -ASM_MACRO_FLAGS = -Wa,arch/x86/kernel/macros.s -Wa,-
> +ASM_MACRO_FLAGS = -Wa,arch/x86/kernel/macros.s
> export ASM_MACRO_FLAGS
> KBUILD_CFLAGS += $(ASM_MACRO_FLAGS)
>
> --
> 2.19.1
This pipe was a pain in the … I have actually already removed it in one
version of the versions of my patch-set.
Reviewed-by: Nadav Amit <namit@vmware.com>
next prev parent reply other threads:[~2018-10-23 23:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-23 23:11 Nathan Chancellor
2018-10-23 23:22 ` Nadav Amit [this message]
2018-10-23 23:23 ` Nick Desaulniers
2018-11-05 14:36 ` [tip:x86/urgent] x86/build: " tip-bot for Nathan Chancellor
2018-11-05 15:49 ` tip-bot for Nathan Chancellor
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=E44AA2AF-D0B6-4501-B123-901A704989FE@vmware.com \
--to=namit@vmware.com \
--cc=bp@alien8.de \
--cc=hpa@zytor.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=natechancellor@gmail.com \
--cc=ndesaulniers@google.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
--cc=yamada.masahiro@socionext.com \
/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
all inboxes | Powered by JetHome®