From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965274AbbBDLoF (ORCPT ); Wed, 4 Feb 2015 06:44:05 -0500 Received: from mailout4.w1.samsung.com ([210.118.77.14]:14202 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965027AbbBDLoA (ORCPT ); Wed, 4 Feb 2015 06:44:00 -0500 X-AuditID: cbfec7f5-b7fc86d0000066b7-40-54d2056be2e8 From: Andrey Ryabinin To: Andrew Morton , Stephen Rothwell Cc: linux-next@vger.kernel.org, linux-kernel@vger.kernel.org, Andrey Ryabinin Subject: [PATCH] kasan: fix build warnings Date: Wed, 04 Feb 2015 14:43:51 +0300 Message-id: <1423050231-1701-1-git-send-email-a.ryabinin@samsung.com> X-Mailer: git-send-email 2.2.2 In-reply-to: <20150204185328.1ee3ce3c@canb.auug.org.au> References: <20150204185328.1ee3ce3c@canb.auug.org.au> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrCJMWRmVeSWpSXmKPExsVy+t/xa7rZrJdCDK5dZbHY9usRm8Wc9WvY LC7vmsNmcXBhG6PF1r1X2R1YPRpv3GDzODHjN4tH35ZVjB6fN8kFsERx2aSk5mSWpRbp2yVw ZfR9ncdWsI+v4tmqY2wNjFN4uhg5OSQETCQeN7UyQ9hiEhfurWfrYuTiEBJYyigx/d9nJgin j0miafcLFpAqNgE9iX+ztrOB2CICERLnN4F0cHAwC2RITGupAQkLC2hJnJ34mBXEZhFQlVjf MwnM5hVwlTjU84kJpFxCQE7iwsd4EJNTwFxi0+Y0kAohATOJye33WCYw8i5gZFjFKJpamlxQ nJSea6RXnJhbXJqXrpecn7uJERIyX3cwLj1mdYhRgINRiYe3o/diiBBrYllxZe4hRgkOZiUR XiPGSyFCvCmJlVWpRfnxRaU5qcWHGJk4OKUaGBVvndKuDf4l5mubsLppbUiD/JNFs9tPLbR1 v/PW6trG7Ry2x16aNz/1885cGhnZtz7rd+esqbPeTS6IFEo6NScn8H1O0bktmxmuqe5ZpfHs ZtQk2Ua16jjf1tu7fjm479by2fSI77ydgFWicvyND8yqsw8na2rf2czq+erXvdqT+yVMel+n aymxFGckGmoxFxUnAgAxytL+9wEAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some versions of gcc produce warning instead of error when -fsanitize flag uses unsupported argument: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61065 This breaks our detection of whether -fsanitize=kernel-address is supported by compiler or not. Thus we have tons of build warnings like this: x86_64-linux-gcc: warning: unrecognized argument to -fsanitize= option: 'kernel-address' Passing -Werror into $(call cc-option) will fix this problem as gcc will error out now. Signed-off-by: Andrey Ryabinin Reported-by: Stephen Rothwell --- Hi Andrew, this patch applies on top kasan patch set. We can't just fix add-kernel-address-sanitizer-infrastructure.patch as patch kasan-enable-instrumentation-of-global-variables.patch depends on it. Let me know if your prefer to update all needed patches instead of this fix. scripts/Makefile.kasan | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/Makefile.kasan b/scripts/Makefile.kasan index df302f8..72a40bb 100644 --- a/scripts/Makefile.kasan +++ b/scripts/Makefile.kasan @@ -5,15 +5,14 @@ else call_threshold := 0 endif -CFLAGS_KASAN_MINIMAL := $(call cc-option, -fsanitize=kernel-address \ - --param asan-globals=1) +CFLAGS_KASAN_MINIMAL := -fsanitize=kernel-address --param asan-globals=1 CFLAGS_KASAN := $(call cc-option, -fsanitize=kernel-address \ -fasan-shadow-offset=$(CONFIG_KASAN_SHADOW_OFFSET) \ --param asan-stack=1 --param asan-globals=1 \ --param asan-instrumentation-with-call-threshold=$(call_threshold)) -ifeq ($(CFLAGS_KASAN_MINIMAL),) +ifeq ($(call cc-option, $(CFLAGS_KASAN_MINIMAL) -Werror),) $(warning Cannot use CONFIG_KASAN: \ -fsanitize=kernel-address is not supported by compiler) else -- 2.2.2