From patchwork Tue Mar 27 05:29:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 132456 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp4656250ljb; Mon, 26 Mar 2018 22:36:20 -0700 (PDT) X-Google-Smtp-Source: AG47ELsy1PcncIoYJ2fvbDbmd2dagALeHCUzVBbhVace/w2WiMr3Edoaw7Tu5KVWRBjyQP3mQsyX X-Received: by 10.98.138.154 with SMTP id o26mr11762738pfk.82.1522128979996; Mon, 26 Mar 2018 22:36:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522128979; cv=none; d=google.com; s=arc-20160816; b=aPck+SD+SyVuX/BMJZApvIGS7xP/xZWmVAQ00dS3eTR1OaDpAWwGp/54Hfhxo887oj 3DJFHhNqRfNpFP+OxDmABxbiW2VbikPWKlPmxwE+ktHVhXLuaaDCcVY46LyEanHe1tFL Y0Tzwqfx5ruZF7fwbNXq00vnk8ORknIyYUSpbNCmY7eB1ieisKCShab+TQaoxzohkScc V06fB+Cgzdz4esTjVMH07F9rqONx6Y/lb+bZUzFG4bqyLAOearv9Apt5zqeDDSXWyPf+ KiXLjBF1UhJhWx7b6rh/kr7dN/AOusGhoVqvp91HvQmE6Tdk/tTzY/ivlyetZa1UqI8k G5FQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=+KtcYTB0i2G/+6IMyIjcZZUASKlIoX6zrXACCTEjvdQ=; b=oU45YSkHm28XjPS/P/HLAtiCITe9eW7PBfISgdi6D8WFmylQ9c6J3VFxRbQyF/7k7Q 5MxmD4rm/wtSKvPOFbDlWLVpYinh2ypV/44aPRs9Sd2YbULS8TP9+n8i3KAjFERx2QeK I/Z6QTkHlpRlyrmKphi5uZ8IruABB1HSD3lrGsWRpx6Ed75ZMRmgh8v5dNiXtJczc7pJ xDbwIxhiVPvSOV7QMb+EZDlAZAfIMHeQ3U+LQcy33wrjtPRL6LUFFXdRb1Tn2CPb53Pe iOFVRw6fJelVbRTc17cDszDKgQ080oNUgZS/w69pLTfFu7FvIoKsEWci6phca+uYYYWH BSQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=qdNilvxk; 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 i1si350626pgc.229.2018.03.26.22.36.18; Mon, 26 Mar 2018 22:36:19 -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; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=qdNilvxk; 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 S1752308AbeC0Fft (ORCPT + 28 others); Tue, 27 Mar 2018 01:35:49 -0400 Received: from conuserg-09.nifty.com ([210.131.2.76]:44672 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751903AbeC0FcB (ORCPT ); Tue, 27 Mar 2018 01:32:01 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-09.nifty.com with ESMTP id w2R5TaM0011947; Tue, 27 Mar 2018 14:29:56 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com w2R5TaM0011947 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1522128597; bh=+KtcYTB0i2G/+6IMyIjcZZUASKlIoX6zrXACCTEjvdQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qdNilvxkL4W+hYn8vdM0wzWm4XKD1/Mk+AxPY0QFtmhhO39579JuGWB0Iz3uE91cd Q4LJR8/pHhxifju11Hg9foaAH2cJP7HnAJkXJSg9p9/vKFuXTKduTCd/raJuneO2+G 4tV20Af3wmNHqrJeiUmo+dNJH4Y+ePrbj/H0mimXQfl70OIA0zQQ/lMX1ELUchZ3eH gymLPEQJ/mxh++gjlOBFHriFlb/mU++R4gU6CXAXG2zmDur023XiMxnaTkfXri5cZo EWxSBLUbXhp+ajVTYIuJwduRUXhbTO64cuFo5phNmp2ualJu+LeXo3OYsFkWMZd7xz h6pHhM+C3TUXg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Sam Ravnborg , Linus Torvalds , Arnd Bergmann , Ulf Magnusson , Kees Cook , Thomas Gleixner , Greg Kroah-Hartman , Randy Dunlap , "Luis R . Rodriguez" , Nicolas Pitre , Masahiro Yamada , Peter Oberparleiter , linux-kernel@vger.kernel.org Subject: [PATCH v2 15/21] gcov: remove CONFIG_GCOV_FORMAT_AUTODETECT Date: Tue, 27 Mar 2018 14:29:29 +0900 Message-Id: <1522128575-5326-16-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1522128575-5326-1-git-send-email-yamada.masahiro@socionext.com> References: <1522128575-5326-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org CONFIG_GCOV_FORMAT_AUTODETECT compiles either gcc_3_4.c or gcc_4_7.c according to your GCC version. We can achieve the equivalent behavior by setting reasonable dependency with the knowledge of the compiler version. If GCC older than 4.7 is used, GCOV_FORMAT_3_4 is the default, but users are still allowed to select GCOV_FORMAT_4_7 in case the newer format is back-ported. On the other hand, If GCC 4.7 or newer is used, there is no reason to use GCOV_FORMAT_3_4, so it should be hidden. If you down-grade your compiler GCC 4.7 or older, oldconfig/syncconfig will display a prompt for the choice because GCOV_FORMAT_3_4 becomes visible as a new symbol. Signed-off-by: Masahiro Yamada --- Changes in v2: - Move the 'depends on' to the choice value. kernel/gcov/Kconfig | 17 +++++------------ kernel/gcov/Makefile | 2 -- 2 files changed, 5 insertions(+), 14 deletions(-) -- 2.7.4 Acked-by: Peter Oberparleiter Reviewed-by: Kees Cook diff --git a/kernel/gcov/Kconfig b/kernel/gcov/Kconfig index 1276aab..1e3823f 100644 --- a/kernel/gcov/Kconfig +++ b/kernel/gcov/Kconfig @@ -53,23 +53,16 @@ config GCOV_PROFILE_ALL choice prompt "Specify GCOV format" depends on GCOV_KERNEL - default GCOV_FORMAT_AUTODETECT ---help--- - The gcov format is usually determined by the GCC version, but there are + The gcov format is usually determined by the GCC version, and the + default is chosen according to your GCC version. However, there are exceptions where format changes are integrated in lower-version GCCs. - In such a case use this option to adjust the format used in the kernel - accordingly. - - If unsure, choose "Autodetect". - -config GCOV_FORMAT_AUTODETECT - bool "Autodetect" - ---help--- - Select this option to use the format that corresponds to your GCC - version. + In such a case, change this option to adjust the format used in the + kernel accordingly. config GCOV_FORMAT_3_4 bool "GCC 3.4 format" + depends on CC_IS_GCC && GCC_VERSION < 40700 ---help--- Select this option to use the format defined by GCC 3.4. diff --git a/kernel/gcov/Makefile b/kernel/gcov/Makefile index c6c50e5..ff06d64 100644 --- a/kernel/gcov/Makefile +++ b/kernel/gcov/Makefile @@ -4,5 +4,3 @@ ccflags-y := -DSRCTREE='"$(srctree)"' -DOBJTREE='"$(objtree)"' obj-y := base.o fs.o obj-$(CONFIG_GCOV_FORMAT_3_4) += gcc_3_4.o obj-$(CONFIG_GCOV_FORMAT_4_7) += gcc_4_7.o -obj-$(CONFIG_GCOV_FORMAT_AUTODETECT) += $(call cc-ifversion, -lt, 0407, \ - gcc_3_4.o, gcc_4_7.o)