Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp373580ybi; Fri, 7 Jun 2019 09:25:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqwEiJknIWKmKm18+nbooSbZjTH4QrdwCH7OJ/moz65nZN36YsW92Flf1LENLBFDrIUlt+gN X-Received: by 2002:a63:1723:: with SMTP id x35mr3569534pgl.233.1559924745151; Fri, 07 Jun 2019 09:25:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559924745; cv=none; d=google.com; s=arc-20160816; b=eO0TPqoD3D+nyRfiosowGy+YOP8+gPlpDUjvQirtd8fOJm9fvGSRN2l4pJfxhBkrLF YKnvc1t9rCo3eyBueVt8Gwmf0sckGKIu6YtggrSXVeNEtJk8zLhqz8wle6ccEhXiOpHV jKyPAAN+5AO+SNsbU6BmBF8MAZA+Y+A5qiGr16yhTqKx+Aq2JIF03OJTZ7Hmn1Shsz32 IX7L7tIef6lTZJwOexc9RKahM/zqCnrDelhSUIQWACrCvZfsO2Yn1Jghn1ZhPniMLGRZ iUoN5O4bTIrI0XkUJxayyEg7mA7zA37x4R/TTzTq4aGDevh7XlkjpN6Ia4KGPL7DS+co g9ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=WGqjBsnqc5icrIjGka2eRMuXy31bob95BhDrlvNRKXo=; b=J58SVoTl4O6rM9QYws2eRQcCyOjRTNIJYkLv7YW9SaNQMWw2C+kAtbem6fuNtDpOd+ kcPXgqF2cNrdyiBlSrLIcqy2ERjpj9O0UVpmoXXcoE6hvWeYyNOU2XNQKN9kQUtgluYN fyVEaVhgsumAcOUk1peDttq3nyBfx7p9dZlXKaph5pw6Nt1yp+89LzVvNTRvWBvoed5p 8ojvzi74+H9/4YVS7S45Lo1yhX8gFri9yRwNQApofISM3HKAs4DRfgqepdnX6lzADXd3 uewZCLKVjyOxIk1WQxSsRjjGN0OKA0eviSMn67ZSEUV1ZdI5aVe1Y0hT6R/NezhEV4KJ ZAAA== 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 f12si2362411pgr.419.2019.06.07.09.25.27; Fri, 07 Jun 2019 09:25:45 -0700 (PDT) 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 S1730280AbfFGQYF (ORCPT + 99 others); Fri, 7 Jun 2019 12:24:05 -0400 Received: from foss.arm.com ([217.140.110.172]:44006 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730066AbfFGQYE (ORCPT ); Fri, 7 Jun 2019 12:24:04 -0400 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 Cc: Catalin Marinas , Will Deacon , Nick Desaulniers , linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Qian Cai , linux-arm-kernel@lists.infradead.org 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190607161201.73430-1-natechancellor@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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