From patchwork Thu May 17 06:17:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 136109 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp1882766lji; Wed, 16 May 2018 23:25:40 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq+rlwCGDmKMGMrx2rYKmcvV979peEk1H34obb3E9Ei4u5ZOjHfJTsZcmQe4a3kUj7PMnfT X-Received: by 2002:a17:902:a4:: with SMTP id a33-v6mr3936334pla.346.1526538340756; Wed, 16 May 2018 23:25:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526538340; cv=none; d=google.com; s=arc-20160816; b=ktkPzQ/MqtIiZVM7hYTD8TH9aiAWZG0RfY37M8Esbvn2MJUR2ltiHVyjK8TTseRx3w FUzV5BeqaYsDH2q90U4nzz5/TxqmCEtaw0JWik0MhUNcLTtGDHuTCli2heY5TdBeBGR7 YLGerrE5tuLSbbiQgKh59zm6Ks/p6akOZRvLhzqX49rNA9ZaSHNDEGvbZHewd9ZP6/oQ m/7LlBt6P7C8JvyshtR0+SbkfgqmM5LU5TKHgrwfumGtjTUVDAPAmP/d0KVgNSiVTeFl ClbBSg1DQgJFyzuVW+cZjx+pxdjhNEtm7fKj0KXRQUFrqw3MGIM2pQVyBRH+5/Rlb4NM 8jDA== 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 g11-v6si4571991pfk.187.2018.05.16.23.25.40; Wed, 16 May 2018 23:25:40 -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 S1752438AbeEQGZi (ORCPT + 29 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(-) -- 2.7.4 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)