]> git.baikalelectronics.ru Git - kernel.git/commit
x86, hweight: Fix BUG when booting with CONFIG_GCOV_PROFILE_ALL=y
authorPeter Oberparleiter <oberpar@linux.vnet.ibm.com>
Thu, 6 Feb 2014 14:58:20 +0000 (15:58 +0100)
committerH. Peter Anvin <hpa@zytor.com>
Thu, 6 Feb 2014 15:15:20 +0000 (07:15 -0800)
commit3058496f1a690d30a9a719d717e02d3aca7ee438
tree867fe6fc63d4c1e322802ee56ecec4793cf383fc
parent568f1d852d992bb35e38a627b53f437835618f98
x86, hweight: Fix BUG when booting with CONFIG_GCOV_PROFILE_ALL=y

Commit e461ce4c9a, "x86: Add optimized popcnt variants" introduced
compile flag -fcall-saved-rdi for lib/hweight.c. When combined with
options -fprofile-arcs and -O2, this flag causes gcc to generate
broken constructor code. As a result, a 64 bit x86 kernel compiled
with CONFIG_GCOV_PROFILE_ALL=y prints message "gcov: could not create
file" and runs into sproadic BUGs during boot.

The gcc people indicate that these kinds of problems are endemic when
using ad hoc calling conventions.  It is therefore best to treat any
file compiled with ad hoc calling conventions as an isolated
environment and avoid things like profiling or coverage analysis,
since those subsystems assume a "normal" calling conventions.

This patch avoids the bug by excluding lib/hweight.o from coverage
profiling.

Reported-by: Meelis Roos <mroos@linux.ee>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/r/52F3A30C.7050205@linux.vnet.ibm.com
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Cc: <stable@vger.kernel.org>
lib/Makefile