Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp638701imu; Mon, 5 Nov 2018 06:38:05 -0800 (PST) X-Google-Smtp-Source: AJdET5cXK923cMr6tJI1z8yI8qUnvNr+0olDalcsxjQ7t4J3eOoNUlIe5EGwj73LoCKfD0rzsjrG X-Received: by 2002:a62:fc52:: with SMTP id e79-v6mr6903948pfh.167.1541428685011; Mon, 05 Nov 2018 06:38:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541428684; cv=none; d=google.com; s=arc-20160816; b=dkJcclv6b6HqpSRvN06QkiNt9YWbQS9yHvAGZKErnL1W3eg2uCpPgTECq+G37ES41w vEZEXXiWXr2dGTifoYm0dbPnahTEmj1YP2Qrsn2llruWIqQmP+A1SPqSx1GQt0RJZIoA pQmeNtmctbWjaIGhe6CL6FpH402QJqZrAJEpckU4LGnMPb1Eoi81UHy+FmAR2tVC5mWC nv3xXqMtgebX5molbFaM7niLdD4RIsACjUkGgPafomOJdNJIeThcs2npvATcXCgJEzME GgXiwB8GDEI3n4XQ29GPod9esMiLT/K9LLz0HLrdlijVZO79W33cM4sh7gQ6GhOu3wgo FzZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date; bh=PlHgu6c+UloOqgcKSA1tB6RN0souqONpG4rWtV2ydbE=; b=Ytf726Ue3xJoSrSzaZcBJtcSpqNiMMqyY7H7FhNvutGiD5bLOtXE2ryeBL2JTy+n9h vGFklHzSoe6iYGtKEw5s5hyH7054XbURnRKr7Ugq8p6e2rRusVTiB1L3S+d3cs4L/33U SnrKpNP+A7V6ldR2bbeQ9UUoixZqj51Iumd11cjK1b7JBmTsIhDakUbbv6m+g619y0Ud oFCF4W1swpdxFYluPIb5Uj+N6kRpuDsdDKF6w3PVP/IG2b3eV7MKVwkY9KQJkLQw064q 4GyYFEJUYenFJLhg33+7fMttSpw+Wa6iOztVnemNAV1tQZ2pncXzMdKc75QFnBHwxvnK 3mkg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z4-v6si44474458pgj.39.2018.11.05.06.37.47; Mon, 05 Nov 2018 06:38:04 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730051AbeKEX5R (ORCPT + 99 others); Mon, 5 Nov 2018 18:57:17 -0500 Received: from terminus.zytor.com ([198.137.202.136]:60145 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726255AbeKEX5R (ORCPT ); Mon, 5 Nov 2018 18:57:17 -0500 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id wA5Earep368360 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 5 Nov 2018 06:36:53 -0800 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id wA5EarhN368357; Mon, 5 Nov 2018 06:36:53 -0800 Date: Mon, 5 Nov 2018 06:36:53 -0800 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Nathan Chancellor Message-ID: Cc: natechancellor@gmail.com, yamada.masahiro@socionext.com, hpa@zytor.com, tglx@linutronix.de, mingo@kernel.org, bp@alien8.de, ndesaulniers@google.com, keescook@chromium.org, namit@vmware.com, linux-kernel@vger.kernel.org Reply-To: yamada.masahiro@socionext.com, natechancellor@gmail.com, hpa@zytor.com, tglx@linutronix.de, bp@alien8.de, mingo@kernel.org, ndesaulniers@google.com, keescook@chromium.org, namit@vmware.com, linux-kernel@vger.kernel.org In-Reply-To: <20181023231125.27976-1-natechancellor@gmail.com> References: <20181023231125.27976-1-natechancellor@gmail.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/urgent] x86/build: Remove -pipe from KBUILD_CFLAGS Git-Commit-ID: f87419e1c9b5d38ea8a81b31e90aefa1be3fde5d X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=2.1 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_96_Q,FREEMAIL_FORGED_REPLYTO autolearn=no autolearn_force=no version=3.4.2 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: f87419e1c9b5d38ea8a81b31e90aefa1be3fde5d Gitweb: https://git.kernel.org/tip/f87419e1c9b5d38ea8a81b31e90aefa1be3fde5d Author: Nathan Chancellor AuthorDate: Tue, 23 Oct 2018 16:11:25 -0700 Committer: Thomas Gleixner CommitDate: Mon, 5 Nov 2018 15:32:40 +0100 x86/build: 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://github.com/llvm-mirror/clang/commit/c19a12dc3d441bec62eed55e312b76c12d6d9022 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://bugs.llvm.org/show_bug.cgi?id=39410) but this is not as much of a workaround anymore since it helps both GCC and Clang. Suggested-by: H. Peter Anvin Signed-off-by: Nathan Chancellor Signed-off-by: Thomas Gleixner Tested-by: Nick Desaulniers Reviewed-by: Nadav Amit Reviewed-by: Nick Desaulniers Cc: Borislav Petkov Cc: Kees Cook Cc: Masahiro Yamada Link: https://github.com/ClangBuiltLinux/linux/issues/213 Link: https://lkml.kernel.org/r/20181023231125.27976-1-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 5b562e464009..88398fdf8129 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)