Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5645209imu; Mon, 26 Nov 2018 03:27:48 -0800 (PST) X-Google-Smtp-Source: AFSGD/VbLHgfAsSsDRCa3GHkwuwX+1qwe1NNuaYCCP7qhYaQ4arqo7QhcSWrPMk64vF+C5CVm2+H X-Received: by 2002:a17:902:280b:: with SMTP id e11mr27270154plb.269.1543231668610; Mon, 26 Nov 2018 03:27:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543231668; cv=none; d=google.com; s=arc-20160816; b=Z0hVVhzLTpFQEC5KKxDtb9mIzGRYx0Nj1WEKS90OSeuZwCQ6ML4uFMSTdPAyyOoqp6 ZXbFJPU9ro2evC5dPedEz1xfH6LVEIUITorRo7nu9v7OGzoJv3rVS2Q2RO+VgHHvBdW9 wBtRlDoUtLCyVwiAu1XOvKpFa4jhCR35z1yssJqDwo53ZDzoHmgnWk715r2MQjm56M+L t8NfqkDKDZ0h9KcvWFc9KBTOHmQueSsi3Z7qyqXHrRaVx1L2FcG0VbtMotetYCIuTbjX PJ5pQDA5+8jGaKZ8zaeAUnLEJm9WFwG4KeW7gl/kIAWwC1s+CDZOGBpEZh6bTEi7U7mq kQXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=rKXDkjKYs1o6hNBdUk+u1m6awFfgdDXmnsC+xElxJkc=; b=dtYMq0EKg9W9rFoARFMi6E3unq4jkPT2pT1jmx7gutulCoXsuirZql6alb7J/jDftO /5DGd9mkpHaKMwmYCw5hPzb2H8MGX51/6KEEsRiTNkscbSNmgNwsF/dr7WWFVPlCx4K4 lX3T459HJfE69BN67msRqG7dR7eOy2qMtVhWcSw+GHyCqPQdpHkIqt6sGFT3V3ckpojr He0Wb0LkSs7luGhSIxpto88QWGetNOWjyH96SV30tb8AQWwJeR4TwIUpMH22FeVXKAxo +AsCAkg8kC8h9BJwzv16WXrWQgbrUzOlWPHuwDIBzXzBZFlPeec+Sgjm08gE6aMz3FGk FWdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QrMpPjZ6; 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 26si15954pgu.190.2018.11.26.03.27.25; Mon, 26 Nov 2018 03:27:48 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=QrMpPjZ6; 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 S1726656AbeKZVs3 (ORCPT + 99 others); Mon, 26 Nov 2018 16:48:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:57010 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726475AbeKZVs2 (ORCPT ); Mon, 26 Nov 2018 16:48:28 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 963412089F; Mon, 26 Nov 2018 10:54:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543229684; bh=kLTwNFLZ3Vvb47hJdaUo11wwl7ME+guwx/v7ZqxXwkQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QrMpPjZ69O44YBSCRDgj6LQ3xrMFBublHKdPg7rLOPZydlNRC1L96jN5zx4rFOXjb w1u1VwmyBSkYCtTGQl4XtJoQAwuE3ghF1HKN4goUyfEgrFLCRwN/l/mxGUaPFsBN0+ 28a5sg6dPmUz7pLm3fzottOy3FzB1B8TxvCjtXms= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Masahiro Yamada , Matthias Kaehlcke , Michal Marek , Nathan Chancellor Subject: [PATCH 4.4 32/70] kbuild: Add __cc-option macro Date: Mon, 26 Nov 2018 11:50:47 +0100 Message-Id: <20181126105049.873076377@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181126105046.722096341@linuxfoundation.org> References: <20181126105046.722096341@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Matthias Kaehlcke commit 9f3f1fd299768782465cb32cdf0dd4528d11f26b upstream. 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 which is a more generic version of cc-option with additional parameters. One parameter is the compiler with which the check should be performed, the other the compiler options to be used instead KBUILD_C*FLAGS. Refactor cc-option and hostcc-option to use __cc-option and move hostcc-option to scripts/Kbuild.include. Suggested-by: Arnd Bergmann Suggested-by: Masahiro Yamada Signed-off-by: Matthias Kaehlcke Acked-by: Arnd Bergmann Acked-by: Michal Marek Signed-off-by: Masahiro Yamada [nc: Fix conflicts due to lack of CC_OPTION_CFLAGS and hostcc-option wasn't added until v4.8 so no point including it in this tree] Signed-off-by: Nathan Chancellor Signed-off-by: Greg Kroah-Hartman --- Makefile | 2 +- scripts/Kbuild.include | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) --- a/Makefile +++ b/Makefile @@ -303,7 +303,7 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" HOSTCC = gcc HOSTCXX = g++ -HOSTCFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89 +HOSTCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89 HOSTCXXFLAGS = -O2 # Decide whether to build built-in, modular, or both. --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -108,11 +108,16 @@ as-option = $(call try-run,\ as-instr = $(call try-run,\ printf "%b\n" "$(1)" | $(CC) $(KBUILD_AFLAGS) -c -x assembler -o "$$TMP" -,$(2),$(3)) +# __cc-option +# Usage: MY_CFLAGS += $(call __cc-option,$(CC),$(MY_CFLAGS),-march=winchip-c6,-march=i586) +__cc-option = $(call try-run,\ + $(1) -Werror $(2) $(3) -c -x c /dev/null -o "$$TMP",$(3),$(4)) + # cc-option # Usage: cflags-y += $(call cc-option,-march=winchip-c6,-march=i586) -cc-option = $(call try-run,\ - $(CC) -Werror $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",$(1),$(2)) +cc-option = $(call __cc-option, $(CC),\ + $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS),$(1),$(2)) # cc-option-yn # Usage: flag := $(call cc-option-yn,-march=winchip-c6)