From patchwork Tue Jun 13 00:55:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Kaehlcke X-Patchwork-Id: 9782909 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DC58E60325 for ; Tue, 13 Jun 2017 00:56:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CFCEB283A6 for ; Tue, 13 Jun 2017 00:56:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C43942852C; Tue, 13 Jun 2017 00:56:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 79CD7283A6 for ; Tue, 13 Jun 2017 00:56:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753242AbdFMA4e (ORCPT ); Mon, 12 Jun 2017 20:56:34 -0400 Received: from mail-pf0-f170.google.com ([209.85.192.170]:35683 "EHLO mail-pf0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753209AbdFMA4C (ORCPT ); Mon, 12 Jun 2017 20:56:02 -0400 Received: by mail-pf0-f170.google.com with SMTP id l89so58874860pfi.2 for ; Mon, 12 Jun 2017 17:56:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=jcrGmAAmcbmA5vc9n/svo4XxwVOGYnW/I+5gA6aZe3Y=; b=UWxwZMyOqoLQU/PDzoGN25/6NzD4szQBb+Hh+NQqrEYPfxzyE2CpJhQdiLvemAM5ai dJ0wWiU/rFLQkzoN6D3zdAu8yqUmGBRHlcg8tzrbuXyPn7tMuDCSPSbQncD9BmJJUvVN d4wNhFcXzSy4po/0qlNkesL2xSDUBaBcw09eb5anPZdXouHhopavuJuYJrji9WNkJrvX UtkC+PCOAlU2v8/V7a4g3s1lmFUbYCtWDDWHWXNOFvhrsfGmcwZCqf2im//f3QKMdhmA 0IIdL5lKqsgTQG+EhM0ZdT3vvf+1O+NdiSGb1ibW+i4V0Q50f+OHurX+lImAwoqVKmNP owKA== X-Gm-Message-State: AODbwcAnIbpvN177GK1iInf2aBFfoaQDLsjxSYHMz68ZHmH5kFG0LrwN znvr8hPJZz3A7fMw X-Received: by 10.98.200.206 with SMTP id i75mr32120382pfk.163.1497315361174; Mon, 12 Jun 2017 17:56:01 -0700 (PDT) Received: from mka.mtv.corp.google.com ([172.22.64.162]) by smtp.gmail.com with ESMTPSA id g13sm20658432pgu.54.2017.06.12.17.55.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 12 Jun 2017 17:56:00 -0700 (PDT) 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-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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,\