Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753305AbdFMA4I (ORCPT ); Mon, 12 Jun 2017 20:56:08 -0400 Received: from mail-pf0-f174.google.com ([209.85.192.174]:36144 "EHLO mail-pf0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753218AbdFMA4C (ORCPT ); Mon, 12 Jun 2017 20:56:02 -0400 From: Matthias Kaehlcke To: Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , "H . J . Lu" , David Woodhouse , Masahiro Yamada , Michal Marek Cc: x86@kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Davidson , Greg Hackmann , Nick Desaulniers , Stephen Hines , Kees Cook , Arnd Bergmann , Bernhard.Rosenkranzer@linaro.org, Peter Foley , Behan Webster , Douglas Anderson , Matthias Kaehlcke Subject: [PATCH 1/3] kbuild: Add cc-option-no-kbuild macro Date: Mon, 12 Jun 2017 17:55:29 -0700 Message-Id: <20170613005531.77656-2-mka@chromium.org> X-Mailer: git-send-email 2.13.1.508.gb3defc5cc-goog In-Reply-To: <20170613005531.77656-1-mka@chromium.org> References: <20170613005531.77656-1-mka@chromium.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1323 Lines: 32 cc-option uses KBUILD_CFLAGS and KBUILD_CPPFLAGS when it determines whether an option is supported or not. This is fine for options used to build the kernel itself, however some components like the x86 boot code use a different set of flags. Add the new macro cc-option-no-kbuild which does the same as cc-option except that it has an additional parameter with the compiler options which are used instead of KBUILD_CFLAGS and KBUILD_CPPFLAGS. Signed-off-by: Matthias Kaehlcke --- scripts/Kbuild.include | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index 61f87a99bf0a..d9fdc740105f 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -128,6 +128,11 @@ cc-option-yn = $(call try-run,\ cc-option-align = $(subst -functions=0,,\ $(call cc-option,-falign-functions=0,-malign-functions=0)) +# cc-option-no-kbuild +# Usage: cflags-no-kbuild-y += $(call cc-option-no-kbuild,,-march=winchip-c6,-march=i586) +cc-option-no-kbuild = $(call try-run,\ + $(CC) -Werror $(filter-out $(GCC_PLUGINS_CFLAGS),$(1)) $(2) -c -x c /dev/null -o "$$TMP",$(2),$(3)) + # cc-disable-warning # Usage: cflags-y += $(call cc-disable-warning,unused-but-set-variable) cc-disable-warning = $(call try-run,\ -- 2.13.1.508.gb3defc5cc-goog