Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
gcov: fail build on gcov_info size mismatch
gcov kernel profiling works by emulating parts of GCC's libgcov in the kernel, including a definition of struct gcov_info used by profiling code to handle coverage data. The original definition of this data type is not available outside of GCC's source tree, and when it changes with new GCC versions the result may be hard-to-debug kernel failures [1]. This patch adds a compile-time check to ensure that the kernel's version of struct gcov_info has the same length as the one used by GCC as determined by looking at GCC's assembler output. This check should help reduce the number of run-time failures when using gcov kernel support with new GCC versions that include updates to struct gcov_info. Tested with various GCC versions between 4.9 and 10, and also Clang 11. [1] https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1891288 Signed-off-by: Peter Oberparleiter <oberpar@linux.ibm.com>
- Loading branch information