From patchwork Fri Apr 13 05:06:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 133316 Delivered-To: patch@linaro.org Received: by 10.46.84.18 with SMTP id i18csp344674ljb; Thu, 12 Apr 2018 22:09:06 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/tudrVifkaNZIkQEGnoSK6uWgBF5YD2l9umb6XD6ESJfQ58x6PUueac5S4lO3YhBgn9Zz3 X-Received: by 2002:a17:902:74c3:: with SMTP id f3-v6mr3804143plt.7.1523596145944; Thu, 12 Apr 2018 22:09:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523596145; cv=none; d=google.com; s=arc-20160816; b=1CYoxMWcirMiSipIoDXJxf0ZAwOlxmjGNkEOSTGEAmlWoifSHtDdyUfqw3YaBX7ETV vwU3aze5tgRP9SWsRgREcW47Yvexo7VTty68KDyr/pRNrPc7QU+kyG4tXC7dmXpwEK61 WMi9Z7RpZpze1dEBYlYyG9BsJcqpRnm882pC9aovpOihO8CYpxT1jWaKvRRQvJ14cvFs mxfPQ0foczGi9k7bfdepoF1oNojxnFJDW3eLkpWxQcKhldzLtK0NzVe3mDBHwxIqIu23 W5rN1wZYW4dQ1DS8DI4Tvleh5orfhc47IRAvwJ+aoZpGbpbtXpNAQ046WdR6c2clkgKq SGPA== 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=eF3nICI6HHjEYvPOol4CqwbYkKB2xRWzW4BAhvRa9Yc=; b=w0GrXkq6BKtyF7QVaVMvCY0yIW91r1/jKkaG0lmZ108HwlGzFsirbr1vlfCzBu+z3y lOTtZQdF0XiNdwxQAqPtmqi0P60bQD239Xw3ZhPTC+YxzF1bY3xxul4jjXJjmwUlA/Zx KCOqZMh+lWVW0pj+OICaXjN8E6rZ4Xw6mE0psyVqQpcJvMaDvsStiqROmoHtFTbRt4Kt zxxfEVIQqRQC1r4AJkpdA9T2Qx4Op6rZ1k1Up6/0PTHWVo4+S2YekIU7ZHJTXlUpS3z5 6Py19egi+Iowdtj/GZkLBOPAIb0KsPTHLOFg2TOG84d1sFx/EHioXghkWd8Zc66djAFL bPtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=ekvVjdnn; 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 62si3949126pfs.45.2018.04.12.22.09.05; Thu, 12 Apr 2018 22:09:05 -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=ekvVjdnn; 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 S1753443AbeDMFJB (ORCPT + 29 others); Fri, 13 Apr 2018 01:09:01 -0400 Received: from conuserg-07.nifty.com ([210.131.2.74]:55808 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753244AbeDMFI7 (ORCPT ); Fri, 13 Apr 2018 01:08:59 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-07.nifty.com with ESMTP id w3D56lgI029209; Fri, 13 Apr 2018 14:07:09 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com w3D56lgI029209 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1523596030; bh=eF3nICI6HHjEYvPOol4CqwbYkKB2xRWzW4BAhvRa9Yc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ekvVjdnnDigEi5O/F9e9pMZ/TCF3qxWc1tZ1PA/otaZ3AiZzoS0v4xbztfuVotGwr 03nlEcfWf/JtxFLOKeGRjnE8FdLyQZGHyakHE6eZ+g7ysonlVziBHQsvaR2i6cQdAe XpnbI6hXvSMrX68cg6ISTrCDqYZzEtRmYE981H32e1sRDONN+Ni/3qdN9T0W8xMbUL JlpGPdUfQGg1kFdV8N/zw57e0gzskTPnrRTusL+kXlp23mCfH3Qqiauzrtsq4UF/aL kpLVb86uv7CzrulWOUgz3WlNY9NZ26gen9xdf1oMxYnLOrpgRTi0RgZR/blaB55IWp pvPFwvVDT/7oA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Linus Torvalds , Sam Ravnborg , Ulf Magnusson , Nicholas Piggin , Kees Cook , Emese Revfy , x86@kernel.org, Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH 24/30] gcov: remove CONFIG_GCOV_FORMAT_AUTODETECT Date: Fri, 13 Apr 2018 14:06:33 +0900 Message-Id: <1523595999-27433-25-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1523595999-27433-1-git-send-email-yamada.masahiro@socionext.com> References: <1523595999-27433-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 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)