From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.5 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,T_DKIMWL_WL_HIGH, URIBL_BLOCKED,USER_AGENT_MUTT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D358EC468BD for ; Fri, 7 Jun 2019 16:24:13 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AC36320840 for ; Fri, 7 Jun 2019 16:24:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="F6eVrnUf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AC36320840 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=lkDRFJB5OBIB19uw1VxVoe6Zx63zSs1k97kwuwJoPW8=; b=F6eVrnUfsSA9Da 12IyAUMK45Sw/lTuBTFqkJy21Vn/7eRy7cx+5pkJFn2ioAbx5579FHIwXaG6DcqdnpkN9LprFUyOE XTFcq/rN5VlFOGAR36ro3UesYh4HXz7KN4W0Bn5qbVo4RblS+z2sucRN7RRBzsAzo/Y6W8h7SKKV6 XMII5aygr76B5ZsR7vAZmCuf93tYH3d20OLl0M5UzD16utftw3dQtBgTJkcks4TbNgix9T3jwpK6d +zQDtxerA8EYkOqii5GafAb1hvqXhaT16pocfF1NPg3KieUeIpSxslXUdYBex7YakgpqSIxqxiz/m bEPwTFJDkoi3sCxU9ehg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hZHex-0006rf-LP; Fri, 07 Jun 2019 16:24:07 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hZHeu-0006rH-SY for linux-arm-kernel@lists.infradead.org; Fri, 07 Jun 2019 16:24:06 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EE2F02B; Fri, 7 Jun 2019 09:24:03 -0700 (PDT) Received: from e103592.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CFE553F71A; Fri, 7 Jun 2019 09:24:02 -0700 (PDT) Date: Fri, 7 Jun 2019 17:24:00 +0100 From: Dave Martin To: Nathan Chancellor Subject: Re: [PATCH] arm64: Don't unconditionally add -Wno-psabi to KBUILD_CFLAGS Message-ID: <20190607162400.GI28398@e103592.cambridge.arm.com> References: <20190607161201.73430-1-natechancellor@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190607161201.73430-1-natechancellor@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190607_092404_971358_535D38BB X-CRM114-Status: GOOD ( 20.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Catalin Marinas , Nick Desaulniers , linux-kernel@vger.kernel.org, Will Deacon , clang-built-linux@googlegroups.com, Qian Cai , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Jun 07, 2019 at 09:12:01AM -0700, Nathan Chancellor wrote: > This is a GCC only option, which warns about ABI changes within GCC, so > unconditionally adding breaks Clang with tons of: > > warning: unknown warning option '-Wno-psabi' [-Wunknown-warning-option] > > and link time failures: > > ld.lld: error: undefined symbol: __efistub___stack_chk_guard > >>> referenced by arm-stub.c:73 > (/home/nathan/cbl/linux/drivers/firmware/efi/libstub/arm-stub.c:73) > >>> arm-stub.stub.o:(__efistub_install_memreserve_table) > in archive ./drivers/firmware/efi/libstub/lib.a > > I suspect the link time failure comes from some flags not being added > via cc-option, which will always fail when an unknown flag is > unconditionally added to KBUILD_CFLAGS because -Werror is added after > commit c3f0d0bc5b01 ("kbuild, LLVMLinux: Add -Werror to cc-option to > support clang"). > > $ echo "int main() { return 0; }" | clang -Wno-psabi -o /dev/null -x c - > warning: unknown warning option '-Wno-psabi' [-Wunknown-warning-option] > 1 warning generated. > > $ echo $? > 0 > > $ echo "int main() { return 0; }" | clang -Werror -Wno-psabi -o /dev/null -x c - > error: unknown warning option '-Wno-psabi' [-Werror,-Wunknown-warning-option] > > $ echo $? > 1 > > This side effect is user visible (aside from the inordinate amount of > -Wunknown-warning-option and build failure), as some warnings that are > normally disabled like -Waddress-of-packed-member or > -Wunused-const-variable show up. > > Use cc-disable-warning so that it gets disabled for GCC and does nothing > for Clang. > > Fixes: ebcc5928c5d9 ("arm64: Silence gcc warnings about arch ABI drift") > Link: https://github.com/ClangBuiltLinux/linux/issues/511 > Reported-by: Qian Cai > Signed-off-by: Nathan Chancellor FWIW, Acked-by: Dave Martin Cheers ---Dave > --- > arch/arm64/Makefile | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile > index 8fbd583b18e1..e9d2e578cbe6 100644 > --- a/arch/arm64/Makefile > +++ b/arch/arm64/Makefile > @@ -51,7 +51,7 @@ endif > > KBUILD_CFLAGS += -mgeneral-regs-only $(lseinstr) $(brokengasinst) > KBUILD_CFLAGS += -fno-asynchronous-unwind-tables > -KBUILD_CFLAGS += -Wno-psabi > +KBUILD_CFLAGS += $(call cc-disable-warning, psabi) > KBUILD_AFLAGS += $(lseinstr) $(brokengasinst) > > KBUILD_CFLAGS += $(call cc-option,-mabi=lp64) > -- > 2.22.0.rc3 > > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel