Skip to content

Commit 6a61b70

Browse files
committed
gcov: remove CONFIG_GCOV_FORMAT_AUTODETECT
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 <[email protected]> Acked-by: Peter Oberparleiter <[email protected]> Reviewed-by: Kees Cook <[email protected]>
1 parent f3a53f7 commit 6a61b70

File tree

2 files changed

+5
-14
lines changed

2 files changed

+5
-14
lines changed

kernel/gcov/Kconfig

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,23 +53,16 @@ config GCOV_PROFILE_ALL
5353
choice
5454
prompt "Specify GCOV format"
5555
depends on GCOV_KERNEL
56-
default GCOV_FORMAT_AUTODETECT
5756
---help---
58-
The gcov format is usually determined by the GCC version, but there are
57+
The gcov format is usually determined by the GCC version, and the
58+
default is chosen according to your GCC version. However, there are
5959
exceptions where format changes are integrated in lower-version GCCs.
60-
In such a case use this option to adjust the format used in the kernel
61-
accordingly.
62-
63-
If unsure, choose "Autodetect".
64-
65-
config GCOV_FORMAT_AUTODETECT
66-
bool "Autodetect"
67-
---help---
68-
Select this option to use the format that corresponds to your GCC
69-
version.
60+
In such a case, change this option to adjust the format used in the
61+
kernel accordingly.
7062

7163
config GCOV_FORMAT_3_4
7264
bool "GCC 3.4 format"
65+
depends on CC_IS_GCC && GCC_VERSION < 40700
7366
---help---
7467
Select this option to use the format defined by GCC 3.4.
7568

kernel/gcov/Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,3 @@ ccflags-y := -DSRCTREE='"$(srctree)"' -DOBJTREE='"$(objtree)"'
44
obj-y := base.o fs.o
55
obj-$(CONFIG_GCOV_FORMAT_3_4) += gcc_3_4.o
66
obj-$(CONFIG_GCOV_FORMAT_4_7) += gcc_4_7.o
7-
obj-$(CONFIG_GCOV_FORMAT_AUTODETECT) += $(call cc-ifversion, -lt, 0407, \
8-
gcc_3_4.o, gcc_4_7.o)

0 commit comments

Comments
 (0)