Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2141967imm; Mon, 28 May 2018 02:28:03 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrFSv0oj0fE1VA2ZskVOYYYhwLvsjgLURbOhUhOQPsPcdm52EHEpY0JcB5E0t1DRBPmw960 X-Received: by 2002:a62:3d54:: with SMTP id k81-v6mr12728499pfa.193.1527499683886; Mon, 28 May 2018 02:28:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527499683; cv=none; d=google.com; s=arc-20160816; b=Mrhl9S54BLCVg4PRXeA2RlRvxfKJ6WL6dPbEUGiCpvaPivFUsZHiS0ZCC9uthVI/f3 xkfD0x2X+XGev+D4LS+q75C08P/c8NpUH+7Z+gJOr8PTlfCcWeErSmwtsXzeGnjKakx4 LXqewGzetJhWrZ8Ao4mpeeZauJ0P0S9z9N1FN3Maq26d0HwSK8CnaSr8qWakkS/1x6lg FPWpyTyKJtI0xwCkSe0inrE8BEg2aIb0X5M+39qp0LgaEZgdrizJQMuWtiie+iHVmx4v O0VNyjjXaaL0wn9ZIOsNMzKMv74LJskT3+9Sf94hmeguUHLYpnCVGOR4HRF4SL82bG5K z/TA== 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=IAzcHIS9Fi06hYYNp+wVpi+eD+kV9WOpVbxdQ9nu4p8=; b=bZJlxC4mwOlO400KAPCCcAN7By710ROqT6Q7PpPzvtbKAuBH5J/3mPmqtaImmSXJqn TjNnuyhhEjkGF60JjawsyUy8nskidzBog8C42okAXjsKblc3xoZ/WLkPh5dNthxv0YVu zsTMgX9P1ZwLDHJRtMJ+8zgaEgUBJmP5brfh63OhxXG/dNM4jDOTtS5p5zyhSHJodt2z VldoHMSs71aoLO+/bGCjXsS9fwL2O/qFRLhul+DGVSEijC3dU24ZAkHODWO46ft018Ui OxKcpllZBYn9BPdxu3syMMxgrW08jGO59WYUcE02VdOZjnbFaYk3+K/0ACGPmN04bU0r DZzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=hKuP0wu8; 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 w1-v6si13702306ply.425.2018.05.28.02.27.49; Mon, 28 May 2018 02:28:03 -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=hKuP0wu8; 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 S933450AbeE1J1K (ORCPT + 99 others); Mon, 28 May 2018 05:27:10 -0400 Received: from conuserg-10.nifty.com ([210.131.2.77]:21909 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932110AbeE1JYZ (ORCPT ); Mon, 28 May 2018 05:24:25 -0400 Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-10.nifty.com with ESMTP id w4S9MInh027506; Mon, 28 May 2018 18:22:40 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com w4S9MInh027506 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1527499361; bh=IAzcHIS9Fi06hYYNp+wVpi+eD+kV9WOpVbxdQ9nu4p8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hKuP0wu88c7QkHzGoN5HUzwWgN4w3M22w+fkfzGZL5+Y1LLhScd7xn06WlB7GDBEN tybUSNWtmLG9QcgNh8rtjqNa+CSMCJrKpt2TS94x3uhtm0Blcw2ygEAqw8F+OGTPBU Hon24GYKGs+BVRZCxT21jVkxMmDQ12oR9Ub4uCdkYyQHucl0bNfqIbuDMAvZPpIa5m Sz4xlX/iZvYMC4IPfcwnvLZgPCnFGl6+9jncm/XVfTSsKBa9HXLkNuM7Ab+spOhK3J aM7rFnhaao5/0Vo76r2KneU37QUBpMJEiVYN2r9j/AyLwQWd6a2O/qrrGGb9jQTdBB A7RjNalIbiXew== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Kees Cook , Nicholas Piggin , "Luis R . Rodriguez" , Randy Dunlap , Ulf Magnusson , Sam Ravnborg , Linus Torvalds , Masahiro Yamada Subject: [PATCH v5 26/31] gcov: remove CONFIG_GCOV_FORMAT_AUTODETECT Date: Mon, 28 May 2018 18:22:03 +0900 Message-Id: <1527499328-13213-27-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1527499328-13213-1-git-send-email-yamada.masahiro@socionext.com> References: <1527499328-13213-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 v5: None 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