Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2907187imm; Wed, 16 May 2018 23:26:31 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqER1blSRq/5O6VOM9FpzCwnT7MyLhWVlLyhE7bDzx4kRdR/g0KhH6yEAPzlpn3Jp9+NxnT X-Received: by 2002:a65:6005:: with SMTP id m5-v6mr3143630pgu.241.1526538391617; Wed, 16 May 2018 23:26:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526538391; cv=none; d=google.com; s=arc-20160816; b=ClsQF6riu5Arc0LM9qpegfOW8j5LO7XJjb/yAywq1OKX6og2ayIvWtV29UmVWuOjkc grJ28vPByM9rWqjc2x2dXvBjkIvqtuO2dIXJotlvyofCmQIhNXV7f8anHcPpaHYr/u2g VaqALNdW2ywg+E/NDL7lBOFxcf/RFrJXpXKm0MnH4NJNyT8oWy9E/163GAi47+a0119t UWCB+Rbd6LlBQtIzZX5kNzm41sPBMcfuUfFUDZt+BqCFIKGyXaMKt+DI5Xt5uO24QtHR aqNty5nidiiWp5AedXAsfEBoE/D4q83muPOGO3X9D9r9I4eyQf/QdFohilBQvhww1bEd fLFg== 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=ehbSBriZlrpst+Z7nyiIz+ZrCm8J63ZOc5Y+RuSZkoc=; b=qLjLoQVuyfnCbIsZpsbOF+7sjVOskLTjC0V/Urp9/WmcWO2RQVEyHcTc8QQ6nzkIF1 XjKgF49CXEeLHyjVmTUP3fzhEJVJkGKsBTGsbfzKQO7AUiie/u+7Xy65n6FvkqmUSIhW IfGiZptOKcusBEByQslLf2eaLYG8VR8SYxzJJm+Rsz7ctkYn6VjqKB4T7OlsZi2ZW0dr jBquUQ4LNFW5WCxM8dF1sthoXnlWGiG2boEkVjqZy8/4fWzHDgo0MJ4MzkXcx3CLMufO JqItMvFVPbeUvXdohPf+t6k2pVuV1olXj/Q8JL4SYLpAfVvBFUJRnEZr/s1hUvPwQl3+ F0zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=wtKUkMQ0; 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 s1-v6si4671462pfb.39.2018.05.16.23.26.17; Wed, 16 May 2018 23:26:31 -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=wtKUkMQ0; 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 S1752420AbeEQGZi (ORCPT + 99 others); Thu, 17 May 2018 02:25:38 -0400 Received: from conuserg-10.nifty.com ([210.131.2.77]:24998 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751698AbeEQGTQ (ORCPT ); Thu, 17 May 2018 02:19:16 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-10.nifty.com with ESMTP id w4H6HbUO002841; Thu, 17 May 2018 15:18:03 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com w4H6HbUO002841 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1526537884; bh=ehbSBriZlrpst+Z7nyiIz+ZrCm8J63ZOc5Y+RuSZkoc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wtKUkMQ0heHWH2opm6x7jy0dMEzvN3WnSN6nPtv9fnXcqNJjmjIhx5giAbE5jhw+P NvN5+e0OQ/VLkezUxgGnVHjLxk8gRG16prXcoVTf9Njg5/5CPSHMaHARMS5hZIL2ME H7EeS/vGAVq5P7pjSPSn2pPzuXoqPLnkraXoiBiajR7Uf78xBUnuIoFe852eHngXP9 XKN8S91Lzxmo3IRicg0T3CafOASRg8qVM8p7tnmsvM/kgaaEbS0ioOQZmDhhhXOfyn bbyynVLFnbcC107sGP3cnOG0to/qhHnLGNqUzb4ZQlALFrYPg1/b6s8iEx36w7ID2Z yk+Jx2aZdCVmg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Linus Torvalds , Sam Ravnborg , Ulf Magnusson , "Luis R . Rodriguez" , linux-kernel@vger.kernel.org, Nicholas Piggin , Kees Cook , Emese Revfy , x86@kernel.org, Masahiro Yamada Subject: [PATCH v4 26/31] gcov: remove CONFIG_GCOV_FORMAT_AUTODETECT Date: Thu, 17 May 2018 15:17:05 +0900 Message-Id: <1526537830-22606-27-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526537830-22606-1-git-send-email-yamada.masahiro@socionext.com> References: <1526537830-22606-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 downgrade the compiler to 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 Acked-by: Peter Oberparleiter Reviewed-by: Kees Cook --- Changes in v4: None Changes in v3: None Changes in v2: None kernel/gcov/Kconfig | 17 +++++------------ kernel/gcov/Makefile | 2 -- 2 files changed, 5 insertions(+), 14 deletions(-) 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) -- 2.7.4