From patchwork Mon May 28 09:22:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 137052 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp2593987lji; Mon, 28 May 2018 02:27:13 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoqqJSMueWL7dYo6DvQsD3Re6C2XPYKXLiMCJCI8ZQPrn1YgZlDetw/pxXTsSyDlobXQ1NF X-Received: by 2002:a17:902:748b:: with SMTP id h11-v6mr13124912pll.12.1527499632918; Mon, 28 May 2018 02:27:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527499632; cv=none; d=google.com; s=arc-20160816; b=j2xfiKEg5S6diUakZgeaQqegkk8/8uRApCM1/zFheJCresy0BVioqkZwieIeGPlWs4 pfE16dw7CCBGVQu3V751r7hu7nCnDTSoVAcjm9iz/gPDFYiNEsHfNxbqpYVUpRVEOCVy lLuXxGLL9/00RnkS/JxA4wD3xS6VMdnbMuyRKAiNR6FYS1M1FrYHQGaCfuzxNCHG1lRT oGc1JDBVp3uDDPqpKoGPN25N5qT6zYrYNko6QX0uv9iA8KrzppAI1VpFg/fQxgQckybl MrnVkGbeJS4pfgypAzGMlXVusDj/NDznUM9D6tIG9uvDcEgiD3AHY9Uqv63FP0lN52Cu XFig== 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 k2-v6si1838978pgp.200.2018.05.28.02.27.12; Mon, 28 May 2018 02:27:12 -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 S933639AbeE1J1K (ORCPT + 30 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(-) -- 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)